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

take into account old tandem reverse style

parent 51f940d6
No related branches found
No related tags found
No related merge requests found
......@@ -157,27 +157,6 @@ bool XtandemSaxHandler::startElement_note(QXmlAttributes attributes) {
return is_ok;
}
bool XtandemSaxHandler::startElement_protein(QXmlAttributes attributes) {
//<protein expect="-704.6" id="1976.1" uid="195701" label="GRMZM2G083841_P01 P04711 Phosphoenolpyruvate carboxylase 1 (PEPCase 1)(PEPC 1)(EC..." sumI="9.36" >
bool is_ok = true;
//qDebug() << "startElement_protein begin";
QString accession = attributes.value("label").simplified().split(" ", QString::SkipEmptyParts).at(0);
//qDebug() << "startElement_protein accession" << accession;
_p_protein_match = _p_identification_group->getProteinMatchInstance(accession);
//qDebug() << "startElement_protein p_protein_match 1 " << _p_protein_match;
_current_protein.setAccession(accession);
_p_protein_match->setChecked(false);
//qDebug() << "startElement_protein p_protein_match 3 " << _p_protein_match;
ProteinXtpSp sp_xtp_protein = _current_protein.makeProteinXtpSp();
_p_protein_match->setProteinXtpSp(_p_project->getProteinStore().getInstance(sp_xtp_protein));
_p_protein_match->setChecked(true);
//qDebug() << "startElement_protein end" ;
return is_ok;
}
bool XtandemSaxHandler::startElement_file(QXmlAttributes attributes) {
bool is_ok = true;
//<file type="peptide" URL="/gorgone/pappso/formation/TD/Database/Genome_Z_mays_5a.fasta"/>
......@@ -374,9 +353,9 @@ bool XtandemSaxHandler::endElement_note() {
_current_protein.setAccession(QString("%1%2").arg(_current_protein.getAccession()).arg(":reversed"));
}
//for older versions < 2013.09.01.1
if (!_p_protein_match->getProteinXtpSp().get()->getAccession().endsWith("|reversed") && _p_protein_match->getProteinXtpSp().get()->getDescription().endsWith("|reversed")) {
if (!_current_protein.getAccession().endsWith("|reversed") && _current_protein.getDescription().endsWith("|reversed")) {
//to fit most cases, just check that the :reversed chars added by X!Tandem are not in the description. if so, then add it too in the accession
_p_protein_match->getProteinXtpSp().get()->setAccession(QString("%1%2").arg(_p_protein_match->getProteinXtpSp().get()->getAccession()).arg("|reversed"));
_current_protein.setAccession(QString("%1%2").arg(_current_protein.getAccession()).arg("|reversed"));
}
//qDebug() << "startElement_protein accession" << accession;
......
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