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 qDebug() ;
73 pappso_double cumulative_mass = it->getMass();
74 if (peptide.getNterModification() != nullptr) {
75 cumulative_mass += peptide.getNterModification()->getMass();
76 }
77 qDebug() ;
78 m_cumulativeNterMasses.push_back(cumulative_mass);
79 it++;
80
81 if(it != end)
82 {
83 end--;
84 qDebug() ;
85 while(it != end)
86 {
87
88 qDebug()
89 << " cumulative_mass=" << cumulative_mass;
90 cumulative_mass += it->getMass();
92 (it->getLetter() == 'P'))
93 {
94 }
95 else
96 {
97 m_cumulativeNterMasses.push_back(cumulative_mass);
98 }
99 it++;
100 }
101 }
102
103 qDebug() ;
104 std::vector<Aa>::const_reverse_iterator rit(peptide.rbegin());
105 std::vector<Aa>::const_reverse_iterator ritf(peptide.rbegin());
106 std::vector<Aa>::const_reverse_iterator rend(peptide.rend());
107 ritf++;
108 cumulative_mass = rit->getMass();
109 if (peptide.getCterModification() != nullptr) {
110 cumulative_mass += peptide.getCterModification()->getMass();
111 }
112 if((mode == RawFragmentationMode::proline_effect) && (ritf != rend) &&
113 (ritf->getLetter() == 'P'))
114 {
115 }
116 else
117 {
118 m_cumulativeCterMasses.push_back(cumulative_mass);
119 }
120 qDebug() ;
121
122 rit++;
123 ritf++;
124 if(rit != rend)
125 {
126 rend--;
127 while(rit != rend)
128 {
129 cumulative_mass += rit->getMass();
131 (ritf != peptide.rend()) && (ritf->getLetter() == 'P'))
132 {
133 }
134 else
135 {
136 m_cumulativeCterMasses.push_back(cumulative_mass);
137 }
138 rit++;
139 ritf++;
140 }
141 }
142
143 qDebug() ;
144}
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::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 227 of file peptiderawfragmentmasses.cpp.

228{
229}

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 147 of file peptiderawfragmentmasses.cpp.

149{
150 const std::vector<pappso_double> *p_mass_list = &m_cumulativeCterMasses;
151
152 if(peptideIonIsNter(ion_type))
153 {
154 // nter
155 p_mass_list = &m_cumulativeNterMasses;
156 }
157
158 for(pappso_double mass : *p_mass_list)
159 {
160 mass_list.push_back(mass + m_ionDeltaMz[(std::int8_t)ion_type]);
161 }
162}
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 165 of file peptiderawfragmentmasses.cpp.

168{
169 const std::vector<pappso_double> *p_mass_list = &m_cumulativeCterMasses;
170
171 if(peptideIonIsNter(ion_type))
172 {
173 // nter
174 p_mass_list = &m_cumulativeNterMasses;
175 }
176
177 for(pappso_double mass : *p_mass_list)
178 {
179 mass_list.push_back(
180 (mass + m_ionDeltaMz[(std::int8_t)ion_type] + (MHPLUS * charge)) /
181 charge);
182 }
183}
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 186 of file peptiderawfragmentmasses.cpp.

192{
193 std::vector<pappso_double> mass_list;
194 pushBackIonMz(mass_list, ion_type, charge);
195
196 // no need to sort
197 // std::sort(mass_list.begin(), mass_list.end());
198
199 std::vector<pappso_double>::iterator it_mz = mass_list.begin();
200 std::vector<pappso_double>::iterator it_mz_end = mass_list.end();
201
202 // scan products over each peak in spectrum :
203 std::vector<DataPoint>::const_iterator it_peak = spectrum.begin();
204 std::vector<DataPoint>::const_iterator it_peak_end = spectrum.end();
205 unsigned int ion_size = 1;
206 while((it_peak != it_peak_end) && (it_mz != it_mz_end))
207 {
208 MzRange massrange(it_peak->x, precision);
209 if((*it_mz) > massrange.upper())
210 {
211 it_peak++;
212 continue;
213 }
214 if((*it_mz) < massrange.lower())
215 {
216 it_mz++;
217 ion_size++;
218 continue;
219 }
220 peak_match_list.push_back(
221 {(*it_peak), ion_type, ion_size, charge, (*it_mz)});
222 it_mz++;
223 ion_size++;
224 }
225}
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.
@ y
Cter amino ions.
@ c
Nter amino ions.
@ astar
Nter aldimine ions + NH3 loss.
@ ystar
Cter amino ions + NH3 loss.
@ yo
Cter amino ions + H2O loss.
@ bstar
Nter acylium ions + NH3 loss.
@ b
Nter acylium ions.
@ x
Cter acylium ions.
@ bo
Nter acylium ions + H2O loss.
@ ao
Nter aldimine ions + H2O loss.
@ z
Cter carbocations.
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: