libpappsomspp
Library for mass spectrometry
pappso::PeptideSpectrumMatch Class Reference

#include <peptidespectrummatch.h>

Public Types

typedef std::list< PeakIonMatch >::const_iterator const_iterator
 

Public Member Functions

 PeptideSpectrumMatch (const MassSpectrum &spectrum, const pappso::PeptideSp &peptideSp, unsigned int parent_charge, PrecisionPtr precision, const std::list< PeptideIon > &ion_type_list)
 
 PeptideSpectrumMatch (const MassSpectrum &spectrum, const PeptideFragmentIonListBase &peptide_fragment_ion_list, unsigned int parent_charge, PrecisionPtr precision, const std::list< PeptideIon > &ion_type_list)
 
 PeptideSpectrumMatch (const MassSpectrum &spectrum, std::vector< PeptideFragmentIonSp > &v_peptide_fragment_ion, std::vector< unsigned int > &v_peptide_fragment_ion_charge, PrecisionPtr precision)
 
 PeptideSpectrumMatch (const PeptideSpectrumMatch &other)
 
 ~PeptideSpectrumMatch ()
 
bool contains (const PeptideFragmentIon *peptideFragmentIonSp, unsigned int z) const
 
unsigned int size () const
 
const_iterator begin () const
 
const_iterator end () const
 
unsigned int countTotalMatchedIons () const
 
const std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > & getIonTypeCountArray () const
 

Private Member Functions

void privMatchIonList (const MassSpectrum &spectrum, const PeptideFragmentIonListBase &fragmentIonList, unsigned int max_charge, const std::list< PeptideIon > &ion_type_list)
 
virtual std::list< DataPoint >::iterator getBestPeakIterator (std::list< DataPoint > &peak_list, const PeptideFragmentIonSp &ion, unsigned int charge) const
 

Private Attributes

PrecisionPtr _precision
 
std::list< PeakIonMatch_peak_ion_match_list
 
std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT_ion_type_count = {{0}}
 

Detailed Description

Definition at line 64 of file peptidespectrummatch.h.

Member Typedef Documentation

◆ const_iterator

Constructor & Destructor Documentation

◆ PeptideSpectrumMatch() [1/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch ( const MassSpectrum spectrum,
const pappso::PeptideSp peptideSp,
unsigned int  parent_charge,
PrecisionPtr  precision,
const std::list< PeptideIon > &  ion_type_list 
)

Definition at line 167 of file peptidespectrummatch.cpp.

172 {
173  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
174  // << " peak_list.size()=" << peak_list.size();
175  std::list<DataPoint>::iterator itpeak = peak_list.begin();
176  std::list<DataPoint>::iterator itend = peak_list.end();
177  std::list<DataPoint>::iterator itselect = peak_list.end();
178 
179  pappso_double best_intensity = 0;
180 

◆ PeptideSpectrumMatch() [2/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch ( const MassSpectrum spectrum,
const PeptideFragmentIonListBase peptide_fragment_ion_list,
unsigned int  parent_charge,
PrecisionPtr  precision,
const std::list< PeptideIon > &  ion_type_list 
)

Definition at line 153 of file peptidespectrummatch.cpp.

153 {
154  PeptideFragmentIonListBase fragmentIonList(peptideSp, ion_type_list);
155  privMatchIonList(spectrum, fragmentIonList, parent_charge, ion_type_list);
156  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
157  << " _ion_type_count[PeptideIon::y]="
158  << _ion_type_count[(std::int8_t)PeptideIon::y];
159 }
160 
161 
163  : _precision(other._precision),
165 {

References pappso::y.

◆ PeptideSpectrumMatch() [3/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch ( const MassSpectrum spectrum,
std::vector< PeptideFragmentIonSp > &  v_peptide_fragment_ion,
std::vector< unsigned int > &  v_peptide_fragment_ion_charge,
PrecisionPtr  precision 
)

Definition at line 107 of file peptidespectrummatch.cpp.

112  {
113  std::list<DataPoint>::iterator it_peak =
114  getBestPeakIterator(peak_list, *ionIt, *chargeIt);
115  if(it_peak != peak_list.end())
116  {
117  _peak_ion_match_list.push_back(
118  PeakIonMatch(*it_peak, *ionIt, *chargeIt));
119  _ion_type_count[(std::int8_t)ionIt->get()->getPeptideIonType()]++;
120  peak_list.erase(it_peak);
121  }
122 
123  ionIt++;
124  chargeIt++;
125  }
126  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
127  << " _ion_type_count[PeptideIon::y]="
128  << _ion_type_count[(std::int8_t)PeptideIon::y];
129 }
130 
131 
133  const MassSpectrum &spectrum,
134  const PeptideFragmentIonListBase &fragmentIonList,
135  unsigned int max_charge,
136  PrecisionPtr precision,
137  const std::list<PeptideIon> &ion_type_list)
138  : _precision(precision)
139 {
140  privMatchIonList(spectrum, fragmentIonList, max_charge, ion_type_list);
141  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__
142  << " _ion_type_count[PeptideIon::y]="
143  << _ion_type_count[(std::int8_t)PeptideIon::y];
144 }
145 
147  const MassSpectrum &spectrum,
148  const pappso::PeptideSp &peptideSp,
149  unsigned int parent_charge,
150  PrecisionPtr precision,

◆ PeptideSpectrumMatch() [4/4]

pappso::PeptideSpectrumMatch::PeptideSpectrumMatch ( const PeptideSpectrumMatch other)

Definition at line 183 of file peptidespectrummatch.cpp.

187  {

◆ ~PeptideSpectrumMatch()

pappso::PeptideSpectrumMatch::~PeptideSpectrumMatch ( )

Definition at line 223 of file peptidespectrummatch.cpp.

226 {

References _ion_type_count.

Member Function Documentation

◆ begin()

PeptideSpectrumMatch::const_iterator pappso::PeptideSpectrumMatch::begin ( ) const

Definition at line 235 of file peptidespectrummatch.cpp.

239 {

◆ contains()

bool pappso::PeptideSpectrumMatch::contains ( const PeptideFragmentIon peptideFragmentIonSp,
unsigned int  z 
) const

Definition at line 258 of file peptidespectrummatch.cpp.

◆ countTotalMatchedIons()

unsigned int pappso::PeptideSpectrumMatch::countTotalMatchedIons ( ) const

Definition at line 246 of file peptidespectrummatch.cpp.

246  {
247  return true;
248  }
249  it++;

◆ end()

PeptideSpectrumMatch::const_iterator pappso::PeptideSpectrumMatch::end ( ) const

Definition at line 240 of file peptidespectrummatch.cpp.

242  {
243  const PeakIonMatch &ref = *it;

References pappso::PeakIonMatch::getCharge(), pappso::PeakIonMatch::getPeptideFragmentIonSp(), and pappso::z.

◆ getBestPeakIterator()

std::list< DataPoint >::iterator pappso::PeptideSpectrumMatch::getBestPeakIterator ( std::list< DataPoint > &  peak_list,
const PeptideFragmentIonSp ion,
unsigned int  charge 
) const
privatevirtual

Definition at line 190 of file peptidespectrummatch.cpp.

191  {
192  best_intensity = itpeak->y;
193  itselect = itpeak;
194  }
195  }
196  itpeak++;
197  }
198 
199  return (itselect);
200 }
201 
203 {
204 }
205 
206 
207 unsigned int
209 {
210  return _peak_ion_match_list.size();
211 }
212 
215 {
216  return _peak_ion_match_list.begin();
217 }
220 {
221  return _peak_ion_match_list.end();

Referenced by privMatchIonList().

◆ getIonTypeCountArray()

const std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > & pappso::PeptideSpectrumMatch::getIonTypeCountArray ( ) const

Definition at line 252 of file peptidespectrummatch.cpp.

◆ privMatchIonList()

void pappso::PeptideSpectrumMatch::privMatchIonList ( const MassSpectrum spectrum,
const PeptideFragmentIonListBase fragmentIonList,
unsigned int  max_charge,
const std::list< PeptideIon > &  ion_type_list 
)
private

Definition at line 66 of file peptidespectrummatch.cpp.

66  {
67  std::list<DataPoint>::iterator it_peak =
68  getBestPeakIterator(peak_list, ion, charge);
69 
70  if(it_peak != peak_list.end())
71  {
72 
73  // qDebug() << __FILE__ << " " << __FUNCTION__ << " " <<
74  // __LINE__
75  // << " peak FOUND";
76  _peak_ion_match_list.push_back(
77  PeakIonMatch(*it_peak, ion, charge));
78  _ion_type_count[(std::int8_t)ion->getPeptideIonType()]++;
79  peak_list.erase(it_peak);
80  }
81  }
82  }
83  }
84 }
85 
87  const MassSpectrum &spectrum,
88  std::vector<PeptideFragmentIonSp> &v_peptide_fragment_ion,
89  std::vector<unsigned int> &v_peptide_fragment_ion_charge,
90  PrecisionPtr precision)
91  : _precision(precision)
92 {
93  qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
94  // throw PappsoException(QObject::tr("v_peptideIsotopeList.size() %1 !=
95  // v_peptideIonList.size()
96  // %2").arg(v_peptideIsotopeList.size()).arg(v_peptideIonList.size()));
97  if(v_peptide_fragment_ion.size() != v_peptide_fragment_ion_charge.size())
98  {
99  throw PappsoException(
100  QObject::tr("v_peptide_fragment_ion.size() != "
101  "v_peptide_fragment_ion_charge.size() %2")
102  .arg(v_peptide_fragment_ion.size())
103  .arg(v_peptide_fragment_ion_charge.size()));
104  }
105 

References _ion_type_count, _peak_ion_match_list, and getBestPeakIterator().

◆ size()

unsigned int pappso::PeptideSpectrumMatch::size ( ) const

Definition at line 229 of file peptidespectrummatch.cpp.

232 {

References _ion_type_count.

Member Data Documentation

◆ _ion_type_count

std::array<unsigned int, PEPTIDE_ION_TYPE_COUNT> pappso::PeptideSpectrumMatch::_ion_type_count = {{0}}
private

Definition at line 138 of file peptidespectrummatch.h.

Referenced by privMatchIonList(), size(), and ~PeptideSpectrumMatch().

◆ _peak_ion_match_list

std::list<PeakIonMatch> pappso::PeptideSpectrumMatch::_peak_ion_match_list
private

Definition at line 136 of file peptidespectrummatch.h.

Referenced by privMatchIonList().

◆ _precision

PrecisionPtr pappso::PeptideSpectrumMatch::_precision
private

Definition at line 134 of file peptidespectrummatch.h.


The documentation for this class was generated from the following files:
pappso::pappso_double
double pappso_double
A type definition for doubles.
Definition: types.h:69
pappso::PeptideSpectrumMatch::end
const_iterator end() const
Definition: peptidespectrummatch.cpp:240
pappso::PeptideSpectrumMatch::size
unsigned int size() const
Definition: peptidespectrummatch.cpp:229
pappso::PeptideSpectrumMatch::_precision
PrecisionPtr _precision
Definition: peptidespectrummatch.h:134
pappso::PeptideSpectrumMatch::const_iterator
std::list< PeakIonMatch >::const_iterator const_iterator
Definition: peptidespectrummatch.h:111
pappso::PeptideSpectrumMatch::privMatchIonList
void privMatchIonList(const MassSpectrum &spectrum, const PeptideFragmentIonListBase &fragmentIonList, unsigned int max_charge, const std::list< PeptideIon > &ion_type_list)
Definition: peptidespectrummatch.cpp:66
pappso::PeptideSpectrumMatch::getBestPeakIterator
virtual std::list< DataPoint >::iterator getBestPeakIterator(std::list< DataPoint > &peak_list, const PeptideFragmentIonSp &ion, unsigned int charge) const
Definition: peptidespectrummatch.cpp:190
pappso::PrecisionPtr
const PrecisionBase * PrecisionPtr
Definition: precision.h:143
pappso::PeptideSpectrumMatch::~PeptideSpectrumMatch
~PeptideSpectrumMatch()
Definition: peptidespectrummatch.cpp:223
pappso::PeptideSpectrumMatch::_peak_ion_match_list
std::list< PeakIonMatch > _peak_ion_match_list
Definition: peptidespectrummatch.h:136
pappso::PeptideSpectrumMatch::begin
const_iterator begin() const
Definition: peptidespectrummatch.cpp:235
pappso::PeptideSpectrumMatch::PeptideSpectrumMatch
PeptideSpectrumMatch(const MassSpectrum &spectrum, const pappso::PeptideSp &peptideSp, unsigned int parent_charge, PrecisionPtr precision, const std::list< PeptideIon > &ion_type_list)
Definition: peptidespectrummatch.cpp:167
pappso::PeptideIon::y
@ y
Cter amino ions.
pappso::PeptideSpectrumMatch::_ion_type_count
std::array< unsigned int, PEPTIDE_ION_TYPE_COUNT > _ion_type_count
Definition: peptidespectrummatch.h:138
pappso::PeptideSp
std::shared_ptr< const Peptide > PeptideSp
Definition: aamodification.h:68