libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
selfspectrumdatapoint.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/specself/selfspectrumdatapoint.h
3
* \date 23/03/2024
4
* \author Olivier Langella
5
* \brief spectrum self data points stored in the self spectrum matrix
6
*/
7
8
/*******************************************************************************
9
* Copyright (c) 2024 Olivier Langella
10
*<Olivier.Langella@universite-paris-saclay.fr>.
11
*
12
* This file is part of PAPPSOms++.
13
*
14
* PAPPSOms++ is free software: you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation, either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* PAPPSOms++ is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
23
*
24
* You should have received a copy of the GNU General Public License
25
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
26
*
27
*/
28
29
#include "
selfspectrumdatapoint.h
"
30
31
32
namespace
pappso
33
{
34
namespace
specself
35
{
36
37
void
38
SelfSpectrumDataPoint::fillSelfSpectrumDataPoint
(
39
const
pappso::AaStringCodeMassMatching
&codec_mass_matching,
40
const
DataPoint
&peak1,
41
const
DataPoint
&peak2)
42
{
43
44
massDelta
= peak1.
x
- peak2.
x
;
45
46
// qDebug() << massDelta;
47
if
(
massDelta
> 0)
48
{
49
aaCodeList
= codec_mass_matching.
getAaCodeFromMass
(
massDelta
);
50
}
51
// m_targetMzSum = m_precursorMass + pappso::MHPLUS + pappso::MHPLUS;
52
// double precusorBion = m_targetMzSum - pappso::MASSH2O - pappso::MPROTIUM;
53
// if peak2 is the other ion suite (Y <=> B)
54
antiMassDelta
= 0;
55
antiAaCodeList
.clear();
56
57
// qDebug();
58
}
59
60
61
void
62
SelfSpectrumDataPoint::fillAntiSpectrumDataPoint
(
63
double
precursor_mass,
64
const
pappso::AaStringCodeMassMatching
&codec_mass_matching,
65
const
DataPoint
&peak1,
66
const
DataPoint
&peak2)
67
{
68
precursor_mass = precursor_mass +
MHPLUS
+
MHPLUS
;
69
antiMassDelta
= (precursor_mass - peak1.
x
) - peak2.
x
;
70
71
m_isComplement
=
false
;
72
if
(std::abs(
antiMassDelta
) < codec_mass_matching.
getPrecisionPtr
()->
getNominal
())
73
{
74
m_isComplement
=
true
;
75
}
76
else
77
{
78
79
if
(
antiMassDelta
> 0)
80
{
81
antiAaCodeList
= codec_mass_matching.
getAaCodeFromMass
(
antiMassDelta
);
82
}
83
}
84
}
85
86
87
void
88
SelfSpectrumDataPoint::setVariableModification
(
89
const
pappso::AaStringCodeMassMatching
&codec_mass_matching,
const
Aa
&aa,
int
quantifier)
90
{
91
92
if
(
massDelta
> 0)
93
{
94
std::vector<uint32_t> new_code_list =
95
codec_mass_matching.
getAaCodeFromMassWearingModification
(
massDelta
, aa, quantifier);
96
std::copy(new_code_list.begin(), new_code_list.end(), std::back_inserter(
aaCodeList
));
97
}
98
if
(
antiMassDelta
> 0)
99
{
100
std::vector<uint32_t> new_code_list =
101
codec_mass_matching.
getAaCodeFromMassWearingModification
(
antiMassDelta
, aa, quantifier);
102
std::copy(new_code_list.begin(), new_code_list.end(), std::back_inserter(
antiAaCodeList
));
103
}
104
}
105
106
}
// namespace specself
107
}
// namespace pappso
pappso::AaStringCodeMassMatching
convert a list of mass to amino acid string codes
Definition
aastringcodemassmatching.h:41
pappso::AaStringCodeMassMatching::getAaCodeFromMass
std::vector< uint32_t > getAaCodeFromMass(double mass) const
get amino acid string code from a single mass delta
Definition
aastringcodemassmatching.cpp:85
pappso::AaStringCodeMassMatching::getPrecisionPtr
PrecisionPtr getPrecisionPtr() const
Definition
aastringcodemassmatching.cpp:78
pappso::AaStringCodeMassMatching::getAaCodeFromMassWearingModification
std::vector< uint32_t > getAaCodeFromMassWearingModification(double mass, const Aa &aa, int quantifier) const
get amino acid string code from a single mass delta wearing a specific modification
Definition
aastringcodemassmatching.cpp:129
pappso::Aa
Definition
aa.h:45
pappso::PrecisionBase::getNominal
virtual pappso_double getNominal() const final
Definition
precision.cpp:73
pappso::specself
Definition
selfspectrum.cpp:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
selfspectrumdatapoint.h
pappso::DataPoint
Definition
datapoint.h:22
pappso::DataPoint::x
pappso_double x
Definition
datapoint.h:24
pappso::specself::SelfSpectrumDataPoint::aaCodeList
std::vector< uint32_t > aaCodeList
Definition
selfspectrumdatapoint.h:59
pappso::specself::SelfSpectrumDataPoint::setVariableModification
void setVariableModification(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Aa &aa, int quantifier)
Definition
selfspectrumdatapoint.cpp:88
pappso::specself::SelfSpectrumDataPoint::fillAntiSpectrumDataPoint
void fillAntiSpectrumDataPoint(double precursor_mass, const pappso::AaStringCodeMassMatching &codec_mass_matching, const DataPoint &peak1, const DataPoint &peak2)
Definition
selfspectrumdatapoint.cpp:62
pappso::specself::SelfSpectrumDataPoint::antiAaCodeList
std::vector< uint32_t > antiAaCodeList
Definition
selfspectrumdatapoint.h:60
pappso::specself::SelfSpectrumDataPoint::m_isComplement
bool m_isComplement
Definition
selfspectrumdatapoint.h:56
pappso::specself::SelfSpectrumDataPoint::antiMassDelta
double antiMassDelta
Definition
selfspectrumdatapoint.h:58
pappso::specself::SelfSpectrumDataPoint::fillSelfSpectrumDataPoint
void fillSelfSpectrumDataPoint(const pappso::AaStringCodeMassMatching &codec_mass_matching, const DataPoint &peak1, const DataPoint &peak2)
Definition
selfspectrumdatapoint.cpp:38
pappso::specself::SelfSpectrumDataPoint::massDelta
double massDelta
Definition
selfspectrumdatapoint.h:57
pappsomspp
core
processing
specself
selfspectrumdatapoint.cpp
Generated on
for libpappsomspp by
1.17.0