libpappsomspp
Library for mass spectrometry
Toggle main menu visibility
Loading...
Searching...
No Matches
peptidespectrum.cpp
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/specglob/peptidespectrum.cpp
3
* \date 06/11/2023
4
* \author Olivier Langella
5
* \brief transform a peptide to SpecGlob spectrum
6
*
7
* C++ implementation of the SpecGlob algorithm described in :
8
* 1. Prunier, G. et al. Fast alignment of mass spectra in large proteomics
9
* datasets, capturing dissimilarities arising from multiple complex
10
* modifications of peptides. BMC Bioinformatics 24, 421 (2023).
11
*
12
* HAL Id : hal-04296170 , version 1
13
* Mot de passe : hxo20cl
14
* DOI : 10.1186/s12859-023-05555-y
15
*/
16
17
18
/*
19
* SpecGlobTool, Spectra to peptide alignment tool
20
* Copyright (C) 2023 Olivier Langella
21
* <olivier.langella@universite-paris-saclay.fr>
22
*
23
* This program is free software: you can redistribute it and/or modify
24
* it under the terms of the GNU General Public License as published by
25
* the Free Software Foundation, either version 3 of the License, or
26
* (at your option) any later version.
27
*
28
* This program is distributed in the hope that it will be useful,
29
* but WITHOUT ANY WARRANTY; without even the implied warranty of
30
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31
* GNU General Public License for more details.
32
*
33
* You should have received a copy of the GNU General Public License
34
* along with this program. If not, see <http://www.gnu.org/licenses/>.
35
*
36
*/
37
38
#include "
peptidespectrum.h
"
39
#include "
../../peptide/peptidefragmentionlistbase.h
"
40
#include "
../../peptide/peptiderawfragmentmasses.h
"
41
42
namespace
pappso
43
{
44
namespace
specglob
45
{
46
PeptideSpectrum::PeptideSpectrum
(
const
pappso::PeptideSp
peptide_sp)
47
: std::vector<
PeptideSpectrumDataPoint
>()
48
{
49
50
if
(peptide_sp.get()->size() < 2)
51
{
52
throw pappso::PappsoException(
53
QObject::tr(
"PeptideSpectrum::PeptideSpectrum failed : peptide %1 is too small"
)
54
.arg(peptide_sp.get()->toProForma()));
55
}
56
Enums::PeptideIon
ion_type =
Enums::PeptideIon::b
;
57
msp_peptide
= peptide_sp;
58
std::list<Enums::PeptideIon> ion_list;
59
ion_list.push_back(ion_type);
60
61
62
pappso::PeptideFragmentIonListBase
fragmented_ion_list(
msp_peptide
, ion_list);
63
64
std::list<pappso::PeptideFragmentIonSp> peptide_ion_list =
65
fragmented_ion_list.
getPeptideFragmentIonSp
(
Enums::PeptideIon::b
);
66
67
push_back({
pappso::MHPLUS
, 0});
68
// qDebug() << pappso::PeptideRawFragmentMasses::getDeltaMass(ion_type);
69
for
(
auto
&peptide_ion : peptide_ion_list)
70
{
71
push_back({peptide_ion.get()->getMz(1), 0});
72
}
73
push_back({(
msp_peptide
.get()->getMz(1) -
pappso::MASSH2O
+
74
pappso::PeptideRawFragmentMasses::getDeltaMass
(ion_type)),
75
0});
76
for
(std::size_t i = 1; i < size(); i++)
77
{
78
at(i).diff_mz = (at(i).mz - at(i - 1).mz);
79
}
80
}
81
82
PeptideSpectrum::PeptideSpectrum
(
const
PeptideSpectrum
&other)
83
: std::vector<
PeptideSpectrumDataPoint
>(other)
84
{
85
msp_peptide
= other.
msp_peptide
;
86
}
87
88
PeptideSpectrum::~PeptideSpectrum
()
89
{
90
}
91
92
std::vector<double>
93
PeptideSpectrum::getMassList
()
const
94
{
95
std::vector<double> mass_list;
96
for
(
const
PeptideSpectrumDataPoint
&n : *
this
)
97
{
98
mass_list.push_back(n.
mz
);
99
};
100
101
return
mass_list;
102
}
103
104
pappso::PeptideSp
105
PeptideSpectrum::getPeptideSp
()
const
106
{
107
return
msp_peptide
;
108
}
109
}
// namespace specglob
110
}
// namespace pappso
pappso::PeptideFragmentIonListBase
Definition
peptidefragmentionlistbase.h:45
pappso::PeptideFragmentIonListBase::getPeptideFragmentIonSp
const std::list< PeptideFragmentIonSp > getPeptideFragmentIonSp(Enums::PeptideIon ion_type) const
Definition
peptidefragmentionlistbase.cpp:226
pappso::PeptideRawFragmentMasses::getDeltaMass
static pappso_double getDeltaMass(Enums::PeptideIon ion_type)
Definition
peptiderawfragmentmasses.cpp:55
pappso::specglob::PeptideSpectrum::getPeptideSp
pappso::PeptideSp getPeptideSp() const
Definition
peptidespectrum.cpp:105
pappso::specglob::PeptideSpectrum::getMassList
std::vector< double > getMassList() const
Definition
peptidespectrum.cpp:93
pappso::specglob::PeptideSpectrum::~PeptideSpectrum
virtual ~PeptideSpectrum()
Definition
peptidespectrum.cpp:88
pappso::specglob::PeptideSpectrum::PeptideSpectrum
PeptideSpectrum(const pappso::PeptideSp peptide_sp)
Definition
peptidespectrum.cpp:46
pappso::specglob::PeptideSpectrum::msp_peptide
pappso::PeptideSp msp_peptide
Definition
peptidespectrum.h:87
pappso::Enums::PeptideIon
PeptideIon
Enums::PeptideIon enum defines all types of ions (Nter or Cter).
Definition
types.h:272
pappso::Enums::PeptideIon::b
@ b
Nter acylium ions.
Definition
types.h:273
pappso::specglob
Definition
experimentalspectrum.cpp:44
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition
aamodification.h:48
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
peptidefragmentionlistbase.h
peptiderawfragmentmasses.h
peptidespectrum.h
pappso::specglob::PeptideSpectrumDataPoint
Definition
peptidespectrum.h:49
pappso::specglob::PeptideSpectrumDataPoint::mz
double mz
Definition
peptidespectrum.h:50
pappsomspp
core
processing
specglob
peptidespectrum.cpp
Generated on
for libpappsomspp by
1.17.0