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

compute MASCOT evalue

parent 00e57c9c
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "mascotdatparser.h" #include "mascotdatparser.h"
#include "mimeparser.h" #include "mimeparser.h"
#include <cmath>
#include <QDebug> #include <QDebug>
#include <pappsomspp/pappsoexception.h> #include <pappsomspp/pappsoexception.h>
#include "../../core/peptidextp.h" #include "../../core/peptidextp.h"
...@@ -328,7 +329,7 @@ void MascotDatParser::parseSummaryLine(const QString & summary_line) { ...@@ -328,7 +329,7 @@ void MascotDatParser::parseSummaryLine(const QString & summary_line) {
else if (index.startsWith("qmatch")) { else if (index.startsWith("qmatch")) {
unsigned int query_index = index.mid(6).toUInt(); unsigned int query_index = index.mid(6).toUInt();
//_current_query.title = value; //_current_query.title = value;
_summary_list[query_index-1].match=value.toUInt(); _summary_list[query_index-1].match=value.toDouble();
} }
//qplughole1=14.820890 //qplughole1=14.820890
else if (index.startsWith("qplughole")) { else if (index.startsWith("qplughole")) {
...@@ -368,12 +369,18 @@ void MascotDatParser::saveQuery() { ...@@ -368,12 +369,18 @@ void MascotDatParser::saveQuery() {
peptide_evidence.setExperimentalMass(_summary_list[_current_query.query_index-1].exp_mass); peptide_evidence.setExperimentalMass(_summary_list[_current_query.query_index-1].exp_mass);
peptide_evidence.setRetentionTime(_current_query.rt); peptide_evidence.setRetentionTime(_current_query.rt);
peptide_evidence.setParam(PeptideEvidenceParam::mascot_macth_score, QVariant(_summary_list[_current_query.query_index-1].match));
peptide_evidence.setIdentificationDataSource( _p_identification_data_source); peptide_evidence.setIdentificationDataSource( _p_identification_data_source);
//parse and save //parse and save
for(PeptideLine & peptide_line:peptide_list) { for(PeptideLine & peptide_line:peptide_list) {
pappso::pappso_double ion_score = peptide_line.peptide_string_list.at(7).toDouble();
peptide_evidence.setParam(PeptideEvidenceParam::mascot_score, QVariant(ion_score));
peptide_evidence.setEvalue(getEvalue(ion_score, _current_query.query_index, 0.05));
peptide_evidence.setParam(PeptideEvidenceParam::mascot_expectation_value, QVariant(peptide_evidence.getEvalue()));
QString peptide_str =peptide_line.peptide_string_list.at(4); QString peptide_str =peptide_line.peptide_string_list.at(4);
if (!peptide_line.subst.isEmpty()) { if (!peptide_line.subst.isEmpty()) {
//q856_p9_subst=1,X,W //q856_p9_subst=1,X,W
...@@ -426,3 +433,8 @@ void MascotDatParser::saveQuery() { ...@@ -426,3 +433,8 @@ void MascotDatParser::saveQuery() {
qDebug() << "MascotDatParser::saveQuery end"; qDebug() << "MascotDatParser::saveQuery end";
} }
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)));
}
...@@ -48,6 +48,10 @@ private: ...@@ -48,6 +48,10 @@ private:
void saveQuery(); void saveQuery();
void saveAndClearPeptide(); void saveAndClearPeptide();
pappso::pappso_double getEvalue(pappso::pappso_double ion_score, unsigned int query_index, pappso::pappso_double confidence_interval = 0.05) const;
struct PeptideLine { struct PeptideLine {
unsigned int query_index=0; unsigned int query_index=0;
unsigned int peptide_index=0; unsigned int peptide_index=0;
...@@ -63,9 +67,9 @@ private: ...@@ -63,9 +67,9 @@ private:
QString title; QString title;
}; };
struct SummaryLine { struct SummaryLine {
unsigned int match=0; pappso::pappso_double match=0; //qmatch, identity threshold
pappso::pappso_double exp_mass=0; pappso::pappso_double exp_mass=0;
pappso::pappso_double plug_hole=0; pappso::pappso_double plug_hole=0; //qplughole, homology threshold
}; };
private: private:
Project * _p_project; Project * _p_project;
......
...@@ -51,11 +51,13 @@ enum class IdentificationEngine: std::int8_t { ...@@ -51,11 +51,13 @@ enum class IdentificationEngine: std::int8_t {
}; };
/** \def PeptideEvidenceParam peptide evidence specific parameters /** \def PeptideEvidenceParam peptide evidence specific parameters
* * is_a: MS:1001143 ! PSM-level search engine specific statistic
*/ */
enum class PeptideEvidenceParam: std::int8_t { enum class PeptideEvidenceParam: std::int8_t {
tandem_hyperscore=0, ///< X!Tandem hyperscore tandem_hyperscore=0, ///< X!Tandem hyperscore MS:1001331
mascot_macth_score=1 ///< MASCOT match score tandem_expectation_value=1, ///< X!Tandem expectation value MS:1001330
mascot_score=2, ///< PSI-MS MS:1001171 mascot:score 56.16
mascot_expectation_value=3///< PSI-MS MS:1001172 mascot:expectation value 2.42102904673618e-006
}; };
/** \def IdentificationEngineParam identification engine parameters /** \def IdentificationEngineParam identification engine parameters
......
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