Skip to content
Snippets Groups Projects
Commit c82e8b16 authored by Langella Olivier's avatar Langella Olivier
Browse files

same evalue as computed by MASCOT java dat parser

parent 93d79254
No related branches found
No related tags found
No related merge requests found
......@@ -320,6 +320,7 @@ void MascotDatParser::parseSummaryLine(const QString & summary_line) {
//qmass1=598.300206
if (index.startsWith("qmass")) {
unsigned int query_index = index.mid(5).toUInt();
qDebug() << __FILE__ << " " << __FUNCTION__<< " " << __LINE__ << " " << query_index << " " << index;
//_current_query.title = value;
_summary_list[query_index-1].exp_mass=value.toDouble();
}
......@@ -380,7 +381,6 @@ void MascotDatParser::saveQuery() {
peptide_evidence.setParam(PeptideEvidenceParam::mascot_expectation_value, QVariant(peptide_evidence.getEvalue()));
QString peptide_str =peptide_line.peptide_string_list.at(4);
if (!peptide_line.subst.isEmpty()) {
//q856_p9_subst=1,X,W
......@@ -394,6 +394,10 @@ void MascotDatParser::saveQuery() {
peptide_sp = PeptideXtp(peptide_str).makePeptideXtpSp();
peptide_sp = _p_project->getPeptideStore().getInstance(peptide_sp);
qDebug() << "MascotDatParser::saveQuery peptide=" << peptide_str << " evalue=" << peptide_evidence.getEvalue() << " ionscore=" << ion_score;
if (peptide_line.protein_string_list.size() != peptide_line.fasta_file_list.size()) {
throw pappso::PappsoException(QObject::tr("ERROR (peptide_line.protein_string_list.size() != peptide_line.fasta_file_list.size()) %1").arg(peptide_line.protein_string_list.join(",\"")));
}
......@@ -435,6 +439,12 @@ void MascotDatParser::saveQuery() {
}
pappso::pappso_double MascotDatParser::getEvalue(pappso::pappso_double ion_score, unsigned int query_index, pappso::pappso_double confidence_interval) const {
double identity_threshold = 10.0 * std::log(_summary_list.at(query_index-1).match / (confidence_interval * 20.0)) / log(10);;
return (confidence_interval * pow(10, ((identity_threshold - ion_score) / 10)));
pappso::pappso_double identity_threshold = (pappso::pappso_double)10.0 * std::log(_summary_list.at(query_index-1).match / (confidence_interval * (pappso::pappso_double)20.0)) / log((pappso::pappso_double)10);;
return (confidence_interval * pow((pappso::pappso_double)10, ((identity_threshold - ion_score) / (pappso::pappso_double)10)));
}
pappso::pappso_double MascotDatParser::getEvalueExperimental(pappso::pappso_double ion_score, unsigned int query_index, pappso::pappso_double confidence_interval) const {
// Evalue experimental Homology threshold (QPlughole value from .dat file).
pappso::pappso_double eval = (ion_score - _summary_list.at(query_index-1).plug_hole) / (pappso::pappso_double)10;
eval = confidence_interval / pow((pappso::pappso_double)10, eval);
}
......@@ -47,11 +47,14 @@ private:
void parseSummaryLine(const QString & summary_line);
void saveQuery();
void saveAndClearPeptide();
pappso::pappso_double getEvalue(pappso::pappso_double ion_score, unsigned int query_index, pappso::pappso_double confidence_interval = 0.05) const;
pappso::pappso_double getEvalueExperimental(pappso::pappso_double ion_score, unsigned int query_index, pappso::pappso_double confidence_interval = 0.05) const;
struct PeptideLine {
unsigned int query_index=0;
unsigned int peptide_index=0;
......@@ -80,21 +83,21 @@ private:
ProteinXtp _current_protein;
std::vector<FastaFileSp> _fasta_file_list;
QRegExp _regexp_header_line;
unsigned int _number_of_queries=0;
unsigned int _number_of_residues=0;
unsigned int _current_query_index=0;
QString _error_str;
PeptideLine _current_peptide;
QueryLine _current_query;
std::vector<std::vector<PeptideLine>> _query_peptide_results;
std::vector<SummaryLine> _summary_list;
};
#endif // MASCOTDATPARSER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment