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

#include <morpheusscore.h>

Public Member Functions

 MorpheusScore (const MassSpectrum &spectrum, pappso::PeptideSp peptideSp, unsigned int parent_charge, PrecisionPtr precision, std::vector< Enums::PeptideIon > ion_list, RawFragmentationMode fragmentation_mode)
 ~MorpheusScore ()
pappso::pappso_double getMorpheusScore () const

Private Attributes

pappso::pappso_double _morpheus_score

Detailed Description

Definition at line 40 of file morpheusscore.h.

Constructor & Destructor Documentation

◆ MorpheusScore()

pappso::MorpheusScore::MorpheusScore ( const MassSpectrum & spectrum,
pappso::PeptideSp peptideSp,
unsigned int parent_charge,
PrecisionPtr precision,
std::vector< Enums::PeptideIon > ion_list,
RawFragmentationMode fragmentation_mode )

Definition at line 39 of file morpheusscore.cpp.

45{
46 qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
47 PeptideRawFragmentMasses calc_mass_list_proline(*peptide_sp.get(), fragmentation_mode);
48
49 std::vector<pappso_double> ion_products;
50 unsigned int charge = parent_charge;
51 while(charge > 0)
52 {
53 for(Enums::PeptideIon &ion : ion_list)
54 {
55 calc_mass_list_proline.pushBackIonMz(ion_products, ion, charge);
56 }
57 charge--;
58 }
59
60
61 // compute the number of matched peaks
62 unsigned int number_of_matched_peaks = 0;
63
64 std::sort(ion_products.begin(), ion_products.end());
65
66
67 // compute ratio of matched peaks on total peaks
68 std::vector<pappso_double>::const_iterator it_theoretical = ion_products.begin();
69 std::vector<pappso_double>::const_iterator it_theoretical_end = ion_products.end();
70 std::vector<DataPoint>::const_iterator it_spectrum = spectrum.begin();
71 std::vector<DataPoint>::const_iterator it_spectrum_end = spectrum.end();
72 pappso::pappso_double sum_intensities = 0;
73 pappso::pappso_double sum_matched_intensities = 0;
74 // unsigned int peak_number = spectrum.size();
75 while((it_spectrum != it_spectrum_end) && (it_theoretical != it_theoretical_end))
76 {
77 sum_intensities += it_spectrum->y;
78 MzRange peak_range(it_spectrum->x, precision);
79
80 while((it_theoretical != it_theoretical_end) && (*it_theoretical < peak_range.lower()))
81 {
82 it_theoretical++;
83 }
84 while((it_theoretical != it_theoretical_end) && peak_range.contains(*it_theoretical))
85 {
86 sum_matched_intensities += it_spectrum->y;
87 number_of_matched_peaks++;
88 it_theoretical++;
89 }
90 it_spectrum++;
91 }
92 while(it_spectrum != it_spectrum_end)
93 {
94 sum_intensities += it_spectrum->y;
95 it_spectrum++;
96 }
97
98
99 // compute the sum of matching peak intensities
100
101 // morpheus score = number of matched peaks + matching intensities ratio
102
104 (pappso_double)number_of_matched_peaks + (sum_matched_intensities / sum_intensities);
105
106 qDebug() << __FILE__ << " " << __FUNCTION__ << " " << __LINE__;
107}
pappso::pappso_double _morpheus_score
PeptideIon
Enums::PeptideIon enum defines all types of ions (Nter or Cter).
Definition types.h:286
double pappso_double
A type definition for doubles.
Definition types.h:60

References _morpheus_score, pappso::MzRange::contains(), pappso::MzRange::lower(), and pappso::PeptideRawFragmentMasses::pushBackIonMz().

◆ ~MorpheusScore()

pappso::MorpheusScore::~MorpheusScore ( )

Definition at line 109 of file morpheusscore.cpp.

110{
111}

Member Function Documentation

◆ getMorpheusScore()

pappso::pappso_double pappso::MorpheusScore::getMorpheusScore ( ) const

Definition at line 114 of file morpheusscore.cpp.

115{
116 return _morpheus_score;
117}

References _morpheus_score.

Member Data Documentation

◆ _morpheus_score

pappso::pappso_double pappso::MorpheusScore::_morpheus_score
private

Definition at line 54 of file morpheusscore.h.

Referenced by MorpheusScore(), and getMorpheusScore().


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