53 unsigned int parent_charge,
55 std::list<Enums::PeptideIon> ion_list,
56 bool refine_spectrum_synthesis)
68 unsigned int max_charge = parent_charge;
71 max_charge = parent_charge - 1;
85 std::map<Enums::PeptideIon, unsigned int> ion_count;
86 for(
auto &&ion_type : ion_list)
88 ion_count.insert(std::pair<Enums::PeptideIon, unsigned int>(ion_type, 0));
91 std::map<unsigned int, pappso_double> charge_dot_product;
92 std::map<unsigned int, std::map<Enums::PeptideIon, unsigned int>> charge_ion_count;
93 for(
unsigned int i = 1; i <= max_charge; i++)
95 charge_dot_product.insert(std::pair<unsigned int, pappso_double>(i, 0));
96 charge_ion_count.insert(
97 std::pair<
unsigned int, std::map<Enums::PeptideIon, unsigned int>>(i, ion_count));
99 QString sequence = peptideSp.get()->getSequence();
100 for(
auto &&peptide_ion_match : psm)
103 unsigned int charge = peptide_ion_match.getCharge();
104 charge_dot_product[charge] +=
105 peptide_ion_match.getPeak().y *
108 peptide_ion_match.getPeptideIonDirection(),
109 peptide_ion_match.getPeptideFragmentIonSp().get()->size());
110 charge_ion_count[charge][ion_type] += 1;
114 qDebug() << __FILE__ <<
" " << __FUNCTION__ <<
" " << __LINE__
118 for(
unsigned int i = 1; i <= max_charge; i++)
120 sum_intensity += charge_dot_product[i];
124 sum_intensity *=
factorial(count.second);
131 QString errorStr = QObject::tr(
"ERROR computing hyperscore, PAPPSO exception:\n%1")
132 .arg(exception_pappso.
qwhat());
133 qDebug() <<
"XtandemHyperscore::XtandemHyperscore PappsoException :\n" << errorStr;
136 catch(std::exception &exception_std)
139 QObject::tr(
"ERROR computing hyperscore, std exception:\n%1").arg(exception_std.what());
140 qDebug() <<
"XtandemHyperscore::XtandemHyperscore std::exception :\n" << errorStr;
XtandemHyperscore(const MassSpectrum &spectrum, pappso::PeptideSp peptideSp, unsigned int parent_charge, PrecisionPtr precision, std::list< Enums::PeptideIon > ion_list, bool refine_spectrum_synthesis)