libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
filterchargedeconvolution.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/filters/filterchargedeconvolution.h
3
* \date 30/09/2020
4
* \author Thomas Renne
5
* \brief Sum peaks and transform mz to fit charge = 1
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 "
filternameinterface.h
"
31
32
#include "
../../trace/trace.h
"
33
34
/**
35
* @brief tries to keep as much as possible monoisotopes, removing any possible
36
* C13 peaks and changes multicharge peaks to monocharge
37
*/
38
39
namespace
pappso
40
{
41
42
class
PMSPP_LIB_DECL
FilterChargeDeconvolution
:
public
FilterNameInterface
43
{
44
private
:
45
struct
DataPointInfo
;
46
typedef
std::shared_ptr<DataPointInfo>
DataPointInfoSp
;
47
struct
DataPointInfo
48
{
49
// peak charge
50
int
z_charge
= -1;
51
// datapoint get from the raw data
52
DataPoint
data_point
;
53
// new data point with new intensity and mz
54
DataPoint
new_mono_charge_data_point
;
55
// range of mass possible for z1 peak (~1mz)
56
std::pair<double, double>
z1_range
;
57
// range of mass possible for z2 peak (~0.5mz)
58
std::pair<double, double>
z2_range
;
59
// datapointInfo where the mass is in the range
60
std::weak_ptr<DataPointInfo>
parent
;
61
// list of datapointinfo with 1mz diff multiple
62
std::vector<std::weak_ptr<DataPointInfo>>
z1_vect
;
63
// list of datapointinfo with 2mz diff multiple
64
std::vector<std::weak_ptr<DataPointInfo>>
z2_vect
;
65
};
66
67
public
:
68
/**
69
* Default constructor
70
*/
71
FilterChargeDeconvolution
(
PrecisionPtr
precision_ptr);
72
73
74
/**
75
* @param strBuildParams string to build the filter
76
* "chargeDeconvolution|0.02dalton"
77
*/
78
FilterChargeDeconvolution
(
const
QString &strBuildParams);
79
80
/**
81
* Copy constructor
82
*
83
* @param other TODO
84
*/
85
FilterChargeDeconvolution
(
const
FilterChargeDeconvolution
&other);
86
87
/**
88
* Destructor
89
*/
90
virtual
~FilterChargeDeconvolution
();
91
92
/**
93
* @brief get all the datapoints and remove different isotope and add their
94
* intensity and change to charge = 1 when the charge is known
95
* @return a list of datapoint
96
*/
97
Trace
&
filter
(
Trace
&data_points)
const override
;
98
99
100
virtual
QString
name
()
const override
;
101
QString
toString
()
const override
;
102
103
protected
:
104
void
buildFilterFromString
(
const
QString &strBuildParams)
override
;
105
106
private
:
107
/**
108
* @brief Add each datapoint to a vector of structure describe above
109
* @return the vecotr of datapointInfo with their datapoint and their
110
* exclusion mass range
111
*/
112
void
addDataPointToList
(
113
std::vector<FilterChargeDeconvolution::DataPointInfoSp> &points,
114
DataPoint
&data_point)
const
;
115
/**
116
* @brief For each datapointInfo add the datapoint to the lists by their
117
* exclusion range
118
* @return the vecotr of datapointInfo with their lists of isotopics peaks
119
*/
120
void
addDataPointRefByExclusion
(
121
std::vector<FilterChargeDeconvolution::DataPointInfoSp> &points,
122
FilterChargeDeconvolution::DataPointInfoSp
&new_dpi)
const
;
123
/**
124
* @brief Compare both list (z1 and z2) and add the right level of charge
125
* @return the vecotr of datapointInfo with their charge
126
*/
127
void
computeBestChargeOfDataPoint
(
128
std::vector<FilterChargeDeconvolution::DataPointInfoSp> &data_points_info)
129
const
;
130
/**
131
* @brief For eache datapointInfo whith no parent copy info in new vector with
132
* the intensity of the monoistipics peaks added
133
* @return the vecotr of datapointInfo with their intensity merged
134
*/
135
void
computeIsotopeDeconvolution
(
136
std::vector<FilterChargeDeconvolution::DataPointInfoSp> &data_points_info)
137
const
;
138
/**
139
* @brief For eache datapointInfo with a charge = 2 transform the peak to a
140
* charge = 1 by multiplying the mz by 2 and remove 1 H
141
* @return the vecotr of datapointInfo their z corrected
142
*/
143
void
transformToMonoChargedForAllDataPoint
(
144
std::vector<FilterChargeDeconvolution::DataPointInfoSp> &data_points_info)
145
const
;
146
147
private
:
148
double
m_diffC12C13_z1
;
149
double
m_diffC12C13_z2
;
150
PrecisionPtr
m_precisionPtrZ1
;
151
PrecisionPtr
m_precisionPtrZ2
;
152
};
153
}
// namespace pappso
pappso::FilterChargeDeconvolution::addDataPointRefByExclusion
void addDataPointRefByExclusion(std::vector< FilterChargeDeconvolution::DataPointInfoSp > &points, FilterChargeDeconvolution::DataPointInfoSp &new_dpi) const
For each datapointInfo add the datapoint to the lists by their exclusion range.
Definition
filterchargedeconvolution.cpp:163
pappso::FilterChargeDeconvolution::buildFilterFromString
void buildFilterFromString(const QString &strBuildParams) override
build this filter using a string
Definition
filterchargedeconvolution.cpp:69
pappso::FilterChargeDeconvolution::name
virtual QString name() const override
Definition
filterchargedeconvolution.cpp:98
pappso::FilterChargeDeconvolution::m_diffC12C13_z1
double m_diffC12C13_z1
Definition
filterchargedeconvolution.h:148
pappso::FilterChargeDeconvolution::toString
QString toString() const override
Definition
filterchargedeconvolution.cpp:105
pappso::FilterChargeDeconvolution::DataPointInfoSp
std::shared_ptr< DataPointInfo > DataPointInfoSp
Definition
filterchargedeconvolution.h:46
pappso::FilterChargeDeconvolution::computeBestChargeOfDataPoint
void computeBestChargeOfDataPoint(std::vector< FilterChargeDeconvolution::DataPointInfoSp > &data_points_info) const
Compare both list (z1 and z2) and add the right level of charge.
Definition
filterchargedeconvolution.cpp:217
pappso::FilterChargeDeconvolution::FilterChargeDeconvolution
FilterChargeDeconvolution(PrecisionPtr precision_ptr)
Definition
filterchargedeconvolution.cpp:41
pappso::FilterChargeDeconvolution::m_precisionPtrZ2
PrecisionPtr m_precisionPtrZ2
Definition
filterchargedeconvolution.h:151
pappso::FilterChargeDeconvolution::m_diffC12C13_z2
double m_diffC12C13_z2
Definition
filterchargedeconvolution.h:149
pappso::FilterChargeDeconvolution::transformToMonoChargedForAllDataPoint
void transformToMonoChargedForAllDataPoint(std::vector< FilterChargeDeconvolution::DataPointInfoSp > &data_points_info) const
For eache datapointInfo with a charge = 2 transform the peak to a charge = 1 by multiplying the mz by...
Definition
filterchargedeconvolution.cpp:299
pappso::FilterChargeDeconvolution::addDataPointToList
void addDataPointToList(std::vector< FilterChargeDeconvolution::DataPointInfoSp > &points, DataPoint &data_point) const
Add each datapoint to a vector of structure describe above.
Definition
filterchargedeconvolution.cpp:147
pappso::FilterChargeDeconvolution::m_precisionPtrZ1
PrecisionPtr m_precisionPtrZ1
Definition
filterchargedeconvolution.h:150
pappso::FilterChargeDeconvolution::filter
Trace & filter(Trace &data_points) const override
get all the datapoints and remove different isotope and add their intensity and change to charge = 1 ...
Definition
filterchargedeconvolution.cpp:115
pappso::FilterChargeDeconvolution::computeIsotopeDeconvolution
void computeIsotopeDeconvolution(std::vector< FilterChargeDeconvolution::DataPointInfoSp > &data_points_info) const
For eache datapointInfo whith no parent copy info in new vector with the intensity of the monoistipic...
Definition
filterchargedeconvolution.cpp:259
pappso::FilterNameInterface
Interface that allows to build filter objects from strings.
Definition
filternameinterface.h:42
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.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::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition
precision.h:122
pappso::DataPoint
Definition
datapoint.h:22
pappso::FilterChargeDeconvolution::DataPointInfo
Definition
filterchargedeconvolution.h:48
pappso::FilterChargeDeconvolution::DataPointInfo::parent
std::weak_ptr< DataPointInfo > parent
Definition
filterchargedeconvolution.h:60
pappso::FilterChargeDeconvolution::DataPointInfo::new_mono_charge_data_point
DataPoint new_mono_charge_data_point
Definition
filterchargedeconvolution.h:54
pappso::FilterChargeDeconvolution::DataPointInfo::z1_range
std::pair< double, double > z1_range
Definition
filterchargedeconvolution.h:56
pappso::FilterChargeDeconvolution::DataPointInfo::data_point
DataPoint data_point
Definition
filterchargedeconvolution.h:52
pappso::FilterChargeDeconvolution::DataPointInfo::z2_vect
std::vector< std::weak_ptr< DataPointInfo > > z2_vect
Definition
filterchargedeconvolution.h:64
pappso::FilterChargeDeconvolution::DataPointInfo::z1_vect
std::vector< std::weak_ptr< DataPointInfo > > z1_vect
Definition
filterchargedeconvolution.h:62
pappso::FilterChargeDeconvolution::DataPointInfo::z_charge
int z_charge
Definition
filterchargedeconvolution.h:50
pappso::FilterChargeDeconvolution::DataPointInfo::z2_range
std::pair< double, double > z2_range
Definition
filterchargedeconvolution.h:58
trace.h
pappsomspp
core
processing
filters
filterchargedeconvolution.h
Generated on
for libpappsomspp by
1.17.0