| OpenMS 2.5.0

Classes | Public Member Functions | Protected Attributes | Friends | List of all members
Peak2D Class Reference
Kernel

A 2-dimensional raw data point or peak. More...

`#include <OpenMS/KERNEL/Peak2D.h>`

Inheritance diagram for Peak2D:

## Classes

struct | IntensityLess
struct | MZLess
| Comparator by m/z position. More...
struct | PositionLess
| Comparator by position. Lexicographical comparison (first RT then m/z) is done. More...
struct | RTLess
| Comparator by RT position. More...

## Public Types

Type definitions
typedef float | IntensityType
| Intensity type. More...
typedef double | CoordinateType
| Coordinate type (of the position) More...
typedef DPosition< 2 > | PositionType
| Position type. More...

## Public Member Functions

Peak2D & | operator= (const Peak2D &rhs)=default
| Assignment operator. More...
Peak2D & | operator= (Peak2D &&) &=default
| Move assignment operator. More...
bool | operator== (const Peak2D &rhs) const
| Equality operator. More...
bool | operator!= (const Peak2D &rhs) const
| Equality operator. More...
Constructors and Destructor
Default constructor
| Peak2D ()
| Peak2D (const PositionType &pos, const IntensityType in)
| Member constructor. More...
| Peak2D (const Peak2D &p)=default
| Copy constructor. More...
| Peak2D (Peak2D &&)=default
| Move constructor. More...
| ~Peak2D ()
| Destructor. More...
Accessors
Non-mutable access to the data point intensity (height)
IntensityType | getIntensity () const
void | setIntensity (IntensityType intensity)
| Non-mutable access to the data point intensity (height) More...
PositionType const & | getPosition () const
| Non-mutable access to the position. More...
PositionType & | getPosition ()
| Mutable access to the position. More...
void | setPosition (const PositionType &position)
| Mutable access to the position. More...
CoordinateType | getMZ () const
| Returns the m/z coordinate (index 1) More...
void | setMZ (CoordinateType coordinate)
| Mutable access to the m/z coordinate (index 1) More...
CoordinateType | getRT () const
| Returns the RT coordinate (index 0) More...
void | setRT (CoordinateType coordinate)
| Mutable access to the RT coordinate (index 0) More...

## Protected Attributes

PositionType | position_
| The data point position. More...
IntensityType | intensity_
| The data point intensity. More...

## Friends

std::ostream & | operator<< (std::ostream &os, const Peak2D &point)
| Print the contents to a stream. More...

## Dimension descriptions

enum | DimensionDescription { RT = 0, MZ = 1, DIMENSION = 2 }
| This enum maps the symbolic names of the dimensions to numbers. More...
static char const *const | dimension_name_short_ [DIMENSION]
| Short name of the dimension (abbreviated form) More...
static char const *const | dimension_name_full_ [DIMENSION]
| Full name of the dimension (self-explanatory form) More...
static char const *const | dimension_unit_short_ [DIMENSION]
| Unit of measurement (abbreviated form) More...
static char const *const | dimension_unit_full_ [DIMENSION]
| Unit of measurement (self-explanatory form) More...
static char const * | shortDimensionName (UInt const dim)
| Short name of the dimension (abbreviated form) More...
static char const * | shortDimensionNameRT ()
| Short name of the dimension (abbreviated form) More...
static char const * | shortDimensionNameMZ ()
| Short name of the dimension (abbreviated form) More...
static char const * | fullDimensionName (UInt const dim)
| Full name of the dimension (self-explanatory form) More...
static char const * | fullDimensionNameRT ()
| Full name of the dimension (self-explanatory form) More...
static char const * | fullDimensionNameMZ ()
| Full name of the dimension (self-explanatory form) More...
static char const * | shortDimensionUnit (UInt const dim)
| Unit of measurement (abbreviated form) More...
static char const * | shortDimensionUnitRT ()
| Unit of measurement (abbreviated form) More...
static char const * | shortDimensionUnitMZ ()
| Unit of measurement (abbreviated form) More...
static char const * | fullDimensionUnit (UInt const dim)
| Unit of measurement (self-explanatory form) More...
static char const * | fullDimensionUnitRT ()
| Unit of measurement (self-explanatory form) More...
static char const * | fullDimensionUnitMZ ()
| Unit of measurement (self-explanatory form) More...

## Detailed Description

A 2-dimensional raw data point or peak.

This data structure is intended for continuous data or peak data. If you want to annotated single peaks with meta data, use RichPeak2D instead.

## Member Typedef Documentation

## ◆ CoordinateType

typedef double CoordinateType

Coordinate type (of the position)

## ◆ IntensityType

typedef float IntensityType

Intensity type.

## ◆ PositionType

typedef DPosition<2> PositionType

Position type.

## Member Enumeration Documentation

## ◆ DimensionDescription

enum DimensionDescription

This enum maps the symbolic names of the dimensions to numbers.

Enumerator
RT | Retention time dimension id (0 if used as a const int)
MZ | Mass-to-charge dimension id (1 if used as a const int)
DIMENSION | Number of dimensions.

## Constructor & Destructor Documentation

## ◆ Peak2D() [1/4]

Peak2D | ( |  | ) |

inline

## ◆ Peak2D() [2/4]

Peak2D | ( | const PositionType & | pos,
|  | const IntensityType | in
| ) |  |

inline explicit

Member constructor.

## ◆ Peak2D() [3/4]

Peak2D | ( | const Peak2D & | p | ) |

default

Copy constructor.

## ◆ Peak2D() [4/4]

Peak2D | ( | Peak2D && |  | ) |

default

Move constructor.

## ◆ ~Peak2D()

~Peak2D | ( |  | ) |

inline

Destructor.

Note
  The destructor is non-virtual although many classes are derived from Peak2D. This is intentional, since otherwise we would "waste" space for a vtable pointer in each instance. Normally you should not derive other classes from Peak2D (unless you know what you are doing, of course).

## Member Function Documentation

## ◆ fullDimensionName()

static char const* fullDimensionName | ( | UInt const | dim | ) |

static

Full name of the dimension (self-explanatory form)

## ◆ fullDimensionNameMZ()

static char const* fullDimensionNameMZ | ( |  | ) |

static

Full name of the dimension (self-explanatory form)

## ◆ fullDimensionNameRT()

static char const* fullDimensionNameRT | ( |  | ) |

static

Full name of the dimension (self-explanatory form)

## ◆ fullDimensionUnit()

static char const* fullDimensionUnit | ( | UInt const | dim | ) |

static

Unit of measurement (self-explanatory form)

## ◆ fullDimensionUnitMZ()

static char const* fullDimensionUnitMZ | ( |  | ) |

static

Unit of measurement (self-explanatory form)

## ◆ fullDimensionUnitRT()

static char const* fullDimensionUnitRT | ( |  | ) |

static

Unit of measurement (self-explanatory form)

## ◆ getIntensity()

IntensityType getIntensity | ( |  | ) | const

inline

Referenced by OpenMS::intensityAscendingComparator(), OpenMS::intensityComparator(), OpenMS::intensityPointerComparator(), Peak2D::IntensityLess::operator()(), InIntensityRange< PeakType >::operator()(), and MRMTransitionGroupPicker::pickTransitionGroup().

## ◆ getMZ()

CoordinateType getMZ | ( |  | ) | const

inline

Returns the m/z coordinate (index 1)

Referenced by TOPPGNPSExport::main_(), SpectraMerger::SpectraDistance_::operator()(), Peak2D::MZLess::operator()(), and OpenMS::positionComparator().

## ◆ getPosition() [1/2]

PositionType const& getPosition | ( |  | ) | const

inline

Non-mutable access to the position.

Referenced by Peak2D::PositionLess::operator()(), and InMzRange< PeakType >::operator()().

## ◆ getPosition() [2/2]

PositionType& getPosition | ( |  | ) |

inline

Mutable access to the position.

## ◆ getRT()

CoordinateType getRT | ( |  | ) | const

inline

Returns the RT coordinate (index 0)

Referenced by TOPPGNPSExport::main_(), SpectraMerger::SpectraDistance_::operator()(), PrecursorIonSelection::SeqTotalScoreMore::operator()(), FeatureFinderIdentificationAlgorithm::FeatureCompare::operator()(), and Peak2D::RTLess::operator()().

## ◆ operator!=()

bool operator!= | ( | const Peak2D & | rhs | ) | const

inline

Equality operator.

References KDTree::operator==().

## ◆ operator=() [1/2]

Peak2D& operator= | ( | const Peak2D & | rhs | ) |

default

Assignment operator.

Referenced by RichPeak2D::operator=().

## ◆ operator=() [2/2]

Peak2D& operator= | ( | Peak2D && |  | ) | &

default

Move assignment operator.

## ◆ operator==()

bool operator== | ( | const Peak2D & | rhs | ) | const

inline

Equality operator.

References Peak2D::intensity_, and Peak2D::position_.

Referenced by RichPeak2D::operator==().

## ◆ setIntensity()

void setIntensity | ( | IntensityType | intensity | ) |

inline

Non-mutable access to the data point intensity (height)

Referenced by MRMTransitionGroupPicker::createMRMFeature(), SpecArrayFile::load(), MsInspectFile::load(), IsotopeWaveletTransform< PeakType >::mapSeeds2Features(), MRMTransitionGroupPicker::pickFragmentChromatograms(), MRMTransitionGroupPicker::pickPrecursorChromatograms(), LinearResamplerAlign::populate_raster_(), and MRMTransitionGroup< SpectrumT, TransitionT >::subset().

## ◆ setMZ()

void setMZ | ( | CoordinateType | coordinate | ) |

inline

Mutable access to the m/z coordinate (index 1)

Referenced by ChromatogramTools::convertChromatogramsToSpectra(), MsInspectFile::load(), SpecArrayFile::load(), IsotopeWaveletTransform< PeakType >::mapSeeds2Features(), SpectraMerger::mergeSpectraPrecursors(), MRMTransitionGroupPicker::pickFragmentChromatograms(), MRMTransitionGroupPicker::pickPrecursorChromatograms(), and LinearResamplerAlign::populate_raster_().

## ◆ setPosition()

void setPosition | ( | const PositionType & | position | ) |

inline

Mutable access to the position.

References seqan::position().

## ◆ setRT()

void setRT | ( | CoordinateType | coordinate | ) |

inline

Mutable access to the RT coordinate (index 0)

Referenced by ChromatogramTools::convertSpectraToChromatograms(), MsInspectFile::load(), SpecArrayFile::load(), IsotopeWaveletTransform< PeakType >::mapSeeds2Features(), SpectraMerger::mergeSpectraPrecursors(), MRMTransitionGroupPicker::pickFragmentChromatograms(), MRMTransitionGroupPicker::pickPrecursorChromatograms(), and MRMTransitionGroup< SpectrumT, TransitionT >::subset().

## ◆ shortDimensionName()

static char const* shortDimensionName | ( | UInt const | dim | ) |

static

Short name of the dimension (abbreviated form)

Referenced by ProductModel< 2 >::ProductModel(), ProductModel< 2 >::setModel(), and ProductModel< 2 >::updateMembers_().

## ◆ shortDimensionNameMZ()

static char const* shortDimensionNameMZ | ( |  | ) |

static

Short name of the dimension (abbreviated form)

## ◆ shortDimensionNameRT()

static char const* shortDimensionNameRT | ( |  | ) |

static

Short name of the dimension (abbreviated form)

## ◆ shortDimensionUnit()

static char const* shortDimensionUnit | ( | UInt const | dim | ) |

static

Unit of measurement (abbreviated form)

## ◆ shortDimensionUnitMZ()

static char const* shortDimensionUnitMZ | ( |  | ) |

static

Unit of measurement (abbreviated form)

## ◆ shortDimensionUnitRT()

static char const* shortDimensionUnitRT | ( |  | ) |

static

Unit of measurement (abbreviated form)

## Friends And Related Function Documentation

## ◆ operator<<

std::ostream& operator<< | ( | std::ostream & | os,
|  | const Peak2D & | point
| ) |  |

friend

Print the contents to a stream.

## Member Data Documentation

## ◆ dimension_name_full_

char const* const dimension_name_full_[DIMENSION]

static protected

Full name of the dimension (self-explanatory form)

## ◆ dimension_name_short_

char const* const dimension_name_short_[DIMENSION]

static protected

Short name of the dimension (abbreviated form)

## ◆ dimension_unit_full_

char const* const dimension_unit_full_[DIMENSION]

static protected

Unit of measurement (self-explanatory form)

## ◆ dimension_unit_short_

char const* const dimension_unit_short_[DIMENSION]

static protected

Unit of measurement (abbreviated form)

## ◆ intensity_

IntensityType intensity_

protected

The data point intensity.

Referenced by Peak2D::operator==().

## ◆ position_

PositionType position_

protected

The data point position.

Referenced by Peak2D::operator==().