Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
PeakPickerCWT.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, Alexandra Zerck $
33 // --------------------------------------------------------------------------
34 //
35 #ifndef OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERCWT_H
36 #define OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERCWT_H
37 
45 
46 //#define DEBUG_PEAK_PICKING
47 #undef DEBUG_PEAK_PICKING
48 //#define DEBUG_DECONV
49 namespace OpenMS
50 {
77  class OPENMS_DLLAPI PeakPickerCWT :
78  public DefaultParamHandler,
79  public ProgressLogger
80  {
81 public:
86 
88  PeakPickerCWT();
89 
91  virtual ~PeakPickerCWT();
92 
98  void pick(const MSSpectrum<> & input, MSSpectrum<> & output);
99 
107  void pickExperiment(const MSExperiment<> & input, MSExperiment<> & output);
108 
119  DoubleReal estimatePeakWidth(const MSExperiment<> & input);
120 protected:
121 
123  float peak_bound_;
124 
127 
130 
132  float fwhm_bound_;
133 
136 
138  float scale_;
139 
142 
145 
148 
151 
154 
155 
156  void updateMembers_();
157 
159  void init_();
160 
161 
168  struct OPENMS_DLLAPI PeakArea_
169  {
171 
187  };
188 
189 
191  void getPeakArea_(const PeakArea_ & area, double & area_left, double & area_right);
192 
194  PeakShape fitPeakShape_(const PeakArea_ & area, bool enable_centroid_fit);
195 
202  double correlate_(const PeakShape & peak, const PeakArea_ & area, Int direction = 0) const;
203 
204 
213  bool getMaxPosition_(PeakIterator first, PeakIterator last, const ContinuousWaveletTransform & wt, PeakArea_ & area, Int distance_from_scan_border, Int ms_level, DoubleReal peak_bound_cwt, DoubleReal peak_bound_ms2_level_cwt, Int direction = 1);
214 
215 
235  bool getPeakEndPoints_(PeakIterator first, PeakIterator last, PeakArea_ & area, Int distance_from_scan_border, Int & peak_left_index, Int & peak_right_index, ContinuousWaveletTransformNumIntegration & wt);
236 
237 
244  void getPeakCentroid_(PeakArea_ & area);
245 
247  double lorentz_(double height, double lambda, double pos, double x);
248 
258  void initializeWT_(ContinuousWaveletTransformNumIntegration & wt, DoubleReal & peak_bound_cwt, DoubleReal & peak_bound_ms2_level_cwt);
259 
263 
270  bool deconvolutePeak_(PeakShape & shape, std::vector<PeakShape> & peak_shapes, DoubleReal peak_bound_cwt);
271 
273  Int getNumberOfPeaks_(ConstPeakIterator first, ConstPeakIterator last, std::vector<double> & peak_values,
274  Int direction, DoubleReal resolution, ContinuousWaveletTransformNumIntegration & wt, DoubleReal peak_bound_cwt);
275 
277  Int determineChargeState_(std::vector<double> & peak_values);
278 
280  void addPeak_(std::vector<PeakShape> & peaks_DC, PeakArea_ & area, double left_width, double right_width, OptimizePeakDeconvolution::Data & data);
282  }; // end PeakPickerCWT
283 
284 } // namespace OpenMS
285 
286 #endif
PeakIterator right
Definition: PeakPickerCWT.h:183
Internal representation of a peak shape (used by the PeakPickerCWT)
Definition: PeakShape.h:51
float signal_to_noise_
Signal to noise threshold.
Definition: PeakPickerCWT.h:129
PeakIterator left_behind_centroid
Definition: PeakPickerCWT.h:184
PeakIterator left
Iterator defining a raw data peak.
Definition: PeakPickerCWT.h:181
MSSpectrum::iterator PeakIterator
Raw data iterator type.
Definition: PeakPickerCWT.h:83
bool two_d_optimization_
Switch for the 2D optimization of peak parameters.
Definition: PeakPickerCWT.h:153
This class implements a peak picking algorithm using wavelet techniques.
Definition: PeakPickerCWT.h:77
MSSpectrum::iterator PeakIterator
Definition: PeakPickerCWT.h:170
float peak_bound_ms2_level_
Threshold for the peak height in the MS 2 level.
Definition: PeakPickerCWT.h:126
DPosition< 1 > centroid_position
The estimated centroid position.
Definition: PeakPickerCWT.h:186
This class is the base class of the continuous wavelet transformation.
Definition: ContinuousWaveletTransform.h:48
This class computes the continuous wavelet transformation using a marr wavelet.
Definition: ContinuousWaveletTransformNumIntegration.h:57
MSSpectrum::const_iterator ConstPeakIterator
Const raw data iterator type.
Definition: PeakPickerCWT.h:85
bool optimization_
Switch for the optimization of peak parameters.
Definition: PeakPickerCWT.h:147
float peak_bound_
Threshold for the peak height in the MS 1 level.
Definition: PeakPickerCWT.h:123
float noise_level_
The threshold for the noise level (TODO: Use the information of the signal to noise estimator) ...
Definition: PeakPickerCWT.h:144
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
UInt radius_
The search radius for the determination of a peak&#39;s maximum position.
Definition: PeakPickerCWT.h:135
Representation of a mass spectrometry experiment.
Definition: MSExperiment.h:68
Base class for all classes that want to report their progess.
Definition: ProgressLogger.h:56
PeakIterator max
Definition: PeakPickerCWT.h:182
Class containing the data needed for optimization.
Definition: OptimizePeakDeconvolution.h:119
float fwhm_bound_
The minimal full width at half maximum.
Definition: PeakPickerCWT.h:132
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:90
float peak_corr_bound_
The threshold for correlation.
Definition: PeakPickerCWT.h:141
bool deconvolution_
Switch for the deconvolution of peak parameters.
Definition: PeakPickerCWT.h:150
float scale_
The dilation of the wavelet.
Definition: PeakPickerCWT.h:138
int Int
Signed integer type.
Definition: Types.h:100
Class for the internal peak representation.
Definition: PeakPickerCWT.h:168

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