OpenMS
PeakShape Class Reference

Internal representation of a peak shape (used by the PeakPickerCWT) More...

#include <OpenMS/TRANSFORMATIONS/RAW2PEAK/PeakShape.h>

Collaboration diagram for PeakShape:
[legend]

Classes

class  PositionLess
 Comparison of mz_positions. More...
 

Public Types

enum  Type { LORENTZ_PEAK , SECH_PEAK , UNDEFINED }
 Peak shape type (asymmetric Lorentzian or asymmetric hyperbolic secans squared). More...
 
typedef MSSpectrum::const_iterator PeakIterator
 Iterator to the raw data vector. More...
 

Public Member Functions

 PeakShape ()
 Default constructor. More...
 
 PeakShape (double height_, double mz_position_, double left_width_, double right_width_, double area_, PeakIterator left_, PeakIterator right_, Type type_)
 Constructor that sets most of the members. More...
 
 PeakShape (double height_, double mz_position_, double left_width_, double right_width_, double area_, Type type_)
 Constructor that sets most of the members. More...
 
 PeakShape (const PeakShape &rhs)
 Copy constructor. More...
 
virtual ~PeakShape ()
 Destructor. More...
 
PeakShapeoperator= (const PeakShape &rhs)
 Assignment operator. More...
 
bool operator== (const PeakShape &rhs) const
 
bool operator!= (const PeakShape &rhs) const
 
double operator() (double x) const
 Compute the intensity of the peaks shape at position x. More...
 
double getSymmetricMeasure () const
 Computes symmetry measure of the peak shape, which is corresponds to the ratio of the left and right width parameters. More...
 
double getFWHM () const
 Estimates the full width at half maximum. More...
 
bool iteratorsSet () const
 Check if endpoint iterators are provided. More...
 
PeakIterator getLeftEndpoint () const
 
void setLeftEndpoint (PeakIterator left_endpoint)
 
PeakIterator getRightEndpoint () const
 
void setRightEndpoint (PeakIterator right_endpoint)
 

Public Attributes

double height
 Maximum intensity of the peak shape. More...
 
double mz_position
 Centroid position. More...
 
double left_width
 Left width parameter. More...
 
double right_width
 Right width parameter. More...
 
double area
 Area of the peak shape. More...
 
double r_value
 Correlation coefficient. More...
 
double signal_to_noise
 The signal to noise ratio at the mz_position. More...
 
Type type
 peak shape type More...
 

Protected Attributes

PeakIterator left_endpoint_
 Left peak endpoint in the data. More...
 
PeakIterator right_endpoint_
 Right peak endpoint in the data. More...
 
MSSpectrum exp_
 Needed for initialization of endpoint iterators. More...
 
bool left_iterator_set_
 flag if left endpoint iterator differs from default value More...
 
bool right_iterator_set_
 flag if left endpoint iterator differs from default value More...
 

Detailed Description

Internal representation of a peak shape (used by the PeakPickerCWT)

It defines an asymmetric Lorentzian and asymmetric hyperbolic squared secan function.

Member Typedef Documentation

◆ PeakIterator

typedef MSSpectrum::const_iterator PeakIterator

Iterator to the raw data vector.

Member Enumeration Documentation

◆ Type

enum Type

Peak shape type (asymmetric Lorentzian or asymmetric hyperbolic secans squared).

The peak shape can represent an asymmetric Lorentzian function, given by

l(x) = height/(1.+pow(left_width*(x - mz_position), 2)) (x<=mz_position)

l(x) = height/(1.+pow(right_width*(x - mz_position), 2)) (x>mz_position)

or an asymmetric hyperbolic secans squared function

s(x) = height/pow(cosh(left_width*(x-mz_position)), 2) (x<=mz_position)

s(x) = height/pow(cosh(right_width*(x-mz_position)), 2) (x>mz_position)

Enumerator
LORENTZ_PEAK 
SECH_PEAK 
UNDEFINED 

Constructor & Destructor Documentation

◆ PeakShape() [1/4]

PeakShape ( )

Default constructor.

◆ PeakShape() [2/4]

PeakShape ( double  height_,
double  mz_position_,
double  left_width_,
double  right_width_,
double  area_,
PeakIterator  left_,
PeakIterator  right_,
Type  type_ 
)

Constructor that sets most of the members.

◆ PeakShape() [3/4]

PeakShape ( double  height_,
double  mz_position_,
double  left_width_,
double  right_width_,
double  area_,
Type  type_ 
)

Constructor that sets most of the members.

◆ PeakShape() [4/4]

PeakShape ( const PeakShape rhs)

Copy constructor.

◆ ~PeakShape()

virtual ~PeakShape ( )
virtual

Destructor.

Member Function Documentation

◆ getFWHM()

double getFWHM ( ) const

Estimates the full width at half maximum.

◆ getLeftEndpoint()

PeakIterator getLeftEndpoint ( ) const

◆ getRightEndpoint()

PeakIterator getRightEndpoint ( ) const

◆ getSymmetricMeasure()

double getSymmetricMeasure ( ) const

Computes symmetry measure of the peak shape, which is corresponds to the ratio of the left and right width parameters.

◆ iteratorsSet()

bool iteratorsSet ( ) const

Check if endpoint iterators are provided.

◆ operator!=()

bool operator!= ( const PeakShape rhs) const

◆ operator()()

double operator() ( double  x) const

Compute the intensity of the peaks shape at position x.

◆ operator=()

PeakShape& operator= ( const PeakShape rhs)

Assignment operator.

◆ operator==()

bool operator== ( const PeakShape rhs) const

◆ setLeftEndpoint()

void setLeftEndpoint ( PeakIterator  left_endpoint)

◆ setRightEndpoint()

void setRightEndpoint ( PeakIterator  right_endpoint)

Member Data Documentation

◆ area

double area

Area of the peak shape.

◆ exp_

MSSpectrum exp_
protected

Needed for initialization of endpoint iterators.

◆ height

double height

Maximum intensity of the peak shape.

◆ left_endpoint_

PeakIterator left_endpoint_
protected

Left peak endpoint in the data.

◆ left_iterator_set_

bool left_iterator_set_
protected

flag if left endpoint iterator differs from default value

◆ left_width

double left_width

Left width parameter.

◆ mz_position

double mz_position

Centroid position.

Referenced by PeakShape::PositionLess::operator()().

◆ r_value

double r_value

Correlation coefficient.

It represents the squared Pearson correlation coefficient with the original data (0 <= r_value <= 1).

◆ right_endpoint_

PeakIterator right_endpoint_
protected

Right peak endpoint in the data.

◆ right_iterator_set_

bool right_iterator_set_
protected

flag if left endpoint iterator differs from default value

◆ right_width

double right_width

Right width parameter.

◆ signal_to_noise

double signal_to_noise

The signal to noise ratio at the mz_position.

◆ type

Type type

peak shape type