libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
pappso::PeptideRawFragmentMasses Class Reference

#include <peptiderawfragmentmasses.h>

Public Member Functions

 PeptideRawFragmentMasses (const Peptide &peptide, RawFragmentationMode mode)
 
 ~PeptideRawFragmentMasses ()
 
void pushBackIonMasses (std::vector< pappso_double > &mass_list, Enums::PeptideIon ion_type) const
 
void pushBackIonMz (std::vector< pappso_double > &mass_list, Enums::PeptideIon ion_type, unsigned int charge) const
 
void pushBackMatchSpectrum (std::vector< SimplePeakIonMatch > &peak_match_list, const MassSpectrum &spectrum, PrecisionPtr precision, Enums::PeptideIon ion_type, unsigned int charge) const
 

Static Public Member Functions

static pappso_double getDeltaMass (Enums::PeptideIon ion_type)
 

Private Types

using ionDeltatMzMassMap = pappso_double[20]
 

Private Attributes

std::vector< pappso_doublem_cumulativeNterMasses
 cumulative Nter masses (without internal Nter modification)
 
std::vector< pappso_doublem_cumulativeCterMasses
 cumulative Cter masses (without internal Cter modification)
 

Static Private Attributes

static ionDeltatMzMassMap m_ionDeltaMz
 

Detailed Description

Definition at line 59 of file peptiderawfragmentmasses.h.

Member Typedef Documentation

◆ ionDeltatMzMassMap

Constructor & Destructor Documentation

◆ PeptideRawFragmentMasses()

pappso::PeptideRawFragmentMasses::PeptideRawFragmentMasses ( const Peptide & peptide,
RawFragmentationMode mode )

Definition at line 62 of file peptiderawfragmentmasses.cpp.

64{
65
66 qDebug() ;
67 std::vector<Aa>::const_iterator it(peptide.begin());
68 std::vector<Aa>::const_iterator end(peptide.end());
69 if(it == end)
70 return;
71
72 pappso_double nter_internal =
73 peptide.getCleavageNterModification()->getMass();
74 pappso_double cter_internal =
75 peptide.getCleavageCterModification()->getMass();
76 qDebug() ;
77 pappso_double cumulative_mass = it->getMass();
78 if (peptide.getNterModification() != nullptr) {
79 cumulative_mass += peptide.getNterModification()->getMass();
80 }
81 qDebug() ;
82 m_cumulativeNterMasses.push_back(cumulative_mass);
83 it++;
84
85 if(it != end)
86 {
87 end--;
88 qDebug() ;
89 while(it != end)
90 {
91
92 qDebug()
93 << " cumulative_mass=" << cumulative_mass;
94 cumulative_mass += it->getMass();
96 (it->getLetter() == 'P'))
97 {
98 }
99 else
100 {
101 m_cumulativeNterMasses.push_back(cumulative_mass);
102 }
103 it++;
104 }
105 }
106
107 qDebug() ;
108 std::vector<Aa>::const_reverse_iterator rit(peptide.rbegin());
109 std::vector<Aa>::const_reverse_iterator ritf(peptide.rbegin());
110 std::vector<Aa>::const_reverse_iterator rend(peptide.rend());
111 ritf++;
112 cumulative_mass = rit->getMass();
113 if (peptide.getCterModification() != nullptr) {
114 cumulative_mass += peptide.getCterModification()->getMass();
115 }
116 if((mode == RawFragmentationMode::proline_effect) && (ritf != rend) &&
117 (ritf->getLetter() == 'P'))
118 {
119 }
120 else
121 {
122 m_cumulativeCterMasses.push_back(cumulative_mass);
123 }
124 qDebug() ;
125
126 rit++;
127 ritf++;
128 if(rit != rend)
129 {
130 rend--;
131 while(rit != rend)
132 {
133 cumulative_mass += rit->getMass();
135 (ritf != peptide.rend()) && (ritf->getLetter() == 'P'))
136 {
137 }
138 else
139 {
140 m_cumulativeCterMasses.push_back(cumulative_mass);
141 }
142 rit++;
143 ritf++;
144 }
145 }
146
147 qDebug() ;
148}
std::vector< pappso_double > m_cumulativeCterMasses
cumulative Cter masses (without internal Cter modification)
std::vector< pappso_double > m_cumulativeNterMasses
cumulative Nter masses (without internal Nter modification)
double pappso_double
A type definition for doubles.
Definition types.h:61

References pappso::Peptide::begin(), pappso::Peptide::end(), pappso::Peptide::getCleavageCterModification(), pappso::Peptide::getCleavageNterModification(), pappso::Peptide::getCterModification(), pappso::AaModification::getMass(), pappso::Peptide::getNterModification(), m_cumulativeCterMasses, m_cumulativeNterMasses, pappso::proline_effect, pappso::Peptide::rbegin(), and pappso::Peptide::rend().

◆ ~PeptideRawFragmentMasses()

pappso::PeptideRawFragmentMasses::~PeptideRawFragmentMasses ( )

Definition at line 231 of file peptiderawfragmentmasses.cpp.

232{
233}

Member Function Documentation

◆ getDeltaMass()

pappso_double pappso::PeptideRawFragmentMasses::getDeltaMass ( Enums::PeptideIon ion_type)
static

◆ pushBackIonMasses()

void pappso::PeptideRawFragmentMasses::pushBackIonMasses ( std::vector< pappso_double > & mass_list,
Enums::PeptideIon ion_type ) const

Definition at line 151 of file peptiderawfragmentmasses.cpp.

153{
154 const std::vector<pappso_double> *p_mass_list = &m_cumulativeCterMasses;
155
156 if(peptideIonIsNter(ion_type))
157 {
158 // nter
159 p_mass_list = &m_cumulativeNterMasses;
160 }
161
162 for(pappso_double mass : *p_mass_list)
163 {
164 mass_list.push_back(mass + m_ionDeltaMz[(std::int8_t)ion_type]);
165 }
166}
bool peptideIonIsNter(Enums::PeptideIon ion_type)
tells if an ion is Nter
Definition peptide.cpp:85

References m_cumulativeCterMasses, m_cumulativeNterMasses, m_ionDeltaMz, and pappso::peptideIonIsNter().

◆ pushBackIonMz()

void pappso::PeptideRawFragmentMasses::pushBackIonMz ( std::vector< pappso_double > & mass_list,
Enums::PeptideIon ion_type,
unsigned int charge ) const

Definition at line 169 of file peptiderawfragmentmasses.cpp.

172{
173 const std::vector<pappso_double> *p_mass_list = &m_cumulativeCterMasses;
174
175 if(peptideIonIsNter(ion_type))
176 {
177 // nter
178 p_mass_list = &m_cumulativeNterMasses;
179 }
180
181 for(pappso_double mass : *p_mass_list)
182 {
183 mass_list.push_back(
184 (mass + m_ionDeltaMz[(std::int8_t)ion_type] + (MHPLUS * charge)) /
185 charge);
186 }
187}
const pappso_double MHPLUS(1.007276466879)

References m_cumulativeCterMasses, m_cumulativeNterMasses, m_ionDeltaMz, pappso::MHPLUS(), and pappso::peptideIonIsNter().

Referenced by pappso::MorpheusScore::MorpheusScore(), and pushBackMatchSpectrum().

◆ pushBackMatchSpectrum()

void pappso::PeptideRawFragmentMasses::pushBackMatchSpectrum ( std::vector< SimplePeakIonMatch > & peak_match_list,
const MassSpectrum & spectrum,
PrecisionPtr precision,
Enums::PeptideIon ion_type,
unsigned int charge ) const

Definition at line 190 of file peptiderawfragmentmasses.cpp.

196{
197 std::vector<pappso_double> mass_list;
198 pushBackIonMz(mass_list, ion_type, charge);
199
200 // no need to sort
201 // std::sort(mass_list.begin(), mass_list.end());
202
203 std::vector<pappso_double>::iterator it_mz = mass_list.begin();
204 std::vector<pappso_double>::iterator it_mz_end = mass_list.end();
205
206 // scan products over each peak in spectrum :
207 std::vector<DataPoint>::const_iterator it_peak = spectrum.begin();
208 std::vector<DataPoint>::const_iterator it_peak_end = spectrum.end();
209 unsigned int ion_size = 1;
210 while((it_peak != it_peak_end) && (it_mz != it_mz_end))
211 {
212 MzRange massrange(it_peak->x, precision);
213 if((*it_mz) > massrange.upper())
214 {
215 it_peak++;
216 continue;
217 }
218 if((*it_mz) < massrange.lower())
219 {
220 it_mz++;
221 ion_size++;
222 continue;
223 }
224 peak_match_list.push_back(
225 {(*it_peak), ion_type, ion_size, charge, (*it_mz)});
226 it_mz++;
227 ion_size++;
228 }
229}
void pushBackIonMz(std::vector< pappso_double > &mass_list, Enums::PeptideIon ion_type, unsigned int charge) const

References pappso::MzRange::lower(), pushBackIonMz(), and pappso::MzRange::upper().

Referenced by pappso::XtandemHyperscoreBis::computeXtandemHyperscore().

Member Data Documentation

◆ m_cumulativeCterMasses

std::vector<pappso_double> pappso::PeptideRawFragmentMasses::m_cumulativeCterMasses
private

cumulative Cter masses (without internal Cter modification)

Definition at line 72 of file peptiderawfragmentmasses.h.

Referenced by PeptideRawFragmentMasses(), pushBackIonMasses(), and pushBackIonMz().

◆ m_cumulativeNterMasses

std::vector<pappso_double> pappso::PeptideRawFragmentMasses::m_cumulativeNterMasses
private

cumulative Nter masses (without internal Nter modification)

Definition at line 68 of file peptiderawfragmentmasses.h.

Referenced by PeptideRawFragmentMasses(), pushBackIonMasses(), and pushBackIonMz().

◆ m_ionDeltaMz

PeptideRawFragmentMasses::ionDeltatMzMassMap pappso::PeptideRawFragmentMasses::m_ionDeltaMz
staticprivate
Initial value:
= {
[(std::int8_t)Enums::PeptideIon::b] = 0,
[(std::int8_t)Enums::PeptideIon::bstar] = -MASSNH3,
[(std::int8_t)Enums::PeptideIon::bo] = -MASSH2O,
[(std::int8_t)Enums::PeptideIon::a] = -MASSCO,
[(std::int8_t)Enums::PeptideIon::ao] = -MASSCO - MASSH2O,
[(std::int8_t)Enums::PeptideIon::bp] = -1,
[(std::int8_t)Enums::PeptideIon::c] = MASSNH3,
[(std::int8_t)Enums::PeptideIon::y] = MASSH2O,
[(std::int8_t)Enums::PeptideIon::yo] = 0,
[(std::int8_t)Enums::PeptideIon::yp] = -1,
@ a
Nter aldimine ions.
Definition types.h:290
@ y
Cter amino ions.
Definition types.h:295
@ c
Nter amino ions.
Definition types.h:294
@ astar
Nter aldimine ions + NH3 loss.
Definition types.h:291
@ ystar
Cter amino ions + NH3 loss.
Definition types.h:296
@ yo
Cter amino ions + H2O loss.
Definition types.h:297
@ bstar
Nter acylium ions + NH3 loss.
Definition types.h:288
@ b
Nter acylium ions.
Definition types.h:287
@ x
Cter acylium ions.
Definition types.h:300
@ bo
Nter acylium ions + H2O loss.
Definition types.h:289
@ ao
Nter aldimine ions + H2O loss.
Definition types.h:292
@ z
Cter carbocations.
Definition types.h:298
const pappso_double MASSCO(MASSCARBON+MASSOXYGEN)
const pappso_double MPROTIUM(1.007825032241)
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
const pappso_double MASSNH3((MPROTIUM *3)+MASSNITROGEN)
const pappso_double MASSNITROGEN(14.0030740048)
const pappso_double MASSOXYGEN(15.99491461956)

Definition at line 64 of file peptiderawfragmentmasses.h.

Referenced by getDeltaMass(), pushBackIonMasses(), and pushBackIonMz().


The documentation for this class was generated from the following files: