OpenMS
PeakPickerMaxima.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: Hannes Roest $
6 // $Authors: Hannes Roest $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/config.h>
12 #include <vector>
13 
14 namespace OpenMS
15 {
16 
40  class OPENMS_DLLAPI PeakPickerMaxima
41  {
42 public:
43 
45  PeakPickerMaxima(double signal_to_noise, double spacing_difference = 1.5,
46  double spacing_difference_gap = 4.0, double sn_window_length = 200,
47  unsigned missing = 2);
48 
50  virtual ~PeakPickerMaxima() {}
51 
60  struct OPENMS_DLLAPI PeakCandidate
61  {
63  int pos;
69  double mz_max;
71  double int_max;
72  };
73 
88  void findMaxima(const std::vector<double>& mz_array,
89  const std::vector<double>& int_array,
90  std::vector<PeakCandidate>& pc,
91  bool check_spacings = true) const;
92 
105  void pick(std::vector<double>& mz_array,
106  std::vector<double>& int_array,
107  std::vector<PeakCandidate>& pc,
108  bool check_spacings = true);
109 
110 protected:
111 
112  // signal-to-noise parameter
114 
115  // signal-to-noise window length
117 
118  // maximal spacing difference defining a missing data point
120 
121  // maximal spacing difference defining a large gap
123 
124  // maximum number of missing points
125  unsigned missing_;
126 
127  }; // end PeakPickerMaxima
128 
129 } // namespace OpenMS
130 
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerMaxima.h:41
double int_max
intensity value of the peak apex
Definition: PeakPickerMaxima.h:71
PeakPickerMaxima(double signal_to_noise, double spacing_difference=1.5, double spacing_difference_gap=4.0, double sn_window_length=200, unsigned missing=2)
Constructor.
int pos
index of the peak apex (relative to the input data)
Definition: PeakPickerMaxima.h:63
unsigned missing_
Definition: PeakPickerMaxima.h:125
double spacing_difference_
Definition: PeakPickerMaxima.h:119
double signal_to_noise_
Definition: PeakPickerMaxima.h:113
double spacing_difference_gap_
Definition: PeakPickerMaxima.h:122
double sn_window_length_
Definition: PeakPickerMaxima.h:116
double mz_max
m/z value of the peak apex
Definition: PeakPickerMaxima.h:69
int right_boundary
index of the right boundary (relative to the input data)
Definition: PeakPickerMaxima.h:67
void findMaxima(const std::vector< double > &mz_array, const std::vector< double > &int_array, std::vector< PeakCandidate > &pc, bool check_spacings=true) const
Will find local maxima in raw data.
void pick(std::vector< double > &mz_array, std::vector< double > &int_array, std::vector< PeakCandidate > &pc, bool check_spacings=true)
Will pick peaks in a spectrum.
virtual ~PeakPickerMaxima()
Destructor.
Definition: PeakPickerMaxima.h:50
int left_boundary
index of the left boundary (relative to the input data)
Definition: PeakPickerMaxima.h:65
The PeakCandidate describes the output of the peak picker.
Definition: PeakPickerMaxima.h:61
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22