Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Member Functions | Protected Member Functions | Protected Attributes

MSExperiment< PeakT, ChromatogramPeakT > Class Template Reference
[Kernel]

Representation of a mass spectrometry experiment. More...

#include <OpenMS/KERNEL/MSExperiment.h>

Inheritance diagram for MSExperiment< PeakT, ChromatogramPeakT >:
RangeManager< 2 > ExperimentalSettings PersistentObject MetaInfoInterface DocumentIdentifier

List of all members.

Public Types

Base type definitions

typedef PeakT PeakType
 Peak type.
typedef ChromatogramPeakT ChromatogramPeakType
 Chromatogram peak type.
typedef DRange< 2 > AreaType
 Area type.
typedef PeakType::CoordinateType CoordinateType
 Coordinate type of peak positions.
typedef PeakType::IntensityType IntensityType
 Intenstiy type of peaks.
typedef RangeManager< 2 > RangeManagerType
 RangeManager type.
typedef MSSpectrum< PeakTypeSpectrumType
 Spectrum Type.
typedef MSChromatogram
< ChromatogramPeakType
ChromatogramType
 Chromatogram type.
typedef std::vector< SpectrumTypeBase
 STL base class type.
Iterator type definitions

typedef std::vector
< SpectrumType >::iterator 
Iterator
 Mutable iterator.
typedef std::vector
< SpectrumType >
::const_iterator 
ConstIterator
 Non-mutable iterator.
typedef Internal::AreaIterator
< PeakT, PeakT &, PeakT
*, Iterator, typename
SpectrumType::Iterator
AreaIterator
 Mutable area iterator type (for traversal of a rectangular subset of the peaks).
typedef Internal::AreaIterator
< const PeakT, const PeakT
&, const PeakT
*, ConstIterator, typename
SpectrumType::ConstIterator
ConstAreaIterator
 Immutable area iterator type (for traversal of a rectangular subset of the peaks).

Public Member Functions

 MSExperiment ()
 Constructor.
 MSExperiment (const MSExperiment &source)
 Copy constructor.
MSExperimentoperator= (const MSExperiment &source)
 Assignment operator.
MSExperimentoperator= (const ExperimentalSettings &source)
 Assignment operator.
bool operator== (const MSExperiment &rhs) const
 Equality operator.
bool operator!= (const MSExperiment &rhs) const
 Equality operator.
void reset ()
 Resets all internal values.
bool clearMetaDataArrays ()
 Clears the meta data arrays of all contained spectra (float, integer and string arrays).
const ExperimentalSettingsgetExperimentalSettings () const
 returns the meta information of this experiment (const access)
ExperimentalSettingsgetExperimentalSettings ()
 returns the meta information of this experiment (mutable access)
ConstIterator getPrecursorSpectrum (ConstIterator iterator) const
 Returns the precursor spectrum of the scan pointed to by iterator.
void swap (MSExperiment &from)
 Swaps the content of this map with the content of from.
void setChromatograms (const std::vector< MSChromatogram< ChromatogramPeakType > > &chromatograms)
 sets the chromatogram list
void addChromatogram (const MSChromatogram< ChromatogramPeakType > &chromatogram)
 adds a chromatogram to the list
const std::vector
< MSChromatogram
< ChromatogramPeakType > > & 
getChromatograms () const
 returns the chromatogram list
const MSChromatogram
< ChromatogramPeakType
getTIC () const
 returns the total ion chromatogram (TIC)
void clear (bool clear_meta_data)
 Clears all data and meta data.
Conversion to/from 2D data

template<class Container >
void get2DData (Container &cont) const
 Reads out a 2D Spectrum.
template<class Container >
void set2DData (const Container &cont)
 Assignment of a 2D spectrum to MSExperiment.
Iterating ranges and areas

AreaIterator areaBegin (CoordinateType min_rt, CoordinateType max_rt, CoordinateType min_mz, CoordinateType max_mz)
 Returns an area iterator for area.
AreaIterator areaEnd ()
 Returns an invalid area iterator marking the end of an area.
ConstAreaIterator areaBeginConst (CoordinateType min_rt, CoordinateType max_rt, CoordinateType min_mz, CoordinateType max_mz) const
 Returns a non-mutable area iterator for area.
ConstAreaIterator areaEndConst () const
 Returns an non-mutable invalid area iterator marking the end of an area.
ConstIterator RTBegin (CoordinateType rt) const
 Fast search for spectrum range begin.
ConstIterator RTEnd (CoordinateType rt) const
 Fast search for spectrum range end (returns the past-the-end iterator).
Iterator RTBegin (CoordinateType rt)
 Fast search for spectrum range begin.
Iterator RTEnd (CoordinateType rt)
 Fast search for spectrum range end (returns the past-the-end iterator).
Range methods

Note:
The range values (min, max, etc.) are not updated automatically. Call updateRanges() to update the values!
virtual void updateRanges ()
void updateRanges (Int ms_level)
 Updates the m/z, intensity, retention time and MS level ranges of all spectra with a certain ms level.
CoordinateType getMinMZ () const
 returns the minimal m/z value
CoordinateType getMaxMZ () const
 returns the maximal m/z value
CoordinateType getMinRT () const
 returns the minimal retention time value
CoordinateType getMaxRT () const
 returns the maximal retention time value
const AreaTypegetDataRange () const
 Returns RT and m/z range the data lies in.
UInt64 getSize () const
 returns the total number of peaks
const std::vector< UInt > & getMSLevels () const
 returns an array of MS levels
Sorting spectra and peaks

void sortSpectra (bool sort_mz=true)
 Sorts the data points by retention time.
void sortChromatograms (bool sort_rt=true)
 Sorts the data points of the chromatograms by m/z.
bool isSorted (bool check_mz=true) const
 Checks if all spectra are sorted with respect to ascending RT.

Protected Member Functions

virtual void clearChildIds_ ()
 Clears the persistence id of all sub-objects.

Protected Attributes

std::vector< UIntms_levels_
 MS levels of the data.
UInt64 total_size_
 Number of all data points.
std::vector< MSChromatogram
< ChromatogramPeakType > > 
chromatograms_
 chromatograms

Detailed Description

template<typename PeakT = Peak1D, typename ChromatogramPeakT = ChromatogramPeak>
class OpenMS::MSExperiment< PeakT, ChromatogramPeakT >

Representation of a mass spectrometry experiment.

Contains the data and metadata of an experiment performed with an MS (or HPLC and MS).

Be carefull when changing the order of contained MSSpectrum instances, if tandem-MS data is stored in this class. The only way to find a precursor spectrum of MSSpectrum x is to search for the first spectrum before x that has a lower MS-level!

Note:
For range operations, see RangeUtils module!

Member Typedef Documentation

Mutable area iterator type (for traversal of a rectangular subset of the peaks).

typedef DRange<2> AreaType

Area type.

typedef std::vector<SpectrumType> Base

STL base class type.

typedef ChromatogramPeakT ChromatogramPeakType

Chromatogram peak type.

Immutable area iterator type (for traversal of a rectangular subset of the peaks).

typedef std::vector<SpectrumType>::const_iterator ConstIterator

Non-mutable iterator.

Coordinate type of peak positions.

Intenstiy type of peaks.

typedef std::vector<SpectrumType>::iterator Iterator

Mutable iterator.

typedef PeakT PeakType

Peak type.

Spectrum Type.


Constructor & Destructor Documentation

MSExperiment (  )  [inline]

Constructor.

MSExperiment ( const MSExperiment< PeakT, ChromatogramPeakT > &  source  )  [inline]

Copy constructor.


Member Function Documentation

void addChromatogram ( const MSChromatogram< ChromatogramPeakType > &  chromatogram  )  [inline]

adds a chromatogram to the list

AreaIterator areaBegin ( CoordinateType  min_rt,
CoordinateType  max_rt,
CoordinateType  min_mz,
CoordinateType  max_mz 
) [inline]

Returns an area iterator for area.

ConstAreaIterator areaBeginConst ( CoordinateType  min_rt,
CoordinateType  max_rt,
CoordinateType  min_mz,
CoordinateType  max_mz 
) const [inline]

Returns a non-mutable area iterator for area.

Referenced by TOPPRNPxlXICFilter::filterByFoldChange(), and FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

AreaIterator areaEnd (  )  [inline]

Returns an invalid area iterator marking the end of an area.

ConstAreaIterator areaEndConst (  )  const [inline]

Returns an non-mutable invalid area iterator marking the end of an area.

Referenced by TOPPRNPxlXICFilter::filterByFoldChange(), and FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

virtual void clearChildIds_ (  )  [inline, protected, virtual]

Clears the persistence id of all sub-objects.

Implements PersistentObject.

bool clearMetaDataArrays (  )  [inline]

Clears the meta data arrays of all contained spectra (float, integer and string arrays).

Returns:
true if meta data arrays were present and removed. false otherwise.
void get2DData ( Container &  cont  )  const [inline]

Reads out a 2D Spectrum.

Container can be a PeakArray or an STL container of peaks which supports push_back(), end() and back()

Referenced by ConsensusMap::convert().

const AreaType& getDataRange (  )  const [inline]

Returns RT and m/z range the data lies in.

RT is dimension 0, m/z is dimension 1

const ExperimentalSettings& getExperimentalSettings (  )  const [inline]

returns the meta information of this experiment (const access)

Referenced by XMassFile::importExperimentalSettings().

ExperimentalSettings& getExperimentalSettings (  )  [inline]

returns the meta information of this experiment (mutable access)

CoordinateType getMaxMZ (  )  const [inline]

returns the maximal m/z value

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

CoordinateType getMaxRT (  )  const [inline]

returns the maximal retention time value

Referenced by FeatureFinderAlgorithmPicked< PeakType, FeatureType >::run().

const std::vector<UInt>& getMSLevels (  )  const [inline]

returns an array of MS levels

Referenced by FeatureFinder::run().

ConstIterator getPrecursorSpectrum ( ConstIterator  iterator  )  const [inline]

Returns the precursor spectrum of the scan pointed to by iterator.

If there is no precursor scan the past-the-end iterator is returned.

UInt64 getSize (  )  const [inline]

returns the total number of peaks

Referenced by ConsensusMap::convert(), and FeatureFinder::run().

const MSChromatogram<ChromatogramPeakType> getTIC (  )  const [inline]

returns the total ion chromatogram (TIC)

bool isSorted ( bool  check_mz = true  )  const [inline]

Checks if all spectra are sorted with respect to ascending RT.

Parameters:
check_mz if true, checks if all peaks are sorted with respect to ascending m/z

Referenced by FeatureFinder::run().

bool operator!= ( const MSExperiment< PeakT, ChromatogramPeakT > &  rhs  )  const [inline]

Equality operator.

MSExperiment& operator= ( const ExperimentalSettings source  )  [inline]

Assignment operator.

bool operator== ( const MSExperiment< PeakT, ChromatogramPeakT > &  rhs  )  const [inline]
void reset (  )  [inline]

Resets all internal values.

Referenced by InspectOutfile::getExperiment(), and FileHandler::loadExperiment().

ConstIterator RTBegin ( CoordinateType  rt  )  const [inline]

Fast search for spectrum range begin.

Returns the first scan which has equal or higher (>=) RT than rt.

Note:
Make sure the spectra are sorted with respect to retention time! Otherwise the result is undefined.

Referenced by MSExperiment< SimPointType >::areaBegin(), MSExperiment< SimPointType >::areaBeginConst(), InternalCalibration::calibrateMapGlobally(), OfflinePrecursorIonSelection::getMassRanges(), TwoDOptimization::getRegionEndpoints_(), OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap(), and FeatureFinder::run().

Iterator RTBegin ( CoordinateType  rt  )  [inline]

Fast search for spectrum range begin.

Note:
Make sure the spectra are sorted with respect to retention time! Otherwise the result is undefined.
ConstIterator RTEnd ( CoordinateType  rt  )  const [inline]

Fast search for spectrum range end (returns the past-the-end iterator).

Returns the first scan which has higher (>) RT than rt.

Note:
Make sure the spectra are sorted with respect to retention time! Otherwise the result is undefined.

Referenced by MSExperiment< SimPointType >::areaBegin(), MSExperiment< SimPointType >::areaBeginConst(), and OfflinePrecursorIonSelection::makePrecursorSelectionForKnownLCMSMap().

Iterator RTEnd ( CoordinateType  rt  )  [inline]

Fast search for spectrum range end (returns the past-the-end iterator).

Note:
Make sure the spectra are sorted with respect to retention time! Otherwise the result is undefined.
void set2DData ( const Container &  cont  )  [inline]

Assignment of a 2D spectrum to MSExperiment.

Container can be a PeakArray or an STL container of peaks.

Exceptions:
Exception::Precondition is thrown if the container is not sorted according to retention time (not only in debug mode)
void setChromatograms ( const std::vector< MSChromatogram< ChromatogramPeakType > > &  chromatograms  )  [inline]
void sortChromatograms ( bool  sort_rt = true  )  [inline]

Sorts the data points of the chromatograms by m/z.

Parameters:
sort_rt if true, chromatograms are sorted by rt position as well

Referenced by FeatureFinder::run().

void sortSpectra ( bool  sort_mz = true  )  [inline]

Sorts the data points by retention time.

Parameters:
sort_mz if true, spectra are sorted by m/z position as well

Referenced by FeatureFinder::run().

void swap ( MSExperiment< PeakT, ChromatogramPeakT > &  from  )  [inline]

Swaps the content of this map with the content of from.

Referenced by MSExperiment< SimPointType >::swap().

virtual void updateRanges (  )  [inline, virtual]
void updateRanges ( Int  ms_level  )  [inline]

Updates the m/z, intensity, retention time and MS level ranges of all spectra with a certain ms level.

Parameters:
ms_level MS level to consider for m/z range , RT range and intensity range (All MS levels if negative)

Member Data Documentation


OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:55 using doxygen 1.7.1