diff --git a/src/input/xtpxpipsaxhandler.cpp b/src/input/xtpxpipsaxhandler.cpp index 80c05b8bca95fbddd38e8332b43389ccc1b1a419..7dd37fa0a397148c74da7d14b78f0da1f9165668 100644 --- a/src/input/xtpxpipsaxhandler.cpp +++ b/src/input/xtpxpipsaxhandler.cpp @@ -123,6 +123,10 @@ bool XtpXpipSaxHandler::startElement(const QString & namespaceURI, const QString is_ok = startElement_description(attributes); } else if (qName == "fasta_file") { is_ok = startElement_fasta_file(attributes); + } else if (qName == "contaminants") { + is_ok = startElement_contaminants(attributes); + } else if (qName == "decoys") { + is_ok = startElement_decoys(attributes); } _current_text.clear(); @@ -193,6 +197,41 @@ bool XtpXpipSaxHandler::endElement(const QString & namespaceURI, const QString & return is_ok; } +bool XtpXpipSaxHandler::startElement_contaminants(QXmlAttributes attributes) { +// <contaminants regexp="^contatruc\|" fasta_id=""/> + + qDebug() << "startElement_contaminants "; + QString regexp(attributes.value("regexp")); + QString fasta_id_list(attributes.value("fasta_id")); + if (!regexp.isEmpty()) { + _p_project->getProteinStore().setRegexpContaminantPattern(regexp); + } + if (!fasta_id_list.isEmpty()) { + for (QString fasta_id:fasta_id_list.split(" ")) { + _p_project->getProteinStore().addContaminantFastaFile(_map_fasta_files.at(fasta_id).get()); + } + } + qDebug() << "startElement_contaminants end" ; + return true; +} + +bool XtpXpipSaxHandler::startElement_decoys(QXmlAttributes attributes) { +// <decoys regexp=".*reversedi" fasta_id=""/> + qDebug() << "startElement_decoys "; + QString regexp(attributes.value("regexp")); + QString fasta_id_list(attributes.value("fasta_id")); + if (!regexp.isEmpty()) { + _p_project->getProteinStore().setRegexpDecoyPattern(regexp); + } + if (!fasta_id_list.isEmpty()) { + for (QString fasta_id:fasta_id_list.split(" ")) { + _p_project->getProteinStore().addDecoyFastaFile(_map_fasta_files.at(fasta_id).get()); + } + } + qDebug() << "startElement_decoys end" ; + return true; +} + bool XtpXpipSaxHandler::startElement_label_method(QXmlAttributes attributes) { // <label_method id="dimethyl"> qDebug() << "startElement_label_method "; diff --git a/src/input/xtpxpipsaxhandler.h b/src/input/xtpxpipsaxhandler.h index 61fdb8ffcdb9bd878f3b7652c33a4b1d3bf81751..ed62a4f0eb4f597aa6976dd4e447c228d0dadc08 100644 --- a/src/input/xtpxpipsaxhandler.h +++ b/src/input/xtpxpipsaxhandler.h @@ -85,6 +85,8 @@ private: bool startElement_stat(QXmlAttributes attributes); bool startElement_counts(QXmlAttributes attributes); bool startElement_label_method(QXmlAttributes attributes); + bool startElement_contaminants(QXmlAttributes attributes); + bool startElement_decoys(QXmlAttributes attributes); //bool endElement_identification(); bool endElement_sequence();