libpappsomspp
Library for mass spectrometry
filtercomplementionenhancer.h
Go to the documentation of this file.
1 /**
2  * \file pappsomspp/processing/filters/filtercomplementionenhancer.h
3  * \date 21/08/2020
4  * \author Olivier Langella
5  * \brief enhance ion intensity of ion fragment complement
6  */
7 
8 /*******************************************************************************
9  * Copyright (c) 2020 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 
32 #include "../../trace/trace.h"
33 #include "../../massspectrum/qualifiedmassspectrum.h"
34 #include "filternameinterface.h"
35 
36 
37 namespace pappso
38 {
39 
40 /**
41  * @brief try to detect complementary ions and assign maximum intensity of both
42  * elements
43  *
44  * experimental filter
45  */
47 {
48  public:
49  /**
50  * @param target_mz the targeted mass of the peak pair
51  * @param precision_ptr matching precision
52  */
53  FilterComplementIonEnhancer(double target_mz, PrecisionPtr precision_ptr);
54 
55  /**
56  * @param qmass_spectrum qualified mass spectrum to compute the targeted mass
57  * of the peak pair
58  * @param precision_ptr matching precision
59  */
61  PrecisionPtr precision_ptr);
62 
63 
64  /**
65  * @param strBuildParams string to build the filter
66  * "complementIonEnhancer|456.567;0.02dalton"
67  */
68  FilterComplementIonEnhancer(const QString &strBuildParams);
69 
70  /**
71  * Copy constructor
72  *
73  * @param other TODO
74  */
76 
77  /**
78  * Destructor
79  */
80  virtual ~FilterComplementIonEnhancer();
81 
82  Trace &filter(Trace &data_points) const override;
83 
84  void buildFilterFromString(const QString &strBuildParams) override;
85 
86  QString toString() const override;
87 
88  private:
89  void
90  enhanceComplementMassInRange(double new_intensity,
91  double mz_lower_bound,
92  double mz_upper_bound,
93  std::vector<DataPoint>::iterator it_begin,
94  std::vector<DataPoint>::iterator it_end) const;
95 
96  private:
97  double m_targetMzSum;
99 };
100 
101 } // namespace pappso
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition: exportinmportconfig.h:14
filternameinterface.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition: aa.cpp:39
pappso::FilterComplementIonEnhancer
try to detect complementary ions and assign maximum intensity of both elements
Definition: filtercomplementionenhancer.h:47
pappso::FilterComplementIonEnhancer::m_precisionPtr
PrecisionPtr m_precisionPtr
Definition: filtercomplementionenhancer.h:98
pappso::Trace
A simple container of DataPoint instances.
Definition: trace.h:132
pappso::QualifiedMassSpectrum
Class representing a fully specified mass spectrum.
Definition: qualifiedmassspectrum.h:85
filterinterface.h
pappso::PrecisionBase
Definition: precision.h:44
pappso::FilterNameInterface
Interface that allows to build filter objects from strings.
Definition: filternameinterface.h:42
pappso::FilterComplementIonEnhancer::m_targetMzSum
double m_targetMzSum
Definition: filtercomplementionenhancer.h:97