| OpenMS 2.5.0

PeakPickerHiRes.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2020.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Author: Erhan Kenar $
32 // $Maintainer: Timo Sachsenberg $
33 // --------------------------------------------------------------------------
34
35 #pragma once
36
37 #include <OpenMS/KERNEL/MSExperiment.h>
38
39 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
40 #include <OpenMS/CONCEPT/ProgressLogger.h>
41
42 #define DEBUG_PEAK_PICKING
43 #undef DEBUG_PEAK_PICKING
44 //#undef DEBUG_DECONV
45 namespace OpenMS
46 {
47 class MSChromatogram;
48 class OnDiscMSExperiment;
49
73 class OPENMS_DLLAPI PeakPickerHiRes :
74 public DefaultParamHandler,
75 public ProgressLogger
76 {
77 public:
79 PeakPickerHiRes();
80
82 ~PeakPickerHiRes() override;
83
85 struct PeakBoundary
86 {
87 double mz_min;
88 double mz_max;
89 };
90
99 void pick(const MSSpectrum& input, MSSpectrum& output) const;
100
108 void pick(const MSChromatogram& input, MSChromatogram& output) const;
109
120 void pick(const MSSpectrum& input, MSSpectrum& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = true) const;
121
130 void pick(const MSChromatogram& input, MSChromatogram& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = false) const;
131
141 void pickExperiment(const PeakMap& input, PeakMap& output, const bool check_spectrum_type = true) const;
142
154 void pickExperiment(const PeakMap& input,
155 PeakMap& output,
156 std::vector<std::vector<PeakBoundary> >& boundaries_spec,
157 std::vector<std::vector<PeakBoundary> >& boundaries_chrom,
158 const bool check_spectrum_type = true) const;
159
167 void pickExperiment(/* const */ OnDiscMSExperiment& input, PeakMap& output, const bool check_spectrum_type = true) const;
168
169 protected:
170
171 template <typename ContainerType>
172 void pick_(const ContainerType& input, ContainerType& output, std::vector<PeakBoundary>& boundaries, bool check_spacings = true) const;
173
174 // signal-to-noise parameter
175 double signal_to_noise_;
176
177 // maximal spacing difference defining a large gap
178 double spacing_difference_gap_;
179
180 // maximal spacing difference defining a missing data point
181 double spacing_difference_;
182
183 // maximum number of missing points
184 unsigned missing_;
185
186 // MS levels to which peak picking is applied
187 std::vector<Int> ms_levels_;
188
190 bool report_FWHM_;
191
193 bool report_FWHM_as_ppm_;
194
195 // docu in base class
196 void updateMembers_() override;
197
198 }; // end PeakPickerHiRes
199
200 } // namespace OpenMS
201
OpenMS::PeakPickerHiRes::ms_levels_
std::vector< Int > ms_levels_
Definition: PeakPickerHiRes.h:187
OpenMS::OnDiscMSExperiment
Representation of a mass spectrometry experiment on disk.
Definition: OnDiscMSExperiment.h:68
OpenMS::PeakPickerHiRes::PeakBoundary::mz_min
double mz_min
Definition: PeakPickerHiRes.h:87
OpenMS::PeakPickerHiRes::PeakBoundary
structure for peak boundaries
Definition: PeakPickerHiRes.h:85
OpenMS::MSChromatogram
The representation of a chromatogram.
Definition: MSChromatogram.h:54
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
OpenMS::PeakPickerHiRes::signal_to_noise_
double signal_to_noise_
Definition: PeakPickerHiRes.h:175
OpenMS::PeakPickerHiRes::spacing_difference_
double spacing_difference_
Definition: PeakPickerHiRes.h:181
OpenMS::MSExperiment
In-Memory representation of a mass spectrometry experiment.
Definition: MSExperiment.h:77
OpenMS::PeakPickerHiRes::report_FWHM_
bool report_FWHM_
add floatDataArray &#39;FWHM&#39;/&#39;FWHM_ppm&#39; to spectra with peak FWHM
Definition: PeakPickerHiRes.h:190
OpenMS::PeakPickerHiRes
This class implements a fast peak-picking algorithm best suited for high resolution MS data (FT-ICR-M...
Definition: PeakPickerHiRes.h:73
OpenMS::PeakPickerHiRes::spacing_difference_gap_
double spacing_difference_gap_
Definition: PeakPickerHiRes.h:178
OpenMS::PeakPickerHiRes::PeakBoundary::mz_max
double mz_max
Definition: PeakPickerHiRes.h:88
OpenMS::MSSpectrum
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
OpenMS::PeakPickerHiRes::report_FWHM_as_ppm_
bool report_FWHM_as_ppm_
unit of &#39;FWHM&#39; float data array (can be absolute or ppm).
Definition: PeakPickerHiRes.h:193
ProgressLogger.h
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
MSExperiment.h
OpenMS::ProgressLogger
Base class for all classes that want to report their progress.
Definition: ProgressLogger.h:54
DefaultParamHandler.h
OpenMS::PeakPickerHiRes::missing_
unsigned missing_
Definition: PeakPickerHiRes.h:184