Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

MSExperiment Class Template Reference
[Kernel]

#include <OpenMS/KERNEL/MSExperiment.h>

Inheritance diagram for MSExperiment:

RangeManager< 2 > ExperimentalSettings PersistentObject MetaInfoInterface

List of all members.


Detailed Description

template<typename PeakT = Peak1D, typename AllocT = OPENMS_DEFAULT_ALLOC>
class OpenMS::MSExperiment< PeakT, AllocT >

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!

Public Types

typedef MSSpectrum< PeakT, AllocT > SpectrumType
 Spectrum Type.
typedef std::vector< SpectrumTypeBase
 STL base class type.
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).
typedef PeakT PeakType
 Peak type.
typedef DRange< 2 > AreaType
 Area type.
typedef DoubleReal CoordinateType
 Coordinate type of peak positions.
typedef DoubleReal IntensityType
 Intenstiy type of peaks.
typedef RangeManager< 2 > RangeManagerType
 RangeManager type.
typedef
SpectrumType::const_reference 
ConstPeakReference
 const peak reference type
typedef SpectrumType::reference PeakReference
 peak reference type

Public Member Functions

 MSExperiment ()
 Constructor.
 MSExperiment (const AllocT &alloc)
 MSExperiment (const MSExperiment &source)
 Copy constructor.
MSExperimentoperator= (const MSExperiment &source)
 Assignment operator.
void push_back (const SpectrumType &spec)
template<typename A>
void push_back (const MSSpectrum< PeakT, A > &spec)
void resize (const typename Base::size_type &size)
 reimplement resize, so that new MSSpectra with our unique allocator are created
MSExperimentoperator= (const ExperimentalSettings &source)
 Assignment operator.
bool operator== (const MSExperiment &rhs) const
 Equality operator.
bool operator!= (const MSExperiment &rhs) const
 Equality operator.
template<class Container>
void get2DData (Container &cont) const
 Reads out a 2D Spectrum.
template<class Container>
void set2DData (const Container &cont) throw (Exception::Precondition)
 Assignment of a 2D spectrum to MSExperiment.
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).
void sortSpectra (bool sort_mz=true)
 Sorts the data points by retention time.
void reset ()
 Resets all internal values.
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.
Range methods
Note:
The range values (min, max, etc.) are not updated automatically. Call updateRanges() to update the values!


virtual void updateRanges ()
 Updates minimum and maximum position/intensity.
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.
UInt getSize () const
 returns the total number of peaks
const std::vector< UInt > & getMSLevels () const
 returns an array of MS levels

Protected Types

typedef std::vector
< MSSpectrum< PeakT, AllocT > > 
Base_
 Base class typedef.

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.
UInt total_size_
 Number of all data points.
AllocT alloc_
 allocator for MSSpectrum

Member Typedef Documentation

typedef MSSpectrum<PeakT, AllocT> SpectrumType

Spectrum Type.

typedef std::vector<SpectrumType> Base

STL base class type.

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).

typedef PeakT PeakType

Peak type.

typedef DRange<2> AreaType

Area type.

typedef DoubleReal CoordinateType

Coordinate type of peak positions.

typedef DoubleReal IntensityType

Intenstiy type of peaks.

Reimplemented from RangeManager< 2 >.

typedef RangeManager<2> RangeManagerType

RangeManager type.

typedef SpectrumType::const_reference ConstPeakReference

const peak reference type

typedef SpectrumType::reference PeakReference

peak reference type

typedef std::vector<MSSpectrum<PeakT, AllocT> > Base_ [protected]

Base class typedef.


Constructor & Destructor Documentation

MSExperiment (  )  [inline]

Constructor.

MSExperiment ( const AllocT &  alloc  )  [inline]

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

Copy constructor.


Member Function Documentation

MSExperiment& operator= ( const MSExperiment< PeakT, AllocT > &  source  )  [inline]

Assignment operator.

void push_back ( const SpectrumType spec  )  [inline]

void push_back ( const MSSpectrum< PeakT, A > &  spec  )  [inline]

void resize ( const typename Base::size_type &  size  )  [inline]

reimplement resize, so that new MSSpectra with our unique allocator are created

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

Assignment operator.

Reimplemented from ExperimentalSettings.

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

Equality operator.

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

Equality operator.

void get2DData ( Container &  cont  )  const [inline]

Reads out a 2D Spectrum.

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

void set2DData ( const Container &  cont  )  throw (Exception::Precondition) [inline]

Assignment of a 2D spectrum to MSExperiment.

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

Note:
The container has to be sorted according to retention time. Otherwise a Precondition exception is thrown.

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

Returns an area iterator for area.

AreaIterator areaEnd (  )  [inline]

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 [inline]

Returns a non-mutable area iterator for area.

ConstAreaIterator areaEndConst (  )  const [inline]

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

ConstIterator RTBegin ( CoordinateType  rt  )  const [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).

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

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.

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.

virtual void updateRanges (  )  [inline, virtual]

Updates minimum and maximum position/intensity.

This method is usually implemented by calling clearRanges() and updateRanges_() or updateRanges1D_().

Implements RangeManager< 2 >.

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)

CoordinateType getMinMZ (  )  const [inline]

returns the minimal m/z value

CoordinateType getMaxMZ (  )  const [inline]

returns the maximal m/z value

CoordinateType getMinRT (  )  const [inline]

returns the minimal retention time value

CoordinateType getMaxRT (  )  const [inline]

returns the maximal retention time value

const AreaType& getDataRange (  )  const [inline]

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

RT is dimension 0, m/z is dimension 1

UInt getSize (  )  const [inline]

returns the total number of peaks

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

returns an array of MS levels

void sortSpectra ( bool  sort_mz = true  )  [inline]

Sorts the data points by retention time.

sort_mz : indicates whether the points should be sorted by m/z as well

void reset (  )  [inline]

Resets all internal values.

const ExperimentalSettings& getExperimentalSettings (  )  const [inline]

returns the meta information of this experiment (const access)

ExperimentalSettings& getExperimentalSettings (  )  [inline]

returns the meta information of this experiment (mutable access)

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.

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

Clears the persistence id of all sub-objects.

Implements PersistentObject.


Member Data Documentation

std::vector<UInt> ms_levels_ [protected]

MS levels of the data.

UInt total_size_ [protected]

Number of all data points.

AllocT alloc_ [protected]

allocator for MSSpectrum


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:46 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1