libpappsomspp
Library for mass spectrometry
|
Class to represent a mass spectrum. More...
#include <massspectrum.h>
Public Member Functions | |
MassSpectrum () | |
MassSpectrum (std::vector< std::pair< pappso_double, pappso_double >> &data_point_vector) | |
MassSpectrum (std::vector< DataPoint > &data_point_vector) | |
MassSpectrum (const MapTrace &other) | |
MassSpectrum (const Trace &other) | |
MassSpectrum (Trace &&other) | |
MassSpectrum (const MassSpectrum &other) | |
MassSpectrum (MassSpectrum &&other) | |
virtual | ~MassSpectrum () |
virtual MassSpectrum & | operator= (const MassSpectrum &other) |
virtual MassSpectrum & | operator= (MassSpectrum &&other) |
MassSpectrumSPtr | makeMassSpectrumSPtr () const |
MassSpectrumCstSPtr | makeMassSpectrumCstSPtr () const |
virtual MassSpectrum & | massSpectrumFilter (const MassSpectrumFilterInterface &filter) final |
apply a filter on this MassSpectrum More... | |
pappso_double | totalIonCurrent () const |
Compute the total ion current of this mass spectrum. More... | |
pappso_double | tic () const |
Compute the total ion current of this mass spectrum. More... | |
pappso_double | tic (double mzStart, double mzEnd) |
const DataPoint & | maxIntensityDataPoint () const |
Find the DataPoint instance having the greatest intensity (y) value. More... | |
const DataPoint & | minIntensityDataPoint () const |
Find the DataPoint instance having the smallest intensity (y) value. More... | |
void | sortMz () |
Sort the DataPoint instances of this spectrum. More... | |
bool | equals (const MassSpectrum &other, PrecisionPtr precision) const |
Tells if this MassSpectrum is equal to massSpectrum . More... | |
MassSpectrum | filterSum (const MzRange &mass_range) const |
void | debugPrintValues () const |
![]() | |
Trace () | |
Trace (const std::vector< pappso_double > &xVector, const std::vector< pappso_double > &yVector) | |
Trace (const std::vector< std::pair< pappso_double, pappso_double >> &dataPoints) | |
Trace (const std::vector< DataPoint > &dataPoints) | |
Trace (const std::vector< DataPoint > &&dataPoints) | |
Trace (const MapTrace &map_trace) | |
Trace (const Trace &other) | |
Trace (const Trace &&other) | |
virtual | ~Trace () |
size_t | initialize (const std::vector< pappso_double > &xVector, const std::vector< pappso_double > &yVector) |
size_t | initialize (const Trace &other) |
size_t | initialize (const std::map< pappso_double, pappso_double > &map) |
virtual Trace & | operator= (const Trace &x) |
virtual Trace & | operator= (Trace &&x) |
TraceSPtr | makeTraceSPtr () const |
TraceCstSPtr | makeTraceCstSPtr () const |
size_t | append (const DataPoint &data_point) |
appends a datapoint and return new size More... | |
std::vector< pappso_double > | xValues () const |
std::vector< pappso_double > | yValues () const |
std::map< pappso_double, pappso_double > | toMap () const |
DataPoint | containsX (pappso_double value, PrecisionPtr precision_p=nullptr) const |
const DataPoint & | minYDataPoint () const |
const DataPoint & | maxYDataPoint () const |
pappso_double | minY () const |
pappso_double | maxY () const |
pappso_double | maxY (double mzStart, double mzEnd) const |
pappso_double | sumY () const |
pappso_double | sumY (double mzStart, double mzEnd) const |
void | sortX () |
void | sortY () |
void | unique () |
virtual Trace & | filter (const FilterInterface &filter) final |
apply a filter on this trace More... | |
QString | toString () const |
std::vector< DataPoint >::const_iterator | dataPointCstIteratorWithX (pappso_double value) const |
find datapoint with exactly x value More... | |
Additional Inherited Members | |
![]() | |
std::size_t | dataPointIndexWithX (pappso_double value) const |
std::vector< DataPoint >::iterator | dataPointIteratorWithX (pappso_double value) |
Class to represent a mass spectrum.
A mass spectrum is a collection of DataPoint instances. Moreover, it has internal data that represent the context of the acquisition of the data: retention time and drift time (if the experiment was an ion mobility mass spectrometry experiment).
A MassSpectrum cannot perform combinations. For combination of mass spectra, the class to use is MassSpectrumCombinator.
Definition at line 70 of file massspectrum.h.
pappso::MassSpectrum::MassSpectrum | ( | ) |
Definition at line 61 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | std::vector< std::pair< pappso_double, pappso_double >> & | data_point_vector | ) |
Definition at line 66 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | std::vector< DataPoint > & | data_point_vector | ) |
Definition at line 72 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | const MapTrace & | other | ) |
Definition at line 81 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | const Trace & | other | ) |
Definition at line 77 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | Trace && | other | ) |
Definition at line 86 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | const MassSpectrum & | other | ) |
Definition at line 91 of file massspectrum.cpp.
pappso::MassSpectrum::MassSpectrum | ( | MassSpectrum && | other | ) |
Definition at line 97 of file massspectrum.cpp.
|
virtual |
Definition at line 107 of file massspectrum.cpp.
void pappso::MassSpectrum::debugPrintValues | ( | ) | const |
Definition at line 333 of file massspectrum.cpp.
bool pappso::MassSpectrum::equals | ( | const MassSpectrum & | other, |
PrecisionPtr | precision | ||
) | const |
Tells if this
MassSpectrum is equal to massSpectrum
.
To compare this
to massSpectrum
, a tolerance is applied to both the x and y values, that is defined using precision
.
massSpectrum | Mass spectrum to compare to this . |
precision | Precision to be used to perform the comparison of the x and y values of the data points in this and \massSpectrum mass spectra. |
Definition at line 224 of file massspectrum.cpp.
References pappso::MzRange::contains(), and pappso::PrecisionFactory::getPpmInstance().
MassSpectrum pappso::MassSpectrum::filterSum | ( | const MzRange & | mass_range | ) | const |
Definition at line 264 of file massspectrum.cpp.
References pappso::a, pappso::b, pappso::MzRange::lower(), and pappso::MzRange::upper().
MassSpectrumCstSPtr pappso::MassSpectrum::makeMassSpectrumCstSPtr | ( | ) | const |
Definition at line 138 of file massspectrum.cpp.
MassSpectrumSPtr pappso::MassSpectrum::makeMassSpectrumSPtr | ( | ) | const |
Definition at line 131 of file massspectrum.cpp.
Referenced by pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr(), and pappso::XyMsRunReader::qualifiedMassSpectrumFromXyMSDataFile().
|
finalvirtual |
apply a filter on this MassSpectrum
filter | to process the MassSpectrum |
Definition at line 407 of file massspectrum.cpp.
References pappso::Trace::filter().
Referenced by pappso::XtandemSpectrumProcess::process().
const DataPoint & pappso::MassSpectrum::maxIntensityDataPoint | ( | ) | const |
Find the DataPoint instance having the greatest intensity (y) value.
Definition at line 183 of file massspectrum.cpp.
References pappso::Trace::maxYDataPoint().
const DataPoint & pappso::MassSpectrum::minIntensityDataPoint | ( | ) | const |
Find the DataPoint instance having the smallest intensity (y) value.
Definition at line 195 of file massspectrum.cpp.
References pappso::Trace::minYDataPoint().
|
virtual |
Definition at line 113 of file massspectrum.cpp.
|
virtual |
Definition at line 123 of file massspectrum.cpp.
void pappso::MassSpectrum::sortMz | ( | ) |
Sort the DataPoint instances of this spectrum.
The DataPoint instances are sorted according to the x value (the m/z value) and in increasing order.
Definition at line 207 of file massspectrum.cpp.
References pappso::Trace::sortX().
Referenced by pappso::MzIntegrationParams::createDataBasedBins(), and pappso::PwizMsRunReader::qualifiedMassSpectrumFromPwizSpectrumPtr().
pappso_double pappso::MassSpectrum::tic | ( | ) | const |
Compute the total ion current of this mass spectrum.
Convenience function that returns totalIonCurrent();
Definition at line 164 of file massspectrum.cpp.
References totalIonCurrent().
pappso_double pappso::MassSpectrum::tic | ( | double | mzStart, |
double | mzEnd | ||
) |
pappso_double pappso::MassSpectrum::totalIonCurrent | ( | ) | const |
Compute the total ion current of this mass spectrum.
The sum of all the separate ion currents carried by the ions of different m/z contributing to a complete mass massSpectrum or in a specified m/z range of a mass massSpectrum. MS:1000285
Definition at line 153 of file massspectrum.cpp.
References pappso::Trace::sumY().
Referenced by tic().