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 80 of file peptiderawfragmentmasses.h.

Member Typedef Documentation

◆ ionDeltatMzMassMap

Constructor & Destructor Documentation

◆ PeptideRawFragmentMasses()

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

Definition at line 83 of file peptiderawfragmentmasses.cpp.

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 }
143 
144 void
146  std::vector<pappso_double> &mass_list, PeptideIon ion_type) const
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 }
161 
162 void
163 PeptideRawFragmentMasses::pushBackIonMz(std::vector<pappso_double> &mass_list,

References m_cumulativeNterMasses, and pappso::proline_effect.

◆ ~PeptideRawFragmentMasses()

pappso::PeptideRawFragmentMasses::~PeptideRawFragmentMasses ( )

Definition at line 246 of file peptiderawfragmentmasses.cpp.

Member Function Documentation

◆ getDeltaMass()

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

Definition at line 77 of file peptiderawfragmentmasses.cpp.

83  {

◆ pushBackIonMasses()

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

Definition at line 166 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 }

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

◆ pushBackIonMz()

void pappso::PeptideRawFragmentMasses::pushBackIonMz ( std::vector< pappso_double > &  mass_list,
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();

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

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 }
224 
226 {
227 }
228 } // namespace pappso

References pappso::MzRange::lower(), 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 93 of file peptiderawfragmentmasses.h.

Referenced by pushBackIonMasses().

◆ m_cumulativeNterMasses

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

cumulative Nter masses (without internal Nter modification)

Definition at line 89 of file peptiderawfragmentmasses.h.

Referenced by PeptideRawFragmentMasses(), and pushBackIonMasses().

◆ 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}

Definition at line 85 of file peptiderawfragmentmasses.h.

Referenced by pushBackIonMasses().


The documentation for this class was generated from the following files:
pappso::PeptideIon::b
@ b
Nter acylium ions.
pappso::PeptideIon::a
@ a
Nter aldimine ions.
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::PeptideRawFragmentMasses::m_ionDeltaMz
static ionDeltatMzMassMap m_ionDeltaMz
Definition: peptiderawfragmentmasses.h:85
pappso::MHPLUS
const pappso_double MHPLUS(1.007276466879)
pappso::PeptideIon::yo
@ yo
Cter amino ions + H2O loss.
pappso::PeptideIon::astar
@ astar
Nter aldimine ions + NH3 loss.
pappso::PeptideRawFragmentMasses::m_cumulativeCterMasses
std::vector< pappso_double > m_cumulativeCterMasses
cumulative Cter masses (without internal Cter modification)
Definition: peptiderawfragmentmasses.h:93
pappso::PeptideRawFragmentMasses::~PeptideRawFragmentMasses
~PeptideRawFragmentMasses()
Definition: peptiderawfragmentmasses.cpp:246
pappso::PeptideIon::x
@ x
Cter acylium ions.
pappso::PeptideIon::bstar
@ bstar
Nter acylium ions + NH3 loss.
pappso::PeptideIon
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
Definition: types.h:355
pappso::MASSNH3
const pappso_double MASSNH3((MPROTIUM *3)+MASSNITROGEN)
pappso::PeptideRawFragmentMasses::pushBackIonMasses
void pushBackIonMasses(std::vector< pappso_double > &mass_list, PeptideIon ion_type) const
Definition: peptiderawfragmentmasses.cpp:166
pappso::MASSCO
const pappso_double MASSCO(MASSCARBON+MASSOXYGEN)
pappso::PeptideIon::bo
@ bo
Nter acylium ions + H2O loss.
pappso::PeptideIon::bp
@ bp
pappso::PeptideRawFragmentMasses::m_cumulativeNterMasses
std::vector< pappso_double > m_cumulativeNterMasses
cumulative Nter masses (without internal Nter modification)
Definition: peptiderawfragmentmasses.h:89
pappso::PeptideIon::z
@ z
Cter carbocations.
pappso::PeptideIon::ao
@ ao
Nter aldimine ions + H2O loss.
pappso::PeptideRawFragmentMasses::pushBackIonMz
void pushBackIonMz(std::vector< pappso_double > &mass_list, PeptideIon ion_type, unsigned int charge) const
Definition: peptiderawfragmentmasses.cpp:184
pappso::peptideIonIsNter
bool peptideIonIsNter(PeptideIon ion_type)
tells if an ion is Nter
Definition: peptide.cpp:65
pappso::PeptideIon::c
@ c
Nter amino ions.
pappso::PeptideIon::yp
@ yp
pappso::MASSH2O
const pappso_double MASSH2O((MPROTIUM *2)+MASSOXYGEN)
pappso::MASSOXYGEN
const pappso_double MASSOXYGEN(15.99491461956)
pappso::PeptideIon::y
@ y
Cter amino ions.
pappso::MPROTIUM
const pappso_double MPROTIUM(1.007825032241)
pappso::MASSNITROGEN
const pappso_double MASSNITROGEN(14.0030740048)
pappso::PeptideIon::ystar
@ ystar
Cter amino ions + NH3 loss.
pappso::RawFragmentationMode::proline_effect
@ proline_effect