libpappsomspp
Library for mass spectrometry
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
30
31
32namespace pappso
33{
34namespace specself
35{
36
37void
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
61void
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) <
73 codec_mass_matching.getPrecisionPtr()->getNominal())
74 {
75 m_isComplement = true;
76 }
77 else
78 {
79
80 if(antiMassDelta > 0)
81 {
82 antiAaCodeList = codec_mass_matching.getAaCodeFromMass(antiMassDelta);
83 }
84 }
85}
86
87
88void
90 const pappso::AaStringCodeMassMatching &codec_mass_matching,
91 const Aa &aa,
92 int quantifier)
93{
94
95 if(massDelta > 0)
96 {
97 std::vector<uint32_t> new_code_list =
98 codec_mass_matching.getAaCodeFromMassWearingModification(
99 massDelta, aa, quantifier);
100 std::copy(new_code_list.begin(),
101 new_code_list.end(),
102 std::back_inserter(aaCodeList));
103 }
104 if(antiMassDelta > 0)
105 {
106 std::vector<uint32_t> new_code_list =
107 codec_mass_matching.getAaCodeFromMassWearingModification(
108 antiMassDelta, aa, quantifier);
109 std::copy(new_code_list.begin(),
110 new_code_list.end(),
111 std::back_inserter(antiAaCodeList));
112 }
113}
114
115} // namespace specself
116} // namespace pappso
convert a list of mass to amino acid string codes
std::vector< uint32_t > getAaCodeFromMass(double mass) const
get amino acid string code from a single mass delta
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
virtual pappso_double getNominal() const final
Definition precision.cpp:65
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
const pappso_double MHPLUS(1.007276466879)
spectrum self data points stored in the self spectrum matrix
pappso_double x
Definition datapoint.h:23
void setVariableModification(const pappso::AaStringCodeMassMatching &codec_mass_matching, const Aa &aa, int quantifier)
void fillAntiSpectrumDataPoint(double precursor_mass, const pappso::AaStringCodeMassMatching &codec_mass_matching, const DataPoint &peak1, const DataPoint &peak2)
void fillSelfSpectrumDataPoint(const pappso::AaStringCodeMassMatching &codec_mass_matching, const DataPoint &peak1, const DataPoint &peak2)