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-2015.
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 
44 
45 //#define DEBUG_PEAK_PICKING
46 #undef DEBUG_PEAK_PICKING
47 //#define DEBUG_DECONV
48 namespace OpenMS
49 {
50  class PeakShape;
51 
78  class OPENMS_DLLAPI PeakPickerCWT :
79  public DefaultParamHandler,
80  public ProgressLogger
81  {
82 public:
87 
89  PeakPickerCWT();
90 
92  virtual ~PeakPickerCWT();
93 
99  void pick(const MSSpectrum<> & input, MSSpectrum<> & output);
100 
108  void pickExperiment(const MSExperiment<> & input, MSExperiment<> & output);
109 
120  double estimatePeakWidth(const MSExperiment<> & input);
121 protected:
122 
124  float peak_bound_;
125 
128 
131 
133  float fwhm_bound_;
134 
137 
139  float scale_;
140 
143 
146 
149 
152 
155 
156 
157  void updateMembers_();
158 
160  void init_();
161 
162 
169  struct OPENMS_DLLAPI PeakArea_
170  {
172 
188  };
189 
190 
192  void getPeakArea_(const PeakArea_ & area, double & area_left, double & area_right);
193 
195  PeakShape fitPeakShape_(const PeakArea_ & area, bool enable_centroid_fit);
196 
203  double correlate_(const PeakShape & peak, const PeakArea_ & area, Int direction = 0) const;
204 
205 
214  bool getMaxPosition_(PeakIterator first, PeakIterator last, const ContinuousWaveletTransform & wt, PeakArea_ & area, Int distance_from_scan_border, Int ms_level, double peak_bound_cwt, double peak_bound_ms2_level_cwt, Int direction = 1);
215 
216 
236  bool getPeakEndPoints_(PeakIterator first, PeakIterator last, PeakArea_ & area, Int distance_from_scan_border, Int & peak_left_index, Int & peak_right_index, ContinuousWaveletTransformNumIntegration & wt);
237 
238 
245  void getPeakCentroid_(PeakArea_ & area);
246 
248  double lorentz_(double height, double lambda, double pos, double x);
249 
259  void initializeWT_(ContinuousWaveletTransformNumIntegration & wt, double & peak_bound_cwt, double & peak_bound_ms2_level_cwt);
260 
264 
271  bool deconvolutePeak_(PeakShape & shape, std::vector<PeakShape> & peak_shapes, double peak_bound_cwt);
272 
274  Int getNumberOfPeaks_(ConstPeakIterator first, ConstPeakIterator last, std::vector<double> & peak_values,
275  Int direction, double resolution, ContinuousWaveletTransformNumIntegration & wt, double peak_bound_cwt);
276 
278  Int determineChargeState_(std::vector<double> & peak_values);
279 
281  void addPeak_(std::vector<PeakShape> & peaks_DC, PeakArea_ & area, double left_width, double right_width, OptimizePeakDeconvolution::Data & data);
283  }; // end PeakPickerCWT
284 
285 } // namespace OpenMS
286 
287 #endif
PeakIterator right
Definition: PeakPickerCWT.h:184
float signal_to_noise_
Signal to noise threshold.
Definition: PeakPickerCWT.h:130
PeakIterator left_behind_centroid
Definition: PeakPickerCWT.h:185
PeakIterator left
Iterator defining a raw data peak.
Definition: PeakPickerCWT.h:182
MSSpectrum::iterator PeakIterator
Raw data iterator type.
Definition: PeakPickerCWT.h:84
bool two_d_optimization_
Switch for the 2D optimization of peak parameters.
Definition: PeakPickerCWT.h:154
This class implements a peak picking algorithm using wavelet techniques.
Definition: PeakPickerCWT.h:78
MSSpectrum::iterator PeakIterator
Definition: PeakPickerCWT.h:171
float peak_bound_ms2_level_
Threshold for the peak height in the MS 2 level.
Definition: PeakPickerCWT.h:127
DPosition< 1 > centroid_position
The estimated centroid position.
Definition: PeakPickerCWT.h:187
This class is the base class of the continuous wavelet transformation.
Definition: ContinuousWaveletTransform.h:47
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:86
bool optimization_
Switch for the optimization of peak parameters.
Definition: PeakPickerCWT.h:148
float peak_bound_
Threshold for the peak height in the MS 1 level.
Definition: PeakPickerCWT.h:124
float noise_level_
The threshold for the noise level (TODO: Use the information of the signal to noise estimator) ...
Definition: PeakPickerCWT.h:145
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
Internal representation of a peak shape (used by the PeakPickerCWT)
Definition: PeakShape.h:51
UInt radius_
The search radius for the determination of a peak&#39;s maximum position.
Definition: PeakPickerCWT.h:136
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:55
PeakIterator max
Definition: PeakPickerCWT.h:183
Class containing the data needed for optimization.
Definition: OptimizePeakDeconvolution.h:111
float fwhm_bound_
The minimal full width at half maximum.
Definition: PeakPickerCWT.h:133
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
float peak_corr_bound_
The threshold for correlation.
Definition: PeakPickerCWT.h:142
bool deconvolution_
Switch for the deconvolution of peak parameters.
Definition: PeakPickerCWT.h:151
float scale_
The dilation of the wavelet.
Definition: PeakPickerCWT.h:139
int Int
Signed integer type.
Definition: Types.h:96
Class for the internal peak representation.
Definition: PeakPickerCWT.h:169

OpenMS / TOPP release 2.0.0 Documentation generated on Wed Mar 30 2016 16:18:41 using doxygen 1.8.5