OpenMS
PeakPickerChromatogram.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
16 
20 
22 
23 #ifdef WITH_CRAWDAD
24 #include <CrawdadWrapper.h>
25 #endif
26 
27 namespace OpenMS
28 {
29 
42  class OPENMS_DLLAPI PeakPickerChromatogram :
43  public DefaultParamHandler
44  {
45 
46 public:
47 
51 
55 
57  enum FLOATINDICES { IDX_FWHM = 0, IDX_ABUNDANCE = 1, IDX_LEFTBORDER = 2, IDX_RIGHTBORDER = 3, SIZE_OF_FLOATINDICES };
58 
66  void pickChromatogram(const MSChromatogram& chromatogram, MSChromatogram& picked_chrom);
67 
68 
76  void pickChromatogram(const MSChromatogram& chromatogram, MSChromatogram& picked_chrom, MSChromatogram& smoothed_chrom);
77 
78 protected:
79 
80  void pickChromatogramCrawdad_(const MSChromatogram& chromatogram, MSChromatogram& picked_chrom);
81 
82  void pickChromatogram_(const MSChromatogram& chromatogram, MSChromatogram& picked_chrom);
83 
87  void integratePeaks_(const MSChromatogram& chromatogram);
88 
97  Size findClosestPeak_(const MSChromatogram& chromatogram, double target_rt, Size current_peak = 0);
98 
103  void removeOverlappingPeaks_(const MSChromatogram& chromatogram, MSChromatogram& picked_chrom);
104 
105 
107  void updateMembers_() override;
108 
111 
112  // Members
118  double gauss_width_;
123 
125  double peak_width_;
128 
130  double sn_win_len_;
137 
139  std::vector<double> integrated_intensities_;
141  std::vector<int> left_width_;
143  std::vector<int> right_width_;
144 
149  };
150 }
151 
152 
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
This class represents a Gaussian lowpass-filter which works on uniform as well as on non-uniform prof...
Definition: GaussFilter.h:47
The representation of a chromatogram.
Definition: MSChromatogram.h:30
The PeakPickerChromatogram finds peaks a single chromatogram.
Definition: PeakPickerChromatogram.h:44
std::vector< int > right_width_
Temporary vector to hold the peak right widths.
Definition: PeakPickerChromatogram.h:143
GaussFilter gauss_
Definition: PeakPickerChromatogram.h:147
double sn_win_len_
Signal to noise window length.
Definition: PeakPickerChromatogram.h:130
void removeOverlappingPeaks_(const MSChromatogram &chromatogram, MSChromatogram &picked_chrom)
Helper function to remove overlapping peaks in a single Chromatogram.
void pickChromatogram(const MSChromatogram &chromatogram, MSChromatogram &picked_chrom)
Finds peaks in a single chromatogram and annotates left/right borders.
UInt sgolay_frame_length_
Frame length for the SGolay smoothing.
Definition: PeakPickerChromatogram.h:114
String method_
Peak picker method.
Definition: PeakPickerChromatogram.h:136
double signal_to_noise_
Signal to noise threshold.
Definition: PeakPickerChromatogram.h:127
double gauss_width_
Width of the Gaussian smoothing.
Definition: PeakPickerChromatogram.h:118
void pickChromatogram(const MSChromatogram &chromatogram, MSChromatogram &picked_chrom, MSChromatogram &smoothed_chrom)
Finds peaks in a single chromatogram and annotates left/right borders.
bool use_gauss_
Whether to use Gaussian smoothing.
Definition: PeakPickerChromatogram.h:120
std::vector< double > integrated_intensities_
Temporary vector to hold the integrated intensities.
Definition: PeakPickerChromatogram.h:139
Size findClosestPeak_(const MSChromatogram &chromatogram, double target_rt, Size current_peak=0)
Helper function to find the closest peak in a chromatogram to "target_rt".
bool write_sn_log_messages_
Whether to write out log messages of the SN estimator.
Definition: PeakPickerChromatogram.h:134
void integratePeaks_(const MSChromatogram &chromatogram)
Compute peak area (peak integration)
void pickChromatogram_(const MSChromatogram &chromatogram, MSChromatogram &picked_chrom)
void pickChromatogramCrawdad_(const MSChromatogram &chromatogram, MSChromatogram &picked_chrom)
double peak_width_
Forced peak with.
Definition: PeakPickerChromatogram.h:125
bool remove_overlapping_
Whether to resolve overlapping peaks.
Definition: PeakPickerChromatogram.h:122
SignalToNoiseEstimatorMedian< MSChromatogram > snt_
Definition: PeakPickerChromatogram.h:148
FLOATINDICES
indices into FloatDataArrays of resulting picked chromatograms
Definition: PeakPickerChromatogram.h:57
void updateMembers_() override
Synchronize members with param class.
UInt sgolay_polynomial_order_
Polynomial order for the SGolay smoothing.
Definition: PeakPickerChromatogram.h:116
UInt sn_bin_count_
Signal to noise bin count.
Definition: PeakPickerChromatogram.h:132
PeakPickerChromatogram & operator=(const PeakPickerChromatogram &rhs)
Assignment operator is protected for algorithm.
std::vector< int > left_width_
Temporary vector to hold the peak left widths.
Definition: PeakPickerChromatogram.h:141
PeakPickerHiRes pp_
Definition: PeakPickerChromatogram.h:145
~PeakPickerChromatogram() override
Destructor.
Definition: PeakPickerChromatogram.h:53
SavitzkyGolayFilter sgolay_
Definition: PeakPickerChromatogram.h:146
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:58
Computes the Savitzky-Golay filter coefficients using QR decomposition.
Definition: SavitzkyGolayFilter.h:78
Estimates the signal/noise (S/N) ratio of each data point in a scan by using the median (histogram ba...
Definition: SignalToNoiseEstimatorMedian.h:57
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19