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

xpip is now labeled compliant : to test

parent 88597f0b
No related branches found
No related tags found
No related merge requests found
......@@ -95,6 +95,9 @@ bool XtpXpipSaxHandler::startElement(const QString & namespaceURI, const QString
else if (qName == "counts") {
is_ok = startElement_counts(attributes);
}
else if (qName == "label_method") {
is_ok = startElement_label_method(attributes);
}
//<sample value="P6_08_10"/>
else if (qName == "msrun") {
is_ok = startElement_msrun(attributes);
......@@ -190,6 +193,16 @@ bool XtpXpipSaxHandler::endElement(const QString & namespaceURI, const QString &
return is_ok;
}
bool XtpXpipSaxHandler::startElement_label_method(QXmlAttributes attributes) {
// <label_method id="dimethyl">
qDebug() << "startElement_label_method ";
LabelingMethod method(attributes.value("id").simplified());
_sp_labeling_method = method.makeLabelingMethodSp();
_p_project->setLabelingMethodSp(_sp_labeling_method);
qDebug() << "startElement_label_method end" ;
return true;
}
bool XtpXpipSaxHandler::startElement_counts(QXmlAttributes attributes) {
// <counts proteins="6019" peptides="6194" peptide_evidences="7123" protein_matches="6019"/>
qDebug() << "startElement_counts ";
......@@ -317,7 +330,7 @@ bool XtpXpipSaxHandler::startElement_identification_source(QXmlAttributes attrib
_sp_current_identification_source->setMsRunSp(_map_msruns.at(attributes.value("msrun_id").simplified()));
qDebug() << "startElement_identification_source setIdentificationEngineVersion";
_sp_current_identification_source->setIdentificationEngineVersion(attributes.value("version"));
for (const QString & fasta_id : attributes.value("fasta_ids").split(" ")) {
_sp_current_identification_source.get()->addFastaFile(_map_fasta_files.at(fasta_id));
}
......@@ -501,6 +514,11 @@ bool XtpXpipSaxHandler::endElement_peptide() {
qDebug() << "endElement_peptide ";
_current_peptide_sp = _p_project->getPeptideStore().getInstance(_current_peptide_sp);
_map_peptides.insert(std::pair<QString, PeptideXtpSp>(_current_id, _current_peptide_sp));
if (_sp_labeling_method.get() != nullptr) {
_current_peptide_sp.get()->applyLabelingMethod(_sp_labeling_method);
}
_current_peptide_sp = nullptr;
_count_peptides++;
......
......@@ -84,6 +84,7 @@ private:
bool startElement_param(QXmlAttributes attributes);
bool startElement_stat(QXmlAttributes attributes);
bool startElement_counts(QXmlAttributes attributes);
bool startElement_label_method(QXmlAttributes attributes);
//bool endElement_identification();
bool endElement_sequence();
......@@ -118,6 +119,7 @@ private:
ProteinXtpSp _sp_current_protein;
PeptideXtpSp _current_peptide_sp;
IdentificationDataSourceSp _sp_current_identification_source;
LabelingMethodSp _sp_labeling_method;
MsRunSp _sp_msrun;
std::map<QString, PeptideXtpSp> _map_peptides;
bool _is_xtpcpp_xpip = false;
......
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