Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PeakShape.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2013.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Alexandra Zerck $
32 // $Authors: Eva Lange $
33 // --------------------------------------------------------------------------
34 //
35 
36 #ifndef OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKSHAPE_H
37 #define OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKSHAPE_H
38 
39 #include <cmath>
40 
41 #include <OpenMS/CONCEPT/Types.h>
43 
44 namespace OpenMS
45 {
51  struct OPENMS_DLLAPI PeakShape
52  {
68  enum Type
69  {
72  UNDEFINED
73  };
74 
77 
80  height(0),
81  mz_position(0),
82  left_width(0),
83  right_width(0),
84  area(0),
85  r_value(0),
86  signal_to_noise(0.),
87  type(UNDEFINED)
88  {
89  left_endpoint_ = exp_.end();
90  right_endpoint_ = exp_.end();
91  }
92 
94  PeakShape(DoubleReal height_, DoubleReal mz_position_, DoubleReal left_width_, DoubleReal right_width_, DoubleReal area_, PeakIterator left_, PeakIterator right_, Type type_);
95 
97  PeakShape(DoubleReal height_, DoubleReal mz_position_, DoubleReal left_width_, DoubleReal right_width_, DoubleReal area_, Type type_);
98 
99 
101  PeakShape(const PeakShape & rhs);
102 
104  virtual ~PeakShape()
105  {
106  }
107 
109  PeakShape & operator=(const PeakShape & rhs);
110 
111  //Equality operator
112  bool operator==(const PeakShape & rhs) const;
113  //Equality operator
114  bool operator!=(const PeakShape & rhs) const;
115 
117  DoubleReal operator()(DoubleReal x) const;
119  DoubleReal getSymmetricMeasure() const;
121  DoubleReal getFWHM() const;
123  bool iteratorsSet() const;
124 
125  PeakIterator getLeftEndpoint() const;
126  void setLeftEndpoint(PeakIterator left_endpoint);
127 
128  PeakIterator getRightEndpoint() const;
129  void setRightEndpoint(PeakIterator right_endpoint);
147 
150 
154  class OPENMS_DLLAPI PositionLess
155  {
156 public:
157 
158  inline bool operator()(const PeakShape & a, const PeakShape & b)
159  {
160  return a.mz_position < b.mz_position;
161  }
162 
163  };
164 protected:
175  };
176 } // namespace OpenMS
177 
178 #endif
Internal representation of a peak shape (used by the PeakPickerCWT)
Definition: PeakShape.h:51
virtual ~PeakShape()
Destructor.
Definition: PeakShape.h:104
Comparison of mz_positions.
Definition: PeakShape.h:154
DoubleReal height
Maximum intensity of the peak shape.
Definition: PeakShape.h:131
MSSpectrum exp_
Needed for initialisation of endpoint iterators.
Definition: PeakShape.h:170
RawDataVector::iterator PeakIterator
Raw data iterator type.
Definition: OptimizePick.h:61
bool left_iterator_set_
flag if left endpoint iterator differs from default value
Definition: PeakShape.h:172
PeakShape()
Default constructor.
Definition: PeakShape.h:79
bool right_iterator_set_
flag if left endpoint iterator differs from default value
Definition: PeakShape.h:174
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
Type
Peak shape type (asymmetric lorentzian or asymmetric hyperbolic secans squared).
Definition: PeakShape.h:68
PeakIterator right_endpoint_
Right peak endpoint in the data.
Definition: PeakShape.h:168
Definition: PeakShape.h:70
DoubleReal right_width
Right width parameter.
Definition: PeakShape.h:137
Type type
peak shape type
Definition: PeakShape.h:149
DoubleReal area
Area of the peak shape.
Definition: PeakShape.h:139
MSSpectrum::const_iterator PeakIterator
Iterator to the raw data vector.
Definition: PeakShape.h:76
bool operator()(const PeakShape &a, const PeakShape &b)
Definition: PeakShape.h:158
DoubleReal left_width
Left width parameter.
Definition: PeakShape.h:135
Definition: PeakShape.h:71
PeakIterator left_endpoint_
Left peak endpoint in the data.
Definition: PeakShape.h:166
DoubleReal signal_to_noise
The signal to noise ratio at the mz_position.
Definition: PeakShape.h:146
DoubleReal r_value
Correlation coefficient.
Definition: PeakShape.h:144
DoubleReal mz_position
Centroid position.
Definition: PeakShape.h:133

OpenMS / TOPP release 1.11.1 Documentation generated on Thu Nov 14 2013 11:19:19 using doxygen 1.8.5