libpappsomspp
Library for mass spectrometry
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, PeptideIon ion_type) const
 
void pushBackIonMz (std::vector< pappso_double > &mass_list, PeptideIon ion_type, unsigned int charge) const
 
void pushBackMatchSpectrum (std::vector< SimplePeakIonMatch > &peak_match_list, const MassSpectrum &spectrum, PrecisionPtr precision, PeptideIon ion_type, unsigned int charge) const
 

Static Public Member Functions

static pappso_double getDeltaMass (PeptideIon ion_type)
 

Private Types

using ionDeltatMzMassMap = pappso_double[20]
 

Private Attributes

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

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

References pappso::Peptide::begin(), pappso::Peptide::end(), pappso::Peptide::getInternalCterModification(), pappso::Peptide::getInternalNterModification(), pappso::AaModification::getMass(), m_cumulativeCterMasses, m_cumulativeNterMasses, pappso::proline_effect, pappso::Peptide::rbegin(), and pappso::Peptide::rend().

◆ ~PeptideRawFragmentMasses()

pappso::PeptideRawFragmentMasses::~PeptideRawFragmentMasses ( )

Definition at line 225 of file peptiderawfragmentmasses.cpp.

226 {
227 }

Member Function Documentation

◆ getDeltaMass()

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

Definition at line 56 of file peptiderawfragmentmasses.cpp.

57 {
58  return m_ionDeltaMz[(std::int8_t)ion_type];
59 }
static ionDeltatMzMassMap m_ionDeltaMz

References m_ionDeltaMz.

Referenced by pappso::PeptideFragmentIon::PeptideFragmentIon().

◆ pushBackIonMasses()

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

Definition at line 145 of file peptiderawfragmentmasses.cpp.

147 {
148  const std::vector<pappso_double> *p_mass_list = &m_cumulativeCterMasses;
149 
150  if(peptideIonIsNter(ion_type))
151  {
152  // nter
153  p_mass_list = &m_cumulativeNterMasses;
154  }
155 
156  for(pappso_double mass : *p_mass_list)
157  {
158  mass_list.push_back(mass + m_ionDeltaMz[(std::int8_t)ion_type]);
159  }
160 }
bool peptideIonIsNter(PeptideIon ion_type)
tells if an ion is Nter
Definition: peptide.cpp:60

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

◆ pushBackIonMz()

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

Definition at line 163 of file peptiderawfragmentmasses.cpp.

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

Definition at line 184 of file peptiderawfragmentmasses.cpp.

190 {
191  std::vector<pappso_double> mass_list;
192  pushBackIonMz(mass_list, ion_type, charge);
193 
194  // no need to sort
195  // std::sort(mass_list.begin(), mass_list.end());
196 
197  std::vector<pappso_double>::iterator it_mz = mass_list.begin();
198  std::vector<pappso_double>::iterator it_mz_end = mass_list.end();
199 
200  // scan products over each peak in spectrum :
201  std::vector<DataPoint>::const_iterator it_peak = spectrum.begin();
202  std::vector<DataPoint>::const_iterator it_peak_end = spectrum.end();
203  unsigned int ion_size = 1;
204  while((it_peak != it_peak_end) && (it_mz != it_mz_end))
205  {
206  MzRange massrange(it_peak->x, precision);
207  if((*it_mz) > massrange.upper())
208  {
209  it_peak++;
210  continue;
211  }
212  if((*it_mz) < massrange.lower())
213  {
214  it_mz++;
215  ion_size++;
216  continue;
217  }
218  peak_match_list.push_back(
219  {(*it_peak), ion_type, ion_size, charge, (*it_mz)});
220  it_mz++;
221  ion_size++;
222  }
223 }
void pushBackIonMz(std::vector< pappso_double > &mass_list, 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)PeptideIon::b] = 0,
[(std::int8_t)PeptideIon::bstar] = -MASSNH3,
[(std::int8_t)PeptideIon::bo] = -MASSH2O,
[(std::int8_t)PeptideIon::a] = -MASSCO,
[(std::int8_t)PeptideIon::astar] = -MASSCO - MASSNH3,
[(std::int8_t)PeptideIon::ao] = -MASSCO - MASSH2O,
[(std::int8_t)PeptideIon::bp] = -1,
[(std::int8_t)PeptideIon::c] = MASSNH3,
[(std::int8_t)PeptideIon::y] = MASSH2O,
[(std::int8_t)PeptideIon::ystar] = MASSH2O - MASSNH3,
[(std::int8_t)PeptideIon::yo] = 0,
[(std::int8_t)PeptideIon::yp] = -1,
[(std::int8_t)PeptideIon::x] = MASSCO + MASSOXYGEN}
@ 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: