libpappsomspp
Library for mass spectrometry
filterresample.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/filers/filterresample.h
3  * \date 28/04/2019
4  * \author Olivier Langella
5  * \brief collection of filters concerned by X selection
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2019 Olivier Langella <Olivier.Langella@u-psud.fr>.
10  *
11  * This file is part of the PAPPSOms++ library.
12  *
13  * PAPPSOms++ is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation, either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * PAPPSOms++ is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
25  *
26  ******************************************************************************/
27 
28 #pragma once
29 
30 #include "filterinterface.h"
31 #include <cstddef>
32 #include "../../mzrange.h"
33 #include "../../exportinmportconfig.h"
34 #include "../combiners/selectionpolygon.h"
35 
36 namespace pappso
37 {
38 
40 {
41  private:
42  double m_value;
43 
44  public:
45  FilterResampleKeepSmaller(double x_value);
48  Trace &filter(Trace &trace) const override;
49 };
50 
51 
53 {
54  private:
55  double m_value;
56 
57  public:
58  FilterResampleKeepGreater(double x_value);
61 
63  Trace &filter(Trace &trace) const override;
64 
65  double getThresholdX() const;
66 };
67 
68 
70 {
71  private:
72  double m_minX;
73  double m_maxX;
74 
75  public:
76  FilterResampleRemoveXRange(double min_x, double max_x);
79 
81  operator=(const FilterResampleRemoveXRange &other);
82  Trace &filter(Trace &trace) const override;
83 };
84 
85 
87 {
88  private:
89  double m_minX;
90  double m_maxX;
91 
92  public:
93  FilterResampleKeepXRange(double min_x = 0, double max_x = 0);
96 
97  FilterResampleKeepXRange &operator=(const FilterResampleKeepXRange &other);
98 
99  Trace &filter(Trace &trace) const override;
100 };
101 
102 
103 using SelectionPolygonSpecVector = std::vector<SelectionPolygonSpec>;
104 
106 {
107  public:
109 
110  FilterResampleKeepPointInPolygon(const SelectionPolygon &selection_polygon,
111  DataKind data_kind);
112 
114  const SelectionPolygonSpecVector &selection_polygon_specs);
115 
117  const FilterResampleKeepPointInPolygon &other);
118 
120 
121  void
122  newSelectionPolygonSpec(const SelectionPolygonSpec &selection_polygon_spec);
123 
125  operator=(const FilterResampleKeepPointInPolygon &other);
126 
128 
129  Trace &filter(Trace &trace) const override;
130  Trace &filter(Trace &trace, double dt_value, double rt_value) const;
131 
132  private:
133  std::vector<SelectionPolygonSpec> m_selectionPolygonSpecs;
134  double m_lowestMz = std::numeric_limits<double>::max();
135  double m_greatestMz = std::numeric_limits<double>::min();
136 };
137 
138 
141 {
142  private:
144 
145  public:
150  MassSpectrum &filter(MassSpectrum &spectrum) const override;
151 };
152 
153 
156 {
157  private:
159 
160  public:
165  MassSpectrum &filter(MassSpectrum &spectrum) const override;
166 };
167 
168 
169 } // namespace pappso
generic interface to apply a filter on a trace
virtual Trace & filter(Trace &data_points) const =0
std::vector< SelectionPolygonSpec > m_selectionPolygonSpecs
Trace & filter(Trace &trace) const override
generic interface to apply a filter on a MassSpectrum This is the same as FilterInterface,...
const FilterResampleKeepXRange m_filterRange
const FilterResampleRemoveXRange m_filterRange
Class to represent a mass spectrum.
Definition: massspectrum.h:71
A simple container of DataPoint instances.
Definition: trace.h:148
#define PMSPP_LIB_DECL
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
DataKind
Definition: types.h:172
std::vector< SelectionPolygonSpec > SelectionPolygonSpecVector