Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PeakPickerHiRes Class Reference

This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-MS, Orbitrap). In high resolution data, the signals of ions with similar mass-to-charge ratios (m/z) exhibit little or no overlapping and therefore allow for a clear separation. Furthermore, ion signals tend to show well-defined peak shapes with narrow peak width. More...

#include <OpenMS/TRANSFORMATIONS/RAW2PEAK/PeakPickerHiRes.h>

Inheritance diagram for PeakPickerHiRes:
DefaultParamHandler ProgressLogger

Classes

struct  PeakBoundary
 structure for peak boundaries More...
 

Public Member Functions

 PeakPickerHiRes ()
 Constructor. More...
 
virtual ~PeakPickerHiRes ()
 Destructor. More...
 
void pick (const MSSpectrum &input, MSSpectrum &output) const
 Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are written to the output spectrum. More...
 
void pick (const MSChromatogram &input, MSChromatogram &output) const
 Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked peaks are written to the output chromatogram. More...
 
void pick (const MSSpectrum &input, MSSpectrum &output, std::vector< PeakBoundary > &boundaries, bool check_spacings=true) const
 Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are written to the output spectrum. Peak boundaries are written to a separate structure. More...
 
void pick (const MSChromatogram &input, MSChromatogram &output, std::vector< PeakBoundary > &boundaries) const
 Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked peaks are written to the output chromatogram. More...
 
void pickExperiment (const PeakMap &input, PeakMap &output, const bool check_spectrum_type=true) const
 Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in the map consecutively. The resulting picked peaks are written to the output map. More...
 
void pickExperiment (const PeakMap &input, PeakMap &output, std::vector< std::vector< PeakBoundary > > &boundaries_spec, std::vector< std::vector< PeakBoundary > > &boundaries_chrom, const bool check_spectrum_type=true) const
 Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in the map consecutively. The resulting picked peaks are written to the output map. More...
 
void pickExperiment (OnDiscPeakMap &input, PeakMap &output, const bool check_spectrum_type=true) const
 Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in the map consecutively. The resulting picked peaks are written to the output map. More...
 
- Public Member Functions inherited from DefaultParamHandler
 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 DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () 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...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
 ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (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...
 

Protected Member Functions

void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

double signal_to_noise_
 
double spacing_difference_gap_
 
double spacing_difference_
 
unsigned missing_
 
std::vector< Intms_levels_
 
bool report_FWHM_
 add floatDataArray 'FWHM'/'FWHM_ppm' to spectra with peak FWHM More...
 
bool report_FWHM_as_ppm_
 unit of 'FWHM' float data array (can be absolute or ppm). More...
 
- Protected Attributes inherited from DefaultParamHandler
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< Stringsubsections_
 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...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD, GUI, NONE }
 Possible log types. More...
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-MS, Orbitrap). In high resolution data, the signals of ions with similar mass-to-charge ratios (m/z) exhibit little or no overlapping and therefore allow for a clear separation. Furthermore, ion signals tend to show well-defined peak shapes with narrow peak width.

This peak-picking algorithm detects ion signals in raw data and reconstructs the corresponding peak shape by cubic spline interpolation. Signal detection depends on the signal-to-noise ratio which is adjustable by the user (see parameter signal_to_noise). A picked peak's m/z and intensity value is given by the maximum of the underlying peak spline.

So far, this peak picker was mainly tested on high resolution data. With appropriate preprocessing steps (e.g. noise reduction and baseline subtraction), it might be also applied to low resolution data.

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
signal_to_noise float0 min: 0Minimal signal-to-noise ratio for a peak to be picked (0.0 disables SNT estimation!)
spacing_difference_gap float4 min: 0The extension of a peak is stopped if the spacing between two subsequent data points exceeds 'spacing_difference_gap * min_spacing'. 'min_spacing' is the smaller of the two spacings from the peak apex to its two neighboring points. '0' to disable the constraint. Not applicable to chromatograms.
spacing_difference float1.5 min: 0Maximum allowed difference between points during peak extension, in multiples of the minimal difference between the peak apex and its two neighboring points. If this difference is exceeded a missing point is assumed (see parameter 'missing'). A higher value implies a less stringent peak definition, since individual signals within the peak are allowed to be further apart. '0' to disable the constraint. Not applicable to chromatograms.
missing int1 min: 0Maximum number of missing points allowed when extending a peak to the left or to the right. A missing data point occurs if the spacing between two subsequent data points exceeds 'spacing_difference * min_spacing'. 'min_spacing' is the smaller of the two spacings from the peak apex to its two neighboring points. Not applicable to chromatograms.
ms_levels int list[1] min: 1List of MS levels for which the peak picking is applied. Other scans are copied to the output without changes.
report_FWHM stringfalse true, falseAdd metadata for FWHM (as floatDataArray named 'FWHM' or 'FWHM_ppm', depending on param 'report_FWHM_unit') for each picked peak.
report_FWHM_unit stringrelative relative, absoluteUnit of FWHM. Either absolute in the unit of input, e.g. 'm/z' for spectra, or relative as ppm (only sensible for spectra, not chromatograms).
SignalToNoise:max_intensity int-1 min: -1maximal intensity considered for histogram construction. By default, it will be calculated automatically (see auto_mode). Only provide this parameter if you know what you are doing (and change 'auto_mode' to '-1')! All intensities EQUAL/ABOVE 'max_intensity' will be added to the LAST histogram bin. If you choose 'max_intensity' too small, the noise estimate might be too small as well. If chosen too big, the bins become quite large (which you could counter by increasing 'bin_count', which increases runtime). In general, the Median-S/N estimator is more robust to a manual max_intensity than the MeanIterative-S/N.
SignalToNoise:auto_max_stdev_factor float3 min: 0 max: 999parameter for 'max_intensity' estimation (if 'auto_mode' == 0): mean + 'auto_max_stdev_factor' * stdev
SignalToNoise:auto_max_percentile int95 min: 0 max: 100parameter for 'max_intensity' estimation (if 'auto_mode' == 1): auto_max_percentile th percentile
SignalToNoise:auto_mode int0 min: -1 max: 1method to use to determine maximal intensity: -1 --> use 'max_intensity'; 0 --> 'auto_max_stdev_factor' method (default); 1 --> 'auto_max_percentile' method
SignalToNoise:win_len float200 min: 1window length in Thomson
SignalToNoise:bin_count int30 min: 3number of bins for intensity values
SignalToNoise:min_required_elements int10 min: 1minimum number of elements required in a window (otherwise it is considered sparse)
SignalToNoise:noise_for_empty_window float1e+20  noise value used for sparse windows
SignalToNoise:write_log_messages stringtrue true, falseWrite out log messages in case of sparse windows or median in rightmost histogram bin

Note:
Note
The peaks must be sorted according to ascending m/z!

Constructor & Destructor Documentation

◆ PeakPickerHiRes()

Constructor.

◆ ~PeakPickerHiRes()

virtual ~PeakPickerHiRes ( )
virtual

Destructor.

Member Function Documentation

◆ pick() [1/4]

void pick ( const MSSpectrum input,
MSSpectrum output 
) const
inline

Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are written to the output spectrum.

Parameters
inputinput spectrum in profile mode
outputoutput spectrum with picked peaks

Referenced by PeakPickerIterative::pick().

◆ pick() [2/4]

void pick ( const MSChromatogram input,
MSChromatogram output 
) const
inline

Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked peaks are written to the output chromatogram.

Parameters
inputinput chromatogram in profile mode
outputoutput chromatogram with picked peaks

◆ pick() [3/4]

void pick ( const MSSpectrum input,
MSSpectrum output,
std::vector< PeakBoundary > &  boundaries,
bool  check_spacings = true 
) const
inline

Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are written to the output spectrum. Peak boundaries are written to a separate structure.

Parameters
inputinput spectrum in profile mode
outputoutput spectrum with picked peaks
boundariesboundaries of the picked peaks
check_spacingscheck spacing constraints? (yes for spectra, no for chromatograms)

References MSSpectrum::clear(), CubicSpline2d::derivatives(), CubicSpline2d::eval(), MSSpectrum::getFloatDataArrays(), MSSpectrum::getMSLevel(), MSSpectrum::getName(), MSSpectrum::getRT(), SignalToNoiseEstimator< Container >::getSignalToNoise(), SignalToNoiseEstimator< Container >::init(), OpenMS::Constants::k, PeakPickerHiRes::PeakBoundary::mz_max, PeakPickerHiRes::PeakBoundary::mz_min, SpectrumSettings::PEAKS, Peak1D::setIntensity(), MSSpectrum::setMSLevel(), Peak1D::setMZ(), MSSpectrum::setName(), DefaultParamHandler::setParameters(), MSSpectrum::setRT(), and SpectrumSettings::setType().

◆ pick() [4/4]

void pick ( const MSChromatogram input,
MSChromatogram output,
std::vector< PeakBoundary > &  boundaries 
) const
inline

Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked peaks are written to the output chromatogram.

Parameters
inputinput chromatogram in profile mode
outputoutput chromatogram with picked peaks
boundariesboundaries of the picked peaks

References MSChromatogram::clear(), MSChromatogram::getFloatDataArrays(), MSSpectrum::getFloatDataArrays(), MSChromatogram::getName(), ChromatogramPeak::setIntensity(), Peak1D::setIntensity(), Peak1D::setMZ(), MSChromatogram::setName(), and ChromatogramPeak::setRT().

◆ pickExperiment() [1/3]

void pickExperiment ( const PeakMap input,
PeakMap output,
const bool  check_spectrum_type = true 
) const
inline

Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in the map consecutively. The resulting picked peaks are written to the output map.

Parameters
inputinput map in profile mode
outputoutput map with picked peaks
check_spectrum_typeif set, checks spectrum type and throws an exception if a centroided spectrum is passed

◆ pickExperiment() [2/3]

void pickExperiment ( const PeakMap input,
PeakMap output,
std::vector< std::vector< PeakBoundary > > &  boundaries_spec,
std::vector< std::vector< PeakBoundary > > &  boundaries_chrom,
const bool  check_spectrum_type = true 
) const
inline

Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in the map consecutively. The resulting picked peaks are written to the output map.

Parameters
inputinput map in profile mode
outputoutput map with picked peaks
boundaries_specboundaries of the picked peaks in spectra
boundaries_chromboundaries of the picked peaks in chromatograms
check_spectrum_typeif set, checks spectrum type and throws an exception if a centroided spectrum is passed

References MSExperiment::addChromatogram(), MSExperiment::clear(), ListUtils::contains(), MSExperiment::getChromatograms(), MSExperiment::getNrSpectra(), SpectrumSettings::PEAKS, MSExperiment::resize(), and MSExperiment::size().

◆ pickExperiment() [3/3]

void pickExperiment ( OnDiscPeakMap input,
PeakMap output,
const bool  check_spectrum_type = true 
) const
inline

Applies the peak-picking algorithm to a map (MSExperiment). This method picks peaks for each scan in the map consecutively. The resulting picked peaks are written to the output map.

Currently we have to give up const-correctness but we know that everything on disc is constant

References MSExperiment::addChromatogram(), MSExperiment::clear(), ListUtils::contains(), OnDiscMSExperiment::getChromatogram(), OnDiscMSExperiment::getExperimentalSettings(), OnDiscMSExperiment::getNrChromatograms(), OnDiscMSExperiment::getNrSpectra(), SpectrumSettings::getType(), SpectrumSettings::PEAKS, MSExperiment::resize(), OnDiscMSExperiment::size(), and MSSpectrum::sortByPosition().

◆ updateMembers_()

void updateMembers_ ( )
protectedvirtual

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.

Member Data Documentation

◆ missing_

unsigned missing_
protected

◆ ms_levels_

std::vector<Int> ms_levels_
protected

◆ report_FWHM_

bool report_FWHM_
protected

add floatDataArray 'FWHM'/'FWHM_ppm' to spectra with peak FWHM

◆ report_FWHM_as_ppm_

bool report_FWHM_as_ppm_
protected

unit of 'FWHM' float data array (can be absolute or ppm).

◆ signal_to_noise_

double signal_to_noise_
protected

◆ spacing_difference_

double spacing_difference_
protected

◆ spacing_difference_gap_

double spacing_difference_gap_
protected

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:11 using doxygen 1.8.13