OpenMS
Loading...
Searching...
No Matches
ThresholdMower.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: Mathias Walzer $
6// $Authors: Timo Sachsenberg $
7// --------------------------------------------------------------------------
8//
9#pragma once
10
15
16namespace OpenMS
17{
25 class OPENMS_DLLAPI ThresholdMower :
27 {
28public:
29
30 // @name Constructors and Destructors
31 // @{
35 ~ThresholdMower() override;
36
41 // @}
42
43 // @name Accessors
44 // @{
46
48 template <typename SpectrumType>
50 {
51 threshold_ = ((double)param_.getValue("threshold"));
52 std::vector<Size> indices;
53 for (Size i = 0; i != spectrum.size(); ++i)
54 {
55 if (spectrum[i].getIntensity() >= threshold_)
56 {
57 indices.push_back(i);
58 }
59 }
60 spectrum.select(indices);
61 }
62
64
66
67 //TODO reimplement DefaultParamHandler::updateMembers_()
68
69private:
70 double threshold_;
71
72 // @}
73 };
74
75}
76
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
MSSpectrum & select(const std::vector< Size > &indices)
Removes all peaks below an intensity threshold.
Definition ThresholdMower.h:27
~ThresholdMower() override
destructor
ThresholdMower(const ThresholdMower &source)
copy constructor
ThresholdMower & operator=(const ThresholdMower &source)
assignment operator
void filterPeakSpectrum(PeakSpectrum &spectrum)
void filterPeakMap(PeakMap &exp)
ThresholdMower()
default constructor
void filterSpectrum(SpectrumType &spectrum)
Definition ThresholdMower.h:49
double threshold_
Definition ThresholdMower.h:70
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