The representation of a 1D spectrum. More...
#include <OpenMS/KERNEL/MSSpectrum.h>
Classes | |
class | FloatDataArray |
Float data array class. More... | |
class | IntegerDataArray |
Integer data array class. More... | |
struct | RTLess |
Comparator for the retention time. More... | |
class | StringDataArray |
String data array class. More... | |
Public Types | |
Base type definitions | |
typedef PeakT | PeakType |
Peak type. More... | |
typedef PeakType::CoordinateType | CoordinateType |
Coordinate (m/z) type. More... | |
typedef std::vector< PeakType > | ContainerType |
Spectrum base type. More... | |
typedef std::vector< FloatDataArray > | FloatDataArrays |
Float data array vector type. More... | |
typedef std::vector< StringDataArray > | StringDataArrays |
String data array vector type. More... | |
typedef std::vector< IntegerDataArray > | IntegerDataArrays |
Integer data array vector type. More... | |
Peak container iterator type definitions | |
typedef ContainerType::iterator | Iterator |
Mutable iterator. More... | |
typedef ContainerType::const_iterator | ConstIterator |
Non-mutable iterator. More... | |
typedef ContainerType::reverse_iterator | ReverseIterator |
Mutable reverse iterator. More... | |
typedef ContainerType::const_reverse_iterator | ConstReverseIterator |
Non-mutable reverse iterator. More... | |
![]() | |
enum | |
Dimension of the position range. More... | |
typedef DRange< D > | PositionRangeType |
Position range type. More... | |
typedef DPosition< D > | PositionType |
Position Type. More... | |
typedef DRange< 1 > | IntensityRangeType |
Intensity range type. More... | |
![]() | |
enum | SpectrumType { UNKNOWN, PEAKS, RAWDATA, SIZE_OF_SPECTRUMTYPE } |
Spectrum peak type. More... | |
Public Member Functions | |
MSSpectrum () | |
Constructor. More... | |
MSSpectrum (const MSSpectrum &source) | |
Copy constructor. More... | |
~MSSpectrum () | |
Destructor. More... | |
MSSpectrum & | operator= (const MSSpectrum &source) |
Assignment operator. More... | |
bool | operator== (const MSSpectrum &rhs) const |
Equality operator. More... | |
bool | operator!= (const MSSpectrum &rhs) const |
Equality operator. More... | |
virtual void | updateRanges () |
Updates minimum and maximum position/intensity. More... | |
void | clear (bool clear_meta_data) |
Clears all data and meta data. More... | |
Accessors for meta information | |
Returns the absolute retention time (is seconds) | |
double | getRT () const |
void | setRT (double rt) |
Sets the absolute retention time (is seconds) More... | |
UInt | getMSLevel () const |
Returns the MS level. More... | |
void | setMSLevel (UInt ms_level) |
Sets the MS level. More... | |
const String & | getName () const |
Returns the name. More... | |
void | setName (const String &name) |
Sets the name. More... | |
Peak data array methods | |
These methods are used to annotate each peak in a spectrum with meta information. It is an intermediate way between storing the information in the peak's MetaInfoInterface and deriving a new peak type with members for this information. These statements should help you chose which approach to use
| |
const FloatDataArrays & | getFloatDataArrays () const |
Returns a const reference to the float meta data arrays. More... | |
FloatDataArrays & | getFloatDataArrays () |
Returns a mutable reference to the float meta data arrays. More... | |
const StringDataArrays & | getStringDataArrays () const |
Returns a const reference to the string meta data arrays. More... | |
StringDataArrays & | getStringDataArrays () |
Returns a mutable reference to the string meta data arrays. More... | |
const IntegerDataArrays & | getIntegerDataArrays () const |
Returns a const reference to the integer meta data arrays. More... | |
IntegerDataArrays & | getIntegerDataArrays () |
Returns a mutable reference to the integer meta data arrays. More... | |
Sorting peaks | |
void | sortByIntensity (bool reverse=false) |
Lexicographically sorts the peaks by their intensity. More... | |
void | sortByPosition () |
Lexicographically sorts the peaks by their position. More... | |
bool | isSorted () const |
Checks if all peaks are sorted with respect to ascending m/z. More... | |
Searching a peak or peak range | |
Size | findNearest (CoordinateType mz) const |
Binary search for the peak nearest to a specific m/z. More... | |
Iterator | MZBegin (CoordinateType mz) |
Binary search for peak range begin. More... | |
Iterator | MZBegin (Iterator begin, CoordinateType mz, Iterator end) |
Binary search for peak range begin. More... | |
Iterator | MZEnd (CoordinateType mz) |
Binary search for peak range end (returns the past-the-end iterator) More... | |
Iterator | MZEnd (Iterator begin, CoordinateType mz, Iterator end) |
Binary search for peak range end (returns the past-the-end iterator) More... | |
ConstIterator | MZBegin (CoordinateType mz) const |
Binary search for peak range begin. More... | |
ConstIterator | MZBegin (ConstIterator begin, CoordinateType mz, ConstIterator end) const |
Binary search for peak range begin. More... | |
ConstIterator | MZEnd (CoordinateType mz) const |
Binary search for peak range end (returns the past-the-end iterator) More... | |
ConstIterator | MZEnd (ConstIterator begin, CoordinateType mz, ConstIterator end) const |
Binary search for peak range end (returns the past-the-end iterator) More... | |
![]() | |
RangeManager () | |
Default constructor. More... | |
RangeManager (const RangeManager &rhs) | |
Copy constructor. More... | |
virtual | ~RangeManager () |
Destructor. More... | |
RangeManager & | operator= (const RangeManager &rhs) |
Assignment operator. More... | |
bool | operator== (const RangeManager &rhs) const |
Equality operator. More... | |
bool | operator!= (const RangeManager &rhs) const |
Equality operator. More... | |
const PositionType & | getMin () const |
Returns the minimum position. More... | |
const PositionType & | getMax () const |
Returns the maximum position. More... | |
double | getMinInt () const |
Returns the minimum intensity. More... | |
double | getMaxInt () const |
Returns the maximum intensity. More... | |
void | clearRanges () |
Resets the ranges. More... | |
![]() | |
SpectrumSettings () | |
Constructor. More... | |
SpectrumSettings (const SpectrumSettings &source) | |
Copy constructor. More... | |
~SpectrumSettings () | |
Destructor. More... | |
SpectrumSettings & | operator= (const SpectrumSettings &source) |
bool | operator== (const SpectrumSettings &rhs) const |
Equality operator. More... | |
bool | operator!= (const SpectrumSettings &rhs) const |
Equality operator. More... | |
void | unify (const SpectrumSettings &rhs) |
merge another spectrum setting into this one (data is usually appended, except for spectrum type which needs to be unambiguous to be kept) More... | |
SpectrumType | getType () const |
returns the spectrum type More... | |
void | setType (SpectrumType type) |
sets the spectrum type More... | |
const String & | getNativeID () const |
returns the native identifier for the spectrum, used by the acquisition software. More... | |
void | setNativeID (const String &native_id) |
sets the native identifier for the spectrum, used by the acquisition software. More... | |
const String & | getComment () const |
returns the free-text comment More... | |
void | setComment (const String &comment) |
sets the free-text comment More... | |
const InstrumentSettings & | getInstrumentSettings () const |
returns a const reference to the instrument settings of the current spectrum More... | |
InstrumentSettings & | getInstrumentSettings () |
returns a mutable reference to the instrument settings of the current spectrum More... | |
void | setInstrumentSettings (const InstrumentSettings &instrument_settings) |
sets the instrument settings of the current spectrum More... | |
const AcquisitionInfo & | getAcquisitionInfo () const |
returns a const reference to the acquisition info More... | |
AcquisitionInfo & | getAcquisitionInfo () |
returns a mutable reference to the acquisition info More... | |
void | setAcquisitionInfo (const AcquisitionInfo &acquisition_info) |
sets the acquisition info More... | |
const SourceFile & | getSourceFile () const |
returns a const reference to the source file More... | |
SourceFile & | getSourceFile () |
returns a mutable reference to the source file More... | |
void | setSourceFile (const SourceFile &source_file) |
sets the source file More... | |
const std::vector< Precursor > & | getPrecursors () const |
returns a const reference to the precursors More... | |
std::vector< Precursor > & | getPrecursors () |
returns a mutable reference to the precursors More... | |
void | setPrecursors (const std::vector< Precursor > &precursors) |
sets the precursors More... | |
const std::vector< Product > & | getProducts () const |
returns a const reference to the products More... | |
std::vector< Product > & | getProducts () |
returns a mutable reference to the products More... | |
void | setProducts (const std::vector< Product > &products) |
sets the products More... | |
const std::vector< PeptideIdentification > & | getPeptideIdentifications () const |
returns a const reference to the PeptideIdentification vector More... | |
std::vector< PeptideIdentification > & | getPeptideIdentifications () |
returns a mutable reference to the PeptideIdentification vector More... | |
void | setPeptideIdentifications (const std::vector< PeptideIdentification > &identifications) |
sets the PeptideIdentification vector More... | |
const std::vector< DataProcessing > & | getDataProcessing () const |
returns a const reference to the description of the applied processing More... | |
std::vector< DataProcessing > & | getDataProcessing () |
returns a mutable reference to the description of the applied processing More... | |
void | setDataProcessing (const std::vector< DataProcessing > &data_processing) |
sets the description of the applied processing More... | |
![]() | |
MetaInfoInterface () | |
constructor More... | |
MetaInfoInterface (const MetaInfoInterface &rhs) | |
copy constructor More... | |
~MetaInfoInterface () | |
destructor More... | |
MetaInfoInterface & | operator= (const MetaInfoInterface &rhs) |
assignment operator More... | |
bool | operator== (const MetaInfoInterface &rhs) const |
Equality operator. More... | |
bool | operator!= (const MetaInfoInterface &rhs) const |
Equality operator. More... | |
const DataValue & | getMetaValue (const String &name) const |
returns the value corresponding to a string More... | |
const DataValue & | getMetaValue (UInt index) const |
returns the value corresponding to an index More... | |
bool | metaValueExists (const String &name) const |
returns if this MetaInfo is set More... | |
bool | metaValueExists (UInt index) const |
returns if this MetaInfo is set More... | |
void | setMetaValue (const String &name, const DataValue &value) |
sets the DataValue corresponding to a name More... | |
void | setMetaValue (UInt index, const DataValue &value) |
sets the DataValue corresponding to an index More... | |
void | removeMetaValue (const String &name) |
Removes the DataValue corresponding to name if it exists. More... | |
void | removeMetaValue (UInt index) |
Removes the DataValue corresponding to index if it exists. More... | |
void | getKeys (std::vector< String > &keys) const |
fills the given vector with a list of all keys for which a value is set More... | |
void | getKeys (std::vector< UInt > &keys) const |
fills the given vector with a list of all keys for which a value is set More... | |
bool | isMetaEmpty () const |
returns if the MetaInfo is empty More... | |
void | clearMetaInfo () |
removes all meta values More... | |
Additional Inherited Members | |
![]() | |
static MetaInfoRegistry & | metaRegistry () |
returns a reference to the MetaInfoRegistry More... | |
![]() | |
static const std::string | NamesOfSpectrumType [SIZE_OF_SPECTRUMTYPE] |
Names of spectrum types. More... | |
![]() | |
void | updateRanges_ (const PeakIteratorType &begin, const PeakIteratorType &end) |
Updates the range using data points in the iterator range. More... | |
![]() | |
void | createIfNotExists_ () |
creates the MetaInfo object if it does not exist More... | |
The representation of a 1D spectrum.
It contains peak data and metadata about specific instrument settings, acquisition settings, description of the meta values used in the peaks and precursor info (SpectrumSettings).
Several MSSpectrum instances are contained in a peak map (MSExperiment), which is essentially a vector of spectra with additional information about the experiment.
Precursor info from SpectrumSettings should only be used if this spectrum is a tandem-MS spectrum. The precursor spectrum is the first spectrum in MSExperiment, that has a lower MS-level than the current spectrum.
typedef ContainerType::const_iterator ConstIterator |
Non-mutable iterator.
typedef ContainerType::const_reverse_iterator ConstReverseIterator |
Non-mutable reverse iterator.
typedef std::vector<PeakType> ContainerType |
Spectrum base type.
Coordinate (m/z) type.
typedef std::vector<FloatDataArray> FloatDataArrays |
Float data array vector type.
typedef std::vector<IntegerDataArray> IntegerDataArrays |
Integer data array vector type.
typedef ContainerType::iterator Iterator |
Mutable iterator.
typedef ContainerType::reverse_iterator ReverseIterator |
Mutable reverse iterator.
typedef std::vector<StringDataArray> StringDataArrays |
String data array vector type.
|
inline |
Constructor.
|
inline |
Copy constructor.
|
inline |
Destructor.
|
inline |
Clears all data and meta data.
clear_meta_data | If true, all meta data is cleared in addition to the data. |
Referenced by SpectraMerger::averageCentroidSpectra_(), SpectraMerger::averageProfileSpectra_(), MSDataCachedConsumer::consumeSpectrum(), IDEvaluationBase::getPoints(), MS2File::load(), XMassFile::load(), DTA2DFile::load(), PeakPickerHiRes::pick(), and PeakPickerIterative::pick().
|
inline |
Binary search for the peak nearest to a specific m/z.
mz | The searched for mass-to-charge ratio searched |
Exception::Precondition | is thrown if the spectrum is empty (not only in debug mode) |
Referenced by SimpleSearchEngine::computeHyperScore().
|
inline |
Returns a const reference to the float meta data arrays.
Referenced by MetaDataBrowser::add(), MzMLHandler< MSExperiment<> >::addSpectrumMetaData_(), MzDataHandler< MapType >::characters(), MzDataHandler< MapType >::fillData_(), TwoDOptimization::optimizeRegionsScanwise_(), DataFilters::passes(), PeakPickerIterative::pick(), MzMLHandler< MSExperiment<> >::populateSpectraWithData_(), MSSpectrum< RichPeak1D >::setName(), MzDataHandler< MapType >::startElement(), MzMLHandler< MapType >::writeSpectrum_(), and MzDataHandler< MapType >::writeTo().
|
inline |
Returns a mutable reference to the float meta data arrays.
|
inline |
Returns a const reference to the integer meta data arrays.
Referenced by MetaDataBrowser::add(), MzMLHandler< MSExperiment<> >::addSpectrumMetaData_(), DataFilters::passes(), MzMLHandler< MSExperiment<> >::populateSpectraWithData_(), and MzMLHandler< MapType >::writeSpectrum_().
|
inline |
Returns a mutable reference to the integer meta data arrays.
|
inline |
Returns the MS level.
For survey scans this is 1, for MS/MS scans 2, ...
Referenced by FullSwathFileConsumer::consumeSpectrum(), SwathFile::countScansInSwath_(), MzDataHandler< MapType >::cvParam_(), MzMLHandler< MapType >::handleCVParam_(), PeakPickerHiRes::pick(), PeakPickerIterative::pick(), MzDataHandler< MapType >::startElement(), MzMLHandler< MapType >::writeSpectrum_(), MzDataHandler< MapType >::writeTo(), and MzXMLHandler< MapType >::writeTo().
|
inline |
Returns the name.
Referenced by PeakPickerHiRes::pick(), and PeakPickerIterative::pick().
|
inline |
Referenced by IsotopeWaveletTransform< PeakType >::checkPositionForPlausibility_(), MzDataHandler< MapType >::cvParam_(), GaussFilter::filter(), MzMLHandler< MapType >::handleCVParam_(), IsotopeWaveletTransform< PeakType >::identifyCharge(), IsotopeWaveletTransform< PeakType >::initializeScan(), DTA2DFile::load(), TOPPRNPxl::main_(), OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap(), SpectraMerger::mergeSpectra_(), MSSpectrum< PeakT >::RTLess::operator()(), PeakPickerHiRes::pick(), PeakPickerIterative::pick(), MzMLHandler< MapType >::writeSpectrum_(), MzDataHandler< MapType >::writeTo(), and MzXMLHandler< MapType >::writeTo().
|
inline |
Returns a const reference to the string meta data arrays.
Referenced by MetaDataBrowser::add(), MzMLHandler< MSExperiment<> >::addSpectrumMetaData_(), MzMLHandler< MSExperiment<> >::populateSpectraWithData_(), and MzMLHandler< MapType >::writeSpectrum_().
|
inline |
Returns a mutable reference to the string meta data arrays.
|
inline |
Checks if all peaks are sorted with respect to ascending m/z.
Referenced by MRMTransitionGroupPicker::pickTransitionGroup().
|
inline |
Binary search for peak range begin.
Referenced by IsotopeWaveletTransform< PeakType >::checkPositionForPlausibility_(), IsotopeWaveletTransform< PeakType >::checkPPMTheoModel_(), MSSpectrum< RichPeak1D >::findNearest(), IsotopeWaveletTransform< PeakType >::identifyCharge(), IsotopeWaveletTransform< PeakType >::initializeScan(), IsotopeWaveletTransform< PeakType >::mapSeeds2Features(), IsotopeWaveletTransform< PeakType >::TransSpectrum::MZBegin(), and IsotopeWaveletTransform< PeakType >::scoreThis_().
|
inline |
Binary search for peak range begin.
|
inline |
Binary search for peak range begin.
|
inline |
Binary search for peak range begin.
|
inline |
Binary search for peak range end (returns the past-the-end iterator)
Referenced by SignalToNoiseOpenMS< PeakT >::getValueAtRT(), IsotopeWaveletTransform< PeakType >::identifyCharge(), IsotopeWaveletTransform< PeakType >::initializeScan(), and IsotopeWaveletTransform< PeakType >::TransSpectrum::MZEnd().
|
inline |
Binary search for peak range end (returns the past-the-end iterator)
|
inline |
Binary search for peak range end (returns the past-the-end iterator)
|
inline |
Binary search for peak range end (returns the past-the-end iterator)
|
inline |
Equality operator.
|
inline |
Assignment operator.
|
inline |
Equality operator.
|
inline |
Sets the MS level.
Referenced by MzDataHandler< MapType >::cvParam_(), MzMLHandler< MapType >::handleCVParam_(), MS2File::load(), MascotInfile::load(), XMassFile::load(), MascotGenericFile::load(), OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap(), SpectraMerger::mergeSpectra_(), PeakPickerHiRes::pick(), PeakPickerIterative::pick(), MSExperiment< SimPointType >::set2DData(), TOPPViewBase::showSpectrumGenerationDialog(), and MzDataHandler< MapType >::startElement().
|
inline |
Sets the name.
Referenced by XMassFile::load(), TOPPRNPxl::main_(), PeakPickerHiRes::pick(), and PeakPickerIterative::pick().
|
inline |
Sets the absolute retention time (is seconds)
Referenced by MzDataHandler< MapType >::cvParam_(), MzMLHandler< MapType >::endElement(), TwoDOptimization::getRegionEndpoints_(), MzMLHandler< MapType >::handleCVParam_(), MascotInfile::load(), XMassFile::load(), DTA2DFile::load(), TOPPRNPxl::main_(), OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap(), SpectraMerger::mergeSpectra_(), TwoDOptimization::optimize(), PeakPickerHiRes::pick(), PeakPickerIterative::pick(), MSExperiment< SimPointType >::RTBegin(), MSExperiment< SimPointType >::RTEnd(), and MSExperiment< SimPointType >::set2DData().
|
inline |
Lexicographically sorts the peaks by their intensity.
Sorts the peaks according to ascending intensity. Meta data arrays will be sorted accordingly.
Referenced by IsotopeWaveletTransform< PeakType >::identifyCharge(), OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap(), and MRMTransitionGroupPicker::pickTransitionGroup().
|
inline |
Lexicographically sorts the peaks by their position.
The spectrum is sorted with respect to position. Meta data arrays will be sorted accordingly.
Referenced by MarkerIonExtractor::extractMarkerIons(), SimpleSearchEngine::main_(), SpectraMerger::mergeSpectra_(), PeakPickerIterative::pick(), PeakPickerHiRes::pickExperiment(), and MRMTransitionGroupPicker::pickTransitionGroup().
|
inlinevirtual |
Updates minimum and maximum position/intensity.
This method is usually implemented by calling clearRanges() and updateRanges_().
Implements RangeManager< 1 >.
|
protected |
Float data arrays.
Referenced by MSSpectrum< RichPeak1D >::clear(), MSSpectrum< RichPeak1D >::getFloatDataArrays(), MSSpectrum< RichPeak1D >::operator=(), MSSpectrum< RichPeak1D >::operator==(), MSSpectrum< RichPeak1D >::setName(), MSSpectrum< RichPeak1D >::sortByIntensity(), and MSSpectrum< RichPeak1D >::sortByPosition().
|
protected |
|
protected |
|
protected |
Name.
Referenced by MSSpectrum< RichPeak1D >::operator=().
|
protected |
|
protected |
OpenMS / TOPP release 2.0.0 | Documentation generated on Wed Mar 30 2016 12:49:29 using doxygen 1.8.11 |