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

WIP: reading identification using pwiz library

parent 05ade944
No related branches found
No related tags found
No related merge requests found
......@@ -38,6 +38,7 @@
#include <pwiz/data/identdata/IdentData.hpp>
#include <pwiz/data/identdata/IdentDataFile.hpp>
#include "../core/peptidematch.h"
#include <locale>
#include "../core/proteinxtp.h"
#include "../core/peptidextp.h"
......@@ -120,13 +121,63 @@ void IdentificationPwizReader::read(
}
for (pwiz::identdata::PeptideEvidencePtr seq_ptr :_pwiz_ident_data_file->sequenceCollection.peptideEvidence) {
}
//std::vector<SpectrumIdentificationListPtr> spectrumIdentificationList
//std::vector<SpectrumIdentificationResultPtr> spectrumIdentificationResult
for (pwiz::identdata::SpectrumIdentificationListPtr spectrum_ident_list_ptr :_pwiz_ident_data_file->dataCollection.analysisData.spectrumIdentificationList) {
for (pwiz::identdata::SpectrumIdentificationResultPtr spectrum_ptr :spectrum_ident_list_ptr.get()->spectrumIdentificationResult) {
unsigned int scan=0;
if (spectrum_ptr.get()->hasCVParam(pwiz::cv::MS_scan_number_s__OBSOLETE))
{
scan =
std::stoi(spectrum_ptr.get()->cvParam(pwiz::cv::MS_scan_number_s__OBSOLETE).value);
}
else {
throw pappso::PappsoException(QObject::tr("Scan number not found"));
}
//<cvParam accession="MS:1001115" cvRef="PSI-MS" value="4925" name="scan number(s)"/>
PeptideMatch * p_peptide_match = new PeptideMatch(_sp_msrun.get(), scan);
double rt=0;
if (spectrum_ptr.get()->hasCVParam(pwiz::cv::MS_retention_time))
{
rt =
std::stod(spectrum_ptr.get()->cvParam(pwiz::cv::MS_retention_time).value);
p_peptide_match->setRetentionTime(rt);
}
else {
//throw pappso::PappsoException(QObject::tr("Scan number not found"));
}
/*
p_peptide_match->setEvalue(attributes.value("expect").simplified().toDouble());
//qDebug() << "XtandemSaxHandler::startElement_domain evalue " << _p_peptide_match->getEvalue() << " scan " << _p_peptide_match->getScan();
pappso::pappso_double xtandem_mhtheo = attributes.value("mh").simplified().toDouble();
pappso::pappso_double xtandem_delta = attributes.value("delta").simplified().toDouble();
pappso::pappso_double exp_mass = xtandem_mhtheo + xtandem_delta - pappso::MHPLUS;
p_peptide_match->setExperimentalMass(exp_mass);
p_peptide_match->setStart(attributes.value("start").simplified().toUInt()-1);
p_peptide_match->setCharge(_charge);
p_peptide_match->setParam(PeptideMatchParam::tandem_hyperscore, QVariant( attributes.value("hyperscore").toDouble()));
p_peptide_match->setIdentificationDataSource( _p_identification_data_source);
p_peptide_match->setChecked(true);
_p_protein_match->addPeptideMatch(p_peptide_match);
*/
}
}
}
catch (pappso::PappsoException & error) {
qDebug() << "IdentificationPwizReader::read error ";
throw pappso::PappsoException(QObject::tr("Error reading file (%1) using proteowizard library : %2").arg(_identfile.absoluteFilePath()).arg(error.qwhat()));
}
catch (std::exception& error)
{
qDebug() << "IdentificationPwizReader::read std error ";
......
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