OpenMS
PeakPickerHiRes.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Author: Erhan Kenar $
6 // $Maintainer: Timo Sachsenberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
15 
16 #define DEBUG_PEAK_PICKING
17 #undef DEBUG_PEAK_PICKING
18 //#undef DEBUG_DECONV
19 namespace OpenMS
20 {
21  class MSChromatogram;
22  class OnDiscMSExperiment;
23 
55  class OPENMS_DLLAPI PeakPickerHiRes :
56  public DefaultParamHandler,
57  public ProgressLogger
58  {
59 public:
62 
64  ~PeakPickerHiRes() override;
65 
67  struct PeakBoundary
68  {
69  double mz_min;
70  double mz_max;
71  };
72 
81  void pick(const MSSpectrum& input, MSSpectrum& output) const;
82 
90  void pick(const MSChromatogram& input, MSChromatogram& output) const;
91 
102  void pick(const MSSpectrum& input, MSSpectrum& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = true) const;
103 
113  void pick(const MSChromatogram& input, MSChromatogram& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = false) const;
114 
124  void pickExperiment(const PeakMap& input, PeakMap& output, const bool check_spectrum_type = true) const;
125 
137  void pickExperiment(const PeakMap& input,
138  PeakMap& output,
139  std::vector<std::vector<PeakBoundary> >& boundaries_spec,
140  std::vector<std::vector<PeakBoundary> >& boundaries_chrom,
141  const bool check_spectrum_type = true) const;
142 
150  void pickExperiment(/* const */ OnDiscMSExperiment& input, PeakMap& output, const bool check_spectrum_type = true) const;
151 
152 protected:
153 
154  template <typename ContainerType>
155  void pick_(const ContainerType& input, ContainerType& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = true, int im_index = -1) const;
156 
157  // signal-to-noise parameter
159 
160  // maximal spacing difference defining a large gap
162 
163  // maximal spacing difference defining a missing data point
165 
166  // maximum number of missing points
167  unsigned missing_;
168 
169  // MS levels to which peak picking is applied
170  std::vector<Int> ms_levels_;
171 
174 
177 
178  // docu in base class
179  void updateMembers_() override;
180 
181  }; // end PeakPickerHiRes
182 
183 } // namespace OpenMS
184 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
The representation of a chromatogram.
Definition: MSChromatogram.h:30
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:45
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Representation of a mass spectrometry experiment on disk.
Definition: OnDiscMSExperiment.h:41
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:58
void pick(const MSSpectrum &input, MSSpectrum &output) const
Applies the peak-picking algorithm to a single spectrum (MSSpectrum). The resulting picked peaks are ...
unsigned missing_
Definition: PeakPickerHiRes.h:167
double spacing_difference_
Definition: PeakPickerHiRes.h:164
double signal_to_noise_
Definition: PeakPickerHiRes.h:158
double spacing_difference_gap_
Definition: PeakPickerHiRes.h:161
bool report_FWHM_
add floatDataArray 'FWHM'/'FWHM_ppm' to spectra with peak FWHM
Definition: PeakPickerHiRes.h:173
~PeakPickerHiRes() override
Destructor.
std::vector< Int > ms_levels_
Definition: PeakPickerHiRes.h:170
double mz_max
Definition: PeakPickerHiRes.h:70
PeakPickerHiRes()
Constructor.
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 ...
void pick(const MSChromatogram &input, MSChromatogram &output) const
Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked pe...
double mz_min
Definition: PeakPickerHiRes.h:69
void pick(const MSChromatogram &input, MSChromatogram &output, std::vector< PeakBoundary > &boundaries, bool check_spacings=false) const
Applies the peak-picking algorithm to a single chromatogram (MSChromatogram). The resulting picked pe...
void pick_(const ContainerType &input, ContainerType &output, std::vector< PeakBoundary > &boundaries, bool check_spacings=true, int im_index=-1) const
bool report_FWHM_as_ppm_
unit of 'FWHM' float data array (can be absolute or ppm).
Definition: PeakPickerHiRes.h:176
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
void pickExperiment(OnDiscMSExperiment &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 ...
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 ...
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 ...
structure for peak boundaries
Definition: PeakPickerHiRes.h:68
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19