OpenMS
ElutionPeakDetection.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg$
6 // $Authors: Erhan Kenar, Holger Franken $
7 // --------------------------------------------------------------------------
8 
9 
10 #pragma once
11 
16 
17 namespace OpenMS
18 {
50  class OPENMS_DLLAPI ElutionPeakDetection :
51  public DefaultParamHandler, public ProgressLogger
52  {
53 public:
56 
59 
69  void detectPeaks(MassTrace& mt, std::vector<MassTrace>& single_mtraces);
70 
80  void detectPeaks(std::vector<MassTrace>& mt_vec, std::vector<MassTrace>& single_mtraces);
81 
83  void filterByPeakWidth(std::vector<MassTrace>&, std::vector<MassTrace>&);
84 
87 
90 
92  double computeApexSNR(const MassTrace&);
93 
118  void findLocalExtrema(const MassTrace& tr, const Size& num_neighboring_peaks,
119  std::vector<Size>& chrom_maxes, std::vector<Size>& chrom_mins) const;
120 
122  void smoothData(MassTrace& mt, int win_size) const;
123 
124 protected:
125  void updateMembers_() override;
126 
127 private:
128  double chrom_fwhm_;
130 
131  double min_fwhm_;
132  double max_fwhm_;
133 
136 
139 
141  void detectElutionPeaks_(MassTrace&, std::vector<MassTrace>&);
142  };
143 
144 } // namespace OpenMS
145 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Extracts chromatographic peaks from a mass trace.
Definition: ElutionPeakDetection.h:52
double computeApexSNR(const MassTrace &)
Compute the signal to noise ratio at the apex (estimated by computeMassTraceNoise)
bool mt_snr_filtering_
Whether to apply S/N filtering.
Definition: ElutionPeakDetection.h:138
void detectElutionPeaks_(MassTrace &, std::vector< MassTrace > &)
Main function to do the work.
double chrom_peak_snr_
Definition: ElutionPeakDetection.h:129
double max_fwhm_
Definition: ElutionPeakDetection.h:132
void findLocalExtrema(const MassTrace &tr, const Size &num_neighboring_peaks, std::vector< Size > &chrom_maxes, std::vector< Size > &chrom_mins) const
Computes local extrema on a mass trace.
void detectPeaks(std::vector< MassTrace > &mt_vec, std::vector< MassTrace > &single_mtraces)
Extracts chromatographic peaks from multiple MassTraces and stores the resulting split traces in a ve...
String pw_filtering_
Type of width filtering.
Definition: ElutionPeakDetection.h:135
void detectPeaks(MassTrace &mt, std::vector< MassTrace > &single_mtraces)
Extracts chromatographic peaks from a single MassTrace and stores the resulting split traces in a vec...
void smoothData(MassTrace &mt, int win_size) const
adds smoothed_intensities to internal data of mt
double min_fwhm_
Definition: ElutionPeakDetection.h:131
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
double computeMassTraceSNR(const MassTrace &)
Compute the signal to noise ratio (estimated by computeMassTraceNoise)
ElutionPeakDetection()
Default Constructor.
double computeMassTraceNoise(const MassTrace &)
Compute noise level (as RMSE of the actual signal and the smoothed signal)
double chrom_fwhm_
Definition: ElutionPeakDetection.h:128
~ElutionPeakDetection() override
Destructor.
void filterByPeakWidth(std::vector< MassTrace > &, std::vector< MassTrace > &)
Filter out mass traces below lower 5 % quartile and above upper 95 % quartile.
A container type that gathers peaks similar in m/z and moving along retention time.
Definition: MassTrace.h:36
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:27
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22