OpenMS
PeakShape.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Eva Lange $
7 // --------------------------------------------------------------------------
8 //
9 
10 #pragma once
11 
12 #include <cmath>
13 
14 #include <OpenMS/CONCEPT/Types.h>
16 
17 namespace OpenMS
18 {
24  class OPENMS_DLLAPI PeakShape
25  {
26  public:
42  enum Type
43  {
46  UNDEFINED
47  };
48 
50  typedef MSSpectrum::const_iterator PeakIterator;
51 
54 
56  PeakShape(double height_, double mz_position_, double left_width_, double right_width_, double area_, PeakIterator left_, PeakIterator right_, Type type_);
57 
59  PeakShape(double height_, double mz_position_, double left_width_, double right_width_, double area_, Type type_);
60 
61 
63  PeakShape(const PeakShape & rhs);
64 
66  virtual ~PeakShape();
67 
69  PeakShape & operator=(const PeakShape & rhs);
70 
71  //Equality operator
72  bool operator==(const PeakShape & rhs) const;
73  //Equality operator
74  bool operator!=(const PeakShape & rhs) const;
75 
77  double operator()(double x) const;
79  double getSymmetricMeasure() const;
81  double getFWHM() const;
83  bool iteratorsSet() const;
84 
86  void setLeftEndpoint(PeakIterator left_endpoint);
87 
89  void setRightEndpoint(PeakIterator right_endpoint);
91  double height;
93  double mz_position;
95  double left_width;
97  double right_width;
99  double area;
104  double r_value;
107 
110 
114  class OPENMS_DLLAPI PositionLess
115  {
116 public:
117  inline bool operator()(const PeakShape & a, const PeakShape & b)
118  {
119  return a.mz_position < b.mz_position;
120  }
121 
122  };
123 protected:
134  };
135 } // namespace OpenMS
136 
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Comparison of mz_positions.
Definition: PeakShape.h:115
bool operator()(const PeakShape &a, const PeakShape &b)
Definition: PeakShape.h:117
Internal representation of a peak shape (used by the PeakPickerCWT)
Definition: PeakShape.h:25
double getSymmetricMeasure() const
Computes symmetry measure of the peak shape, which is corresponds to the ratio of the left and right ...
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(double height_, double mz_position_, double left_width_, double right_width_, double area_, Type type_)
Constructor that sets most of the members.
Type
Peak shape type (asymmetric Lorentzian or asymmetric hyperbolic secans squared).
Definition: PeakShape.h:43
@ SECH_PEAK
Definition: PeakShape.h:45
@ LORENTZ_PEAK
Definition: PeakShape.h:44
bool left_iterator_set_
flag if left endpoint iterator differs from default value
Definition: PeakShape.h:131
bool iteratorsSet() const
Check if endpoint iterators are provided.
double getFWHM() const
Estimates the full width at half maximum.
void setRightEndpoint(PeakIterator right_endpoint)
bool operator==(const PeakShape &rhs) const
double signal_to_noise
The signal to noise ratio at the mz_position.
Definition: PeakShape.h:106
double operator()(double x) const
Compute the intensity of the peaks shape at position x.
PeakShape & operator=(const PeakShape &rhs)
Assignment operator.
PeakShape(const PeakShape &rhs)
Copy constructor.
virtual ~PeakShape()
Destructor.
double height
Maximum intensity of the peak shape.
Definition: PeakShape.h:91
bool operator!=(const PeakShape &rhs) const
PeakIterator right_endpoint_
Right peak endpoint in the data.
Definition: PeakShape.h:127
MSSpectrum::const_iterator PeakIterator
Iterator to the raw data vector.
Definition: PeakShape.h:50
PeakIterator getLeftEndpoint() const
Type type
peak shape type
Definition: PeakShape.h:109
double right_width
Right width parameter.
Definition: PeakShape.h:97
MSSpectrum exp_
Needed for initialization of endpoint iterators.
Definition: PeakShape.h:129
PeakIterator left_endpoint_
Left peak endpoint in the data.
Definition: PeakShape.h:125
PeakIterator getRightEndpoint() const
void setLeftEndpoint(PeakIterator left_endpoint)
bool right_iterator_set_
flag if left endpoint iterator differs from default value
Definition: PeakShape.h:133
double r_value
Correlation coefficient.
Definition: PeakShape.h:104
double area
Area of the peak shape.
Definition: PeakShape.h:99
double left_width
Left width parameter.
Definition: PeakShape.h:95
PeakShape()
Default constructor.
double mz_position
Centroid position.
Definition: PeakShape.h:93
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22