33 #include "../../trace/datapoint.h"
34 #include "../../massspectrum/massspectrum.h"
41 unsigned int parent_charge,
43 std::vector<PeptideIon> ion_list,
46 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
50 std::vector<pappso_double> ion_products;
51 unsigned int charge = parent_charge;
56 calc_mass_list_proline.
pushBackIonMz(ion_products, ion, charge);
63 unsigned int number_of_matched_peaks = 0;
65 std::sort(ion_products.begin(), ion_products.end());
69 std::vector<pappso_double>::const_iterator it_theoretical =
71 std::vector<pappso_double>::const_iterator it_theoretical_end =
73 std::vector<DataPoint>::const_iterator it_spectrum = spectrum.begin();
74 std::vector<DataPoint>::const_iterator it_spectrum_end = spectrum.end();
78 while((it_spectrum != it_spectrum_end) &&
79 (it_theoretical != it_theoretical_end))
81 sum_intensities += it_spectrum->y;
82 MzRange peak_range(it_spectrum->x, precision);
84 while((it_theoretical != it_theoretical_end) &&
85 (*it_theoretical < peak_range.
lower()))
89 while((it_theoretical != it_theoretical_end) &&
90 peak_range.
contains(*it_theoretical))
92 sum_matched_intensities += it_spectrum->y;
93 number_of_matched_peaks++;
98 while(it_spectrum != it_spectrum_end)
100 sum_intensities += it_spectrum->y;
110 (sum_matched_intensities / sum_intensities);
112 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__;
Class to represent a mass spectrum.
pappso::pappso_double _morpheus_score
pappso::pappso_double getMorpheusScore() const
MorpheusScore(const MassSpectrum &spectrum, pappso::PeptideSp peptideSp, unsigned int parent_charge, PrecisionPtr precision, std::vector< PeptideIon > ion_list, RawFragmentationMode fragmentation_mode)
pappso_double lower() const
bool contains(pappso_double) const
void pushBackIonMz(std::vector< pappso_double > &mass_list, PeptideIon ion_type, unsigned int charge) const
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
PeptideIon
PeptideIon enum defines all types of ions (Nter or Cter)
std::shared_ptr< const Peptide > PeptideSp
double pappso_double
A type definition for doubles.