Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERCWT_H
00036 #define OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKPICKERCWT_H
00037
00038 #include <OpenMS/KERNEL/MSExperiment.h>
00039 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/PeakShape.h>
00040 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
00041 #include <OpenMS/CONCEPT/ProgressLogger.h>
00042 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/OptimizePeakDeconvolution.h>
00043 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/ContinuousWaveletTransform.h>
00044 #include <OpenMS/TRANSFORMATIONS/RAW2PEAK/ContinuousWaveletTransformNumIntegration.h>
00045
00046
00047 #undef DEBUG_PEAK_PICKING
00048
00049 namespace OpenMS
00050 {
00077 class OPENMS_DLLAPI PeakPickerCWT :
00078 public DefaultParamHandler,
00079 public ProgressLogger
00080 {
00081 public:
00083 typedef MSSpectrum<>::iterator PeakIterator;
00085 typedef MSSpectrum<>::const_iterator ConstPeakIterator;
00086
00088 PeakPickerCWT();
00089
00091 virtual ~PeakPickerCWT();
00092
00098 void pick(const MSSpectrum<> & input, MSSpectrum<> & output);
00099
00107 void pickExperiment(const MSExperiment<> & input, MSExperiment<> & output);
00108
00119 DoubleReal estimatePeakWidth(const MSExperiment<> & input);
00120 protected:
00121
00123 float peak_bound_;
00124
00126 float peak_bound_ms2_level_;
00127
00129 float signal_to_noise_;
00130
00132 float fwhm_bound_;
00133
00135 UInt radius_;
00136
00138 float scale_;
00139
00141 float peak_corr_bound_;
00142
00144 float noise_level_;
00145
00147 bool optimization_;
00148
00150 bool deconvolution_;
00151
00153 bool two_d_optimization_;
00154
00155
00156 void updateMembers_();
00157
00159 void init_();
00160
00161
00168 struct OPENMS_DLLAPI PeakArea_
00169 {
00170 typedef MSSpectrum<>::iterator PeakIterator;
00171
00181 PeakIterator left;
00182 PeakIterator max;
00183 PeakIterator right;
00184 PeakIterator left_behind_centroid;
00186 DPosition<1> centroid_position;
00187 };
00188
00189
00191 void getPeakArea_(const PeakArea_ & area, double & area_left, double & area_right);
00192
00194 PeakShape fitPeakShape_(const PeakArea_ & area, bool enable_centroid_fit);
00195
00202 double correlate_(const PeakShape & peak, const PeakArea_ & area, Int direction = 0) const;
00203
00204
00213 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);
00214
00215
00235 bool getPeakEndPoints_(PeakIterator first, PeakIterator last, PeakArea_ & area, Int distance_from_scan_border, Int & peak_left_index, Int & peak_right_index, ContinuousWaveletTransformNumIntegration & wt);
00236
00237
00244 void getPeakCentroid_(PeakArea_ & area);
00245
00247 double lorentz_(double height, double lambda, double pos, double x);
00248
00258 void initializeWT_(ContinuousWaveletTransformNumIntegration & wt, DoubleReal & peak_bound_cwt, DoubleReal & peak_bound_ms2_level_cwt);
00259
00263
00270 bool deconvolutePeak_(PeakShape & shape, std::vector<PeakShape> & peak_shapes, DoubleReal peak_bound_cwt);
00271
00273 Int getNumberOfPeaks_(ConstPeakIterator first, ConstPeakIterator last, std::vector<double> & peak_values,
00274 Int direction, DoubleReal resolution, ContinuousWaveletTransformNumIntegration & wt, DoubleReal peak_bound_cwt);
00275
00277 Int determineChargeState_(std::vector<double> & peak_values);
00278
00280 void addPeak_(std::vector<PeakShape> & peaks_DC, PeakArea_ & area, double left_width, double right_width, OptimizePeakDeconvolution::Data & data);
00282 };
00283
00284 }
00285
00286 #endif