OpenMS  2.5.0
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-2020.
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: Timo Sachsenberg $
32 // $Authors: Eva Lange $
33 // --------------------------------------------------------------------------
34 //
35 
36 #pragma once
37 
38 #include <cmath>
39 
40 #include <OpenMS/CONCEPT/Types.h>
42 
43 namespace OpenMS
44 {
50  class OPENMS_DLLAPI PeakShape
51  {
52  public:
68  enum Type
69  {
72  UNDEFINED
73  };
74 
76  typedef MSSpectrum::const_iterator PeakIterator;
77 
79  PeakShape();
80 
82  PeakShape(double height_, double mz_position_, double left_width_, double right_width_, double area_, PeakIterator left_, PeakIterator right_, Type type_);
83 
85  PeakShape(double height_, double mz_position_, double left_width_, double right_width_, double area_, Type type_);
86 
87 
89  PeakShape(const PeakShape & rhs);
90 
92  virtual ~PeakShape();
93 
95  PeakShape & operator=(const PeakShape & rhs);
96 
97  //Equality operator
98  bool operator==(const PeakShape & rhs) const;
99  //Equality operator
100  bool operator!=(const PeakShape & rhs) const;
101 
103  double operator()(double x) const;
105  double getSymmetricMeasure() const;
107  double getFWHM() const;
109  bool iteratorsSet() const;
110 
111  PeakIterator getLeftEndpoint() const;
112  void setLeftEndpoint(PeakIterator left_endpoint);
113 
114  PeakIterator getRightEndpoint() const;
115  void setRightEndpoint(PeakIterator right_endpoint);
117  double height;
119  double mz_position;
121  double left_width;
123  double right_width;
125  double area;
130  double r_value;
133 
136 
140  class OPENMS_DLLAPI PositionLess
141  {
142 public:
143  inline bool operator()(const PeakShape & a, const PeakShape & b)
144  {
145  return a.mz_position < b.mz_position;
146  }
147 
148  };
149 protected:
160  };
161 } // namespace OpenMS
162 
LogStream.h
OpenMS::PeakShape::LORENTZ_PEAK
Definition: PeakShape.h:70
OpenMS::SpectrumSettings::CENTROID
centroid data or stick data
Definition: SpectrumSettings.h:73
OpenMS::TOPPBase
Base class for TOPP applications.
Definition: TOPPBase.h:144
OpenMS::PeakShape::mz_position
double mz_position
Centroid position.
Definition: PeakShape.h:119
OpenMS::Param::copy
Param copy(const String &prefix, bool remove_prefix=false) const
Returns a new Param object containing all entries that start with prefix.
OpenMS::PeakShape::left_iterator_set_
bool left_iterator_set_
flag if left endpoint iterator differs from default value
Definition: PeakShape.h:157
OpenMS::PeakPickerCWT
This class implements a peak picking algorithm using wavelet techniques.
Definition: PeakPickerCWT.h:78
Types.h
OpenMS::PeakShape::Type
Type
Peak shape type (asymmetric Lorentzian or asymmetric hyperbolic secans squared).
Definition: PeakShape.h:68
OpenMS::MzMLFile::store
void store(const String &filename, const PeakMap &map) const
Stores a map in an MzML file.
OpenMS::MzMLFile
File adapter for MzML files.
Definition: MzMLFile.h:55
OpenMS::String
A more convenient string class.
Definition: String.h:58
KDTree::operator!=
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
MzMLFile.h
OpenMS::PeakShape::left_endpoint_
PeakIterator left_endpoint_
Left peak endpoint in the data.
Definition: PeakShape.h:151
OpenMS::PeakPickerCWT::pickExperiment
void pickExperiment(const PeakMap &input, PeakMap &output)
Picks the peaks in an MSExperiment.
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::PeakShape::left_width
double left_width
Left width parameter.
Definition: PeakShape.h:121
OpenMS::PeakShape::signal_to_noise
double signal_to_noise
The signal to noise ratio at the mz_position.
Definition: PeakShape.h:132
OPENMS_LOG_WARN
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:460
OpenMS::PeakShape::area
double area
Area of the peak shape.
Definition: PeakShape.h:125
OpenMS::MSExperiment::size
Size size() const
Definition: MSExperiment.h:127
OpenMS::PeakShape::SECH_PEAK
Definition: PeakShape.h:71
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::PeakShape::PeakIterator
MSSpectrum::const_iterator PeakIterator
Iterator to the raw data vector.
Definition: PeakShape.h:76
OpenMS::MzMLFile::load
void load(const String &filename, PeakMap &map)
Loads a map from a MzML file. Spectra and chromatograms are sorted by default (this can be disabled u...
OpenMS::PeakShape::type
Type type
peak shape type
Definition: PeakShape.h:135
OpenMS::PeakShape
Internal representation of a peak shape (used by the PeakPickerCWT)
Definition: PeakShape.h:50
OpenMS::PeakShape::right_width
double right_width
Right width parameter.
Definition: PeakShape.h:123
OpenMS::DataProcessing::PEAK_PICKING
Peak picking (conversion from raw to peak data)
Definition: DataProcessing.h:67
OpenMS::PeakShape::height
double height
Maximum intensity of the peak shape.
Definition: PeakShape.h:117
OpenMS::Exception::BaseException
Exception base class.
Definition: Exception.h:89
OpenMS::DefaultParamHandler::setParameters
void setParameters(const Param &param)
Sets the parameters.
OpenMS::DefaultParamHandler::getDefaults
const Param & getDefaults() const
Non-mutable access to the default parameters.
OpenMS::MSExperiment::empty
bool empty() const
Definition: MSExperiment.h:137
main
int main(int argc, const char **argv)
Definition: INIFileEditor.cpp:73
MSExperiment.h
KDTree::operator==
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
OPENMS_LOG_ERROR
#define OPENMS_LOG_ERROR
Macro to be used if non-fatal error are reported (processing continues)
Definition: LogStream.h:455
OpenMS::PeakShape::right_endpoint_
PeakIterator right_endpoint_
Right peak endpoint in the data.
Definition: PeakShape.h:153
PeakPickerCWT.h
OpenMS::PeakShape::PositionLess::operator()
bool operator()(const PeakShape &a, const PeakShape &b)
Definition: PeakShape.h:143
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
OpenMS::MSExperiment::clear
void clear(bool clear_meta_data)
Clears all data and meta data.
OpenMS::Exception::BaseException::what
const char * what() const noexcept override
Returns the error message of the exception.
OpenMS::PeakShape::PositionLess
Comparison of mz_positions.
Definition: PeakShape.h:140
OpenMS::PeakShape::right_iterator_set_
bool right_iterator_set_
flag if left endpoint iterator differs from default value
Definition: PeakShape.h:159
OpenMS::PeakShape::r_value
double r_value
Correlation coefficient.
Definition: PeakShape.h:130
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
OpenMS::ProgressLogger::setLogType
void setLogType(LogType type) const
Sets the progress log that should be used. The default type is NONE!
TOPPBase.h
MSSpectrum.h
OpenMS::PeakShape::exp_
MSSpectrum exp_
Needed for initialization of endpoint iterators.
Definition: PeakShape.h:155