![]() |
OpenMS
2.4.0
|
This class implements a peak picking algorithm using wavelet techniques. More...
#include <OpenMS/TRANSFORMATIONS/RAW2PEAK/PeakPickerCWT.h>
Classes | |
struct | PeakArea_ |
Class for the internal peak representation. More... | |
Public Types | |
typedef MSSpectrum::iterator | PeakIterator |
Profile data iterator type. More... | |
typedef MSSpectrum::const_iterator | ConstPeakIterator |
Const profile data iterator type. More... | |
![]() | |
enum | LogType { CMD, GUI, NONE } |
Possible log types. More... | |
Public Member Functions | |
PeakPickerCWT () | |
Constructor. More... | |
~PeakPickerCWT () override | |
Destructor. More... | |
void | pick (const MSSpectrum &input, MSSpectrum &output) const |
Applies the peak picking algorithm to a single spectrum. More... | |
void | pickExperiment (const PeakMap &input, PeakMap &output) |
Picks the peaks in an MSExperiment. More... | |
double | estimatePeakWidth (const PeakMap &input) |
Estimates average peak width that can then be used for peak picking. More... | |
![]() | |
DefaultParamHandler (const String &name) | |
Constructor with name that is displayed in error messages. More... | |
DefaultParamHandler (const DefaultParamHandler &rhs) | |
Copy constructor. More... | |
virtual | ~DefaultParamHandler () |
Destructor. More... | |
virtual DefaultParamHandler & | operator= (const DefaultParamHandler &rhs) |
Assignment operator. More... | |
virtual bool | operator== (const DefaultParamHandler &rhs) const |
Equality operator. More... | |
void | setParameters (const Param ¶m) |
Sets the parameters. More... | |
const Param & | getParameters () const |
Non-mutable access to the parameters. More... | |
const Param & | getDefaults () const |
Non-mutable access to the default parameters. More... | |
const String & | getName () const |
Non-mutable access to the name. More... | |
void | setName (const String &name) |
Mutable access to the name. More... | |
const std::vector< String > & | getSubsections () const |
Non-mutable access to the registered subsections. More... | |
![]() | |
ProgressLogger () | |
Constructor. More... | |
~ProgressLogger () | |
Destructor. More... | |
ProgressLogger (const ProgressLogger &other) | |
Copy constructor. More... | |
ProgressLogger & | operator= (const ProgressLogger &other) |
Assignment Operator. More... | |
void | setLogType (LogType type) const |
Sets the progress log that should be used. The default type is NONE! More... | |
LogType | getLogType () const |
Returns the type of progress log being used. More... | |
void | startProgress (SignedSize begin, SignedSize end, const String &label) const |
Initializes the progress display. More... | |
void | setProgress (SignedSize value) const |
Sets the current progress. More... | |
void | endProgress () const |
Ends the progress display. More... | |
void | nextProgress () const |
increment progress by 1 (according to range begin-end) More... | |
Protected Member Functions | |
void | updateMembers_ () override |
This method is used to update extra member variables at the end of the setParameters() method. More... | |
void | getPeakArea_ (const PeakArea_ &area, double &area_left, double &area_right) const |
Computes the peak's left and right area. More... | |
PeakShape | fitPeakShape_ (const PeakArea_ &area) const |
Returns the best fitting peakshape. More... | |
double | correlate_ (const PeakShape &peak, const PeakArea_ &area, Int direction=0) const |
Returns the squared Pearson coefficient. More... | |
bool | getMaxPosition_ (const PeakIterator first, const PeakIterator last, const ContinuousWaveletTransform &wt, PeakArea_ &area, const Int distance_from_scan_border, const double peak_bound_cwt, const double peak_bound_ms2_level_cwt, const Int direction=1) const |
Finds the next maximum position in the wavelet transform wt. More... | |
bool | getPeakEndPoints_ (PeakIterator first, PeakIterator last, PeakArea_ &area, Int distance_from_scan_border, Int &peak_left_index, Int &peak_right_index, ContinuousWaveletTransformNumIntegration &wt) const |
Determines a peaks's endpoints. More... | |
void | getPeakCentroid_ (PeakArea_ &area) const |
Estimates a peak's centroid position. More... | |
double | lorentz_ (const double height, const double lambda, const double pos, const double x) const |
Computes the value of a theoretical Lorentz peak at position x. More... | |
void | initializeWT_ (ContinuousWaveletTransformNumIntegration &wt, const double peak_bound_in, double &peak_bound_ms_cwt) const |
Computes the threshold for the peak height in the wavelet transform and initializes the wavelet transform. More... | |
Methods needed for separation of overlapping peaks | |
bool | deconvolutePeak_ (PeakShape &shape, std::vector< PeakShape > &peak_shapes, double peak_bound_cwt) const |
Separates overlapping peaks. More... | |
Int | getNumberOfPeaks_ (ConstPeakIterator first, ConstPeakIterator last, std::vector< double > &peak_values, Int direction, double resolution, ContinuousWaveletTransformNumIntegration &wt, double peak_bound_cwt) const |
Determines the number of peaks in the given mass range using the cwt. More... | |
Int | determineChargeState_ (std::vector< double > &peak_values) const |
Estimate the charge state of the peaks. More... | |
void | addPeak_ (std::vector< PeakShape > &peaks_DC, PeakArea_ &area, double left_width, double right_width, OptimizePeakDeconvolution::Data &data) const |
Add a peak. More... | |
![]() | |
void | defaultsToParam_ () |
Updates the parameters after the defaults have been set in the constructor. More... | |
Protected Attributes | |
float | peak_bound_ |
Threshold for the peak height in the MS 1 level. More... | |
float | peak_bound_ms2_level_ |
Threshold for the peak height in the MS 2 level. More... | |
float | signal_to_noise_ |
Signal to noise threshold. More... | |
float | fwhm_bound_ |
The minimal full width at half maximum. More... | |
UInt | radius_ |
The search radius for the determination of a peak's maximum position. More... | |
float | scale_ |
The dilation of the wavelet. More... | |
float | peak_corr_bound_ |
The threshold for correlation. More... | |
float | noise_level_ |
The threshold for the noise level (TODO: Use the information of the signal to noise estimator) More... | |
bool | optimization_ |
Switch for the optimization of peak parameters. More... | |
bool | deconvolution_ |
Switch for the deconvolution of peak parameters. More... | |
bool | two_d_optimization_ |
Switch for the 2D optimization of peak parameters. More... | |
![]() | |
Param | param_ |
Container for current parameters. More... | |
Param | defaults_ |
Container for default parameters. This member should be filled in the constructor of derived classes! More... | |
std::vector< String > | subsections_ |
Container for registered subsections. This member should be filled in the constructor of derived classes! More... | |
String | error_name_ |
Name that is displayed in error messages during the parameter checking. More... | |
bool | check_defaults_ |
If this member is set to false no checking if parameters in done;. More... | |
bool | warn_empty_defaults_ |
If this member is set to false no warning is emitted when defaults are empty;. More... | |
![]() | |
LogType | type_ |
time_t | last_invoke_ |
ProgressLoggerImpl * | current_logger_ |
Additional Inherited Members | |
![]() | |
static String | logTypeToFactoryName_ (LogType type) |
Return the name of the factory product used for this log type. More... | |
![]() | |
static int | recursion_depth_ |
This class implements a peak picking algorithm using wavelet techniques.
The algorithm is described in detail in Lange et al. (2006) Proc. PSB-06.
This peak picking algorithm uses the continuous wavelet transform of a profile data signal to detect mass peaks. Afterwards a given asymmetric peak function is fitted to the profile data and important peak parameters (e.g. fwhm) are extracted. In an optional step these parameters can be optimized using a non-linear optimization method.
The peak parameters are stored in the meta data arrays of the spectra (see MSSpectrum) in this order:
typedef MSSpectrum::const_iterator ConstPeakIterator |
Const profile data iterator type.
typedef MSSpectrum::iterator PeakIterator |
Profile data iterator type.
PeakPickerCWT | ( | ) |
Constructor.
|
override |
Destructor.
|
protected |
Add a peak.
|
protected |
Returns the squared Pearson coefficient.
Computes the correlation of the peak and the original data given by the peak endpoints area.left and area.right. If the value is near 1, the fitted peakshape and the profile data are expected to be very similar.
|
protected |
Separates overlapping peaks.
It determines the number of peaks lying underneath the initial peak using the cwt with different scales. Then a nonlinear optimization procedure is applied to optimize the peak parameters.
Estimate the charge state of the peaks.
Estimates average peak width that can then be used for peak picking.
The spectra with the highest TICs are used to estimate an average peak width that can be used as the peak_width parameter for picking the complete data set. Typically, the number of peaks increases with decreasing peak width until a plateau is reached. The beginning of this plateau is our estimate for the peak width. This estimate is averaged over several spectra.
Returns the best fitting peakshape.
|
protected |
Finds the next maximum position in the wavelet transform wt.
If the maximum is greater than peak_bound_cwt we search for the corresponding maximum in the profile data interval [first,last) given a predefined search radius radius. Only peaks with intensities greater than peak_bound_ are relevant. If no peak is detected the method return false. For direction=1, the method runs from first to last given direction=-1 it runs the other way around.
|
protected |
Determines the number of peaks in the given mass range using the cwt.
|
protected |
Computes the peak's left and right area.
|
protected |
Estimates a peak's centroid position.
Computes the centroid position of the peak using all profile data points which are greater than 'centroid_percentage' (user-param) of the most intensive profile data point.
|
protected |
Determines a peaks's endpoints.
The algorithm does the following:
|
protected |
Computes the threshold for the peak height in the wavelet transform and initializes the wavelet transform.
Given the threshold for the peak height a corresponding value peak_bound_cwt can be computed for the continuous wavelet transform. Therefore we compute a theoretical Lorentzian peakshape with height=peak_bound_ and a width which is similar to the width of the wavelet. Taking the maximum in the wavelet transform of the Lorentzian peak we have a peak bound in the wavelet transform.
|
inlineprotected |
Computes the value of a theoretical Lorentz peak at position x.
void pick | ( | const MSSpectrum & | input, |
MSSpectrum & | output | ||
) | const |
Applies the peak picking algorithm to a single spectrum.
Picks the peaks in the input spectrum and writes the resulting peaks to the output container.
Picks the peaks in an MSExperiment.
Picks the peaks successive in every scan in the spectrum range. The detected peaks are stored in the output MSExperiment.
Exception::UnableToFit() | if peak width cannot be determined (if estimation is set to auto) |
|
overrideprotectedvirtual |
This method is used to update extra member variables at the end of the setParameters() method.
Also call it at the end of the derived classes' copy constructor and assignment operator.
The default implementation is empty.
Reimplemented from DefaultParamHandler.
|
protected |
Switch for the deconvolution of peak parameters.
|
protected |
The minimal full width at half maximum.
|
protected |
The threshold for the noise level (TODO: Use the information of the signal to noise estimator)
|
protected |
Switch for the optimization of peak parameters.
|
protected |
Threshold for the peak height in the MS 1 level.
|
protected |
Threshold for the peak height in the MS 2 level.
|
protected |
The threshold for correlation.
|
protected |
The search radius for the determination of a peak's maximum position.
|
protected |
The dilation of the wavelet.
|
protected |
Signal to noise threshold.
|
protected |
Switch for the 2D optimization of peak parameters.