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

coding variable modifications on peptides (MASCOT)

parent ad307c53
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,7 @@ void ProteinXtp::parseAccession2dbxref() {
for (unsigned int i=0; i < access_list.size(); i++) {
accession = access_list.at(i);
qDebug() << "ProteinXtp::parseAccession2dbxref accession " << accession;
//qDebug() << "ProteinXtp::parseAccession2dbxref accession " << accession;
if (atg.indexIn(accession, 0) != -1) {
QStringList temp = accession.split(".");
_dbxref_list.push_back(DbXref(ExternalDatabase::AGI_LocusCode, temp.at(0)));
......@@ -195,13 +195,13 @@ void ProteinXtp::parseAccession2dbxref() {
}
if (swiss_prot.indexIn(accession, 0) != -1) {
qDebug() << "ProteinXtp::parseAccession2dbxref accession SwissProt " << accession;
//qDebug() << "ProteinXtp::parseAccession2dbxref accession SwissProt " << accession;
_dbxref_list.push_back(DbXref(ExternalDatabase::SwissProt, accession));
continue;
}
if (trembl.indexIn(accession, 0) != -1) {
qDebug() << "ProteinXtp::parseAccession2dbxref accession TrEMBL " << accession;
//qDebug() << "ProteinXtp::parseAccession2dbxref accession TrEMBL " << accession;
_dbxref_list.push_back(DbXref(ExternalDatabase::TrEMBL, accession));
continue;
}
......@@ -236,7 +236,7 @@ void ProteinXtp::parseAccession2dbxref() {
}
qDebug() << "ProteinXtp::parseAccession2dbxref end" ;
//qDebug() << "ProteinXtp::parseAccession2dbxref end" ;
}
......
......@@ -65,6 +65,12 @@ void MascotDatParser::parse(QIODevice * in_stream) {
parseHeaderLine( mime_parser.getCurrentTextStream().readLine());
}
}
else if (mime_parser.getCurrentFileName() == "masses") {
while(!mime_parser.getCurrentTextStream().atEnd()) {
parseMassesLine( mime_parser.getCurrentTextStream().readLine());
}
}
else if (mime_parser.getCurrentFileName() == "summary") {
while(!mime_parser.getCurrentTextStream().atEnd()) {
parseSummaryLine( mime_parser.getCurrentTextStream().readLine());
......@@ -99,11 +105,39 @@ void MascotDatParser::parse(QIODevice * in_stream) {
}
saveQuery();
}
}
mime_parser.close();
qDebug() << "MascotDatParser::parse end";
}
void MascotDatParser::parseMassesLine(const QString & masses_line) {
qDebug() << __FILE__ << " " << __FUNCTION__<< " " << __LINE__ << " " << masses_line;
if (_regexp_header_line.exactMatch(masses_line)) {
QStringList header_list = _regexp_header_line.capturedTexts();
// C_term=17.002740
//N_term=1.007825
//delta1=15.994915,Oxidation (M)
if (header_list[1].startsWith("delta")) {
QStringList delta_mod_list = header_list[2].split(",");
pappso::pappso_double mass = delta_mod_list[0].toDouble();
//_number_of_residues = header_list[5].toUInt();
}
//NeutralLoss1=0.000000
//NeutralLoss1_master=63.998285
//FixedMod1=57.021464,Carbamidomethyl (C)
if (header_list[1].startsWith("FixedMod")) {
QStringList fixed_mod_list = header_list[2].split(",");
pappso::pappso_double mass = fixed_mod_list[0].toDouble();
//_number_of_residues = header_list[2].toUInt();
}
//FixedModResidues1=C
}
}
void MascotDatParser::parseProteinLine(const QString & protein_line) {
qDebug() << __FILE__ << " " << __FUNCTION__<< " " << __LINE__ << " " << protein_line;
ProteinXtpSp sp_xtp_protein;
......@@ -224,14 +258,14 @@ void MascotDatParser::parsePeptidesLine(const QString & peptide_line) {
//q1_p1=0,597.302322,0.997884,2,GAWHK,9,0000000,7.97,0000012000000000000,0,0;"sp|O95006|OR2F2_HUMAN":0:299:303:1
int position = value.indexOf(";\"", 0);
QString peptide_string = value.mid(0, position);
qDebug() << "peptide_string=" << peptide_string;
//qDebug() << "peptide_string=" << peptide_string;
_current_peptide.peptide_string_list = peptide_string.split(",");
QString protein_string = value.mid(position+2);
qDebug() << "protein_string=" << protein_string;
//qDebug() << "protein_string=" << protein_string;
//"sp|Q9Y2I7|FYV1_HUMAN":0:670:675:2,"tr|E9PDH4|E9PDH4_HUMAN":0:614:619:2
_current_peptide.protein_string_list = protein_string.split(",\"");
}
......@@ -266,6 +300,7 @@ void MascotDatParser::parsePeptidesLine(const QString & peptide_line) {
q856_p9_terms=-,L:-,V
q856_p9_subst=1,X,W
*/
}
}
......@@ -415,6 +450,20 @@ void MascotDatParser::savePeptideList(std::vector< PeptideLine> & peptide_list,
//parse and save
for(PeptideLine & peptide_line:peptide_list) {
/*
*
0 setMissedCleavages(Integer.parseInt(st.nextToken()));
1 setPeptideMr(Double.parseDouble(st.nextToken()));
2 setDeltaMass(Double.parseDouble(st.nextToken()));
3 setNumberOfIonsMatched(Integer.parseInt(st.nextToken()));
4 setSequence(st.nextToken());
5 setPeaksUsedFromIons1(Integer.parseInt(st.nextToken()));
6 setVariableModificationsArray(st.nextToken());
7 setIonsScore(Double.parseDouble(st.nextToken()));
8 parseIonSeries(st.nextToken());
9 setPeaksUsedFromIons2(Integer.parseInt(st.nextToken()));
10 setPeaksUsedFromIons3(Integer.parseInt(st.nextToken()));
*/
pappso::pappso_double ion_score = peptide_line.peptide_string_list.at(7).toDouble();
peptide_evidence.setParam(PeptideEvidenceParam::mascot_score, QVariant(ion_score));
......@@ -439,6 +488,9 @@ void MascotDatParser::savePeptideList(std::vector< PeptideLine> & peptide_list,
PeptideXtpSp peptide_sp;
peptide_sp = PeptideXtp(peptide_str).makePeptideXtpSp();
//variable modifications :
setVariableModifications(peptide_sp, peptide_line.peptide_string_list.at(6));
peptide_evidence.setPeptideXtpSp(_p_project->getPeptideStore().getInstance(peptide_sp));
......@@ -456,7 +508,7 @@ void MascotDatParser::savePeptideList(std::vector< PeptideLine> & peptide_list,
if (is_decoy) {
accession = QString("%1|reversed").arg(accession);
}
qDebug() << "accession=" << accession;
//qDebug() << "accession=" << accession;
QStringList position_list = str.mid(position+2).split(":");
if (position_list.size() != 4) {
throw pappso::PappsoException(QObject::tr("ERROR position_list.size() != 4 %1").arg(str));
......@@ -501,3 +553,6 @@ pappso::pappso_double MascotDatParser::getEvalueExperimental(pappso::pappso_doub
pappso::pappso_double eval = (ion_score - summary_line.plug_hole) / (pappso::pappso_double)10;
eval = confidence_interval / pow((pappso::pappso_double)10, eval);
}
void MascotDatParser::setVariableModifications(PeptideXtpSp & peptide_sp, QString variable_modifications_string) {
}
......@@ -45,8 +45,10 @@ private:
void parsePeptidesLine(const QString & peptide_line);
void parseQueryLine(const QString & query_line);
void parseSummaryLine(const QString & summary_line);
void parseMassesLine(const QString & masses_line);
void saveQuery();
void saveAndClearPeptide();
void setVariableModifications(PeptideXtpSp & peptide_sp, QString variable_modifications_string);
......
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