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

PeptideMatchParam renamed to PeptideEvidenceParam

parent a337dff2
No related branches found
No related tags found
No related merge requests found
......@@ -75,10 +75,10 @@ void PeptideEvidence::setEvalue(pappso::pappso_double evalue) {
/** \brief set specific parameter value
*/
void PeptideEvidence::setParam(PeptideMatchParam param, const QVariant& value) {
_params.insert(std::pair<PeptideMatchParam, QVariant>(param, value));
void PeptideEvidence::setParam(PeptideEvidenceParam param, const QVariant& value) {
_params.insert(std::pair<PeptideEvidenceParam, QVariant>(param, value));
}
const QVariant PeptideEvidence::getParam(PeptideMatchParam param) const {
const QVariant PeptideEvidence::getParam(PeptideEvidenceParam param) const {
try {
return _params.at(param);
}
......@@ -86,7 +86,7 @@ const QVariant PeptideEvidence::getParam(PeptideMatchParam param) const {
return QVariant();
}
}
const std::map<PeptideMatchParam, QVariant> & PeptideEvidence::getParamList() const {
const std::map<PeptideEvidenceParam, QVariant> & PeptideEvidence::getParamList() const {
return _params;
}
......
......@@ -77,12 +77,12 @@ public :
/** \brief set specific parameter value
*/
virtual void setParam(PeptideMatchParam param, const QVariant& value);
virtual void setParam(PeptideEvidenceParam param, const QVariant& value);
/** \brief get specific parameter value
*/
virtual const QVariant getParam(PeptideMatchParam param) const;
virtual const QVariant getParam(PeptideEvidenceParam param) const;
const std::map<PeptideMatchParam, QVariant> & getParamList() const;
const std::map<PeptideEvidenceParam, QVariant> & getParamList() const;
void setCharge(unsigned int charge);
......@@ -133,7 +133,7 @@ private :
pappso::pappso_double _exp_mass;
unsigned int _charge;
IdentificationDataSource* _p_identification_source = nullptr;
std::map<PeptideMatchParam, QVariant> _params;
std::map<PeptideEvidenceParam, QVariant> _params;
/** @brief manually checked by user (true by default)
*/
......
......@@ -138,7 +138,7 @@ void PeptideWindow::updateDisplay() {
ui->scan_label->setText(QString("%1").arg(_p_peptide_evidence->getScan()));
ui->sample_label->setText(_p_peptide_evidence->getMsRunP()->getSampleName());
ui->modification_label->setText(_p_peptide_evidence->getPeptideXtpSp().get()->getModifString());
ui->hyperscore_label->setText(_p_peptide_evidence->getParam(PeptideMatchParam::tandem_hyperscore).toString());
ui->hyperscore_label->setText(_p_peptide_evidence->getParam(PeptideEvidenceParam::tandem_hyperscore).toString());
ui->evalue_label->setText(QString::number(_p_peptide_evidence->getEvalue(), 'g', 4));
ui->mh_label->setText(QString::number(_p_peptide_evidence->getPeptideXtpSp().get()->getMz(1), 'f', 4));
ui->mz_label->setText(QString::number(_p_peptide_evidence->getPeptideXtpSp().get()->getMz(_p_peptide_evidence->getCharge()), 'f', 4));
......
......@@ -186,7 +186,7 @@ QVariant PeptideTableModel::data(const QModelIndex &index, int role ) const {
return QVariant((qreal) _p_protein_match->getPeptideMatchList().at(row).getPeptideEvidence()->getDeltaMass());
break;
case (std::int8_t)PeptideListColumn::hyperscore:
return _p_protein_match->getPeptideMatchList().at(row).getPeptideEvidence()->getParam(PeptideMatchParam::tandem_hyperscore);
return _p_protein_match->getPeptideMatchList().at(row).getPeptideEvidence()->getParam(PeptideEvidenceParam::tandem_hyperscore);
break;
}
}
......
......@@ -228,7 +228,7 @@ QVariant PtmPeptideTableModel::data(const QModelIndex &index, int role ) const {
return QVariant((qreal) _ptm_sample_scan_list.at(row).get()->getRepresentativePeptideMatch().getPeptideEvidence()->getDeltaMass());
break;
case (std::int8_t)PtmPeptideListColumn::besthyperscore:
return _ptm_sample_scan_list.at(row).get()->getRepresentativePeptideMatch().getPeptideEvidence()->getParam(PeptideMatchParam::tandem_hyperscore);
return _ptm_sample_scan_list.at(row).get()->getRepresentativePeptideMatch().getPeptideEvidence()->getParam(PeptideEvidenceParam::tandem_hyperscore);
break;
case (std::int8_t)PtmPeptideListColumn::bestposition:
for (unsigned int position :_ptm_sample_scan_list.at(row).get()->getBestPtmPositionList(_p_ptm_grouping_experiment)) {
......
......@@ -255,7 +255,7 @@ void IdentificationPwizReader::read(
QVariant hyperscore = getQVariantDoubleParam(spid_item.get(), pwiz::cv::MS_X_Tandem_hyperscore);
if (!hyperscore.isNull())
{
p_peptide_evidence->setParam(PeptideMatchParam::tandem_hyperscore, hyperscore);
p_peptide_evidence->setParam(PeptideEvidenceParam::tandem_hyperscore, hyperscore);
}
......
......@@ -263,7 +263,7 @@ bool XpipSaxHandler::startElement_peptide(QXmlAttributes attributes) {
_p_peptide_evidence->setExperimentalMass(exp_mass);
_current_peptide_match.setStart(attributes.value("start").simplified().toUInt()-1);
_p_peptide_evidence->setCharge(attributes.value("charge").simplified().toUInt());
_p_peptide_evidence->setParam(PeptideMatchParam::tandem_hyperscore, QVariant( attributes.value("hypercorr").toDouble()));
_p_peptide_evidence->setParam(PeptideEvidenceParam::tandem_hyperscore, QVariant( attributes.value("hypercorr").toDouble()));
IdentificationDataSource* p_identification_data_source = _p_project->getIdentificationDataSourceStore().getInstance(attributes.value("sample_file").simplified()).get();
_p_peptide_evidence->setIdentificationDataSource( p_identification_data_source);
......
......@@ -299,7 +299,7 @@ bool XtandemSaxHandler::startElement_domain(QXmlAttributes attributes) {
_current_peptide_match.setStart(attributes.value("start").simplified().toUInt()-1);
_p_peptide_evidence->setCharge(_charge);
_p_peptide_evidence->setParam(PeptideMatchParam::tandem_hyperscore, QVariant( attributes.value("hyperscore").toDouble()));
_p_peptide_evidence->setParam(PeptideEvidenceParam::tandem_hyperscore, QVariant( attributes.value("hyperscore").toDouble()));
_p_peptide_evidence->setIdentificationDataSource( _p_identification_data_source);
_p_peptide_evidence->setChecked(true);
......
......@@ -74,6 +74,8 @@ bool XtpXpipSaxHandler::startElement(const QString & namespaceURI, const QString
is_ok = startElement_protein(attributes);
} else if (qName == "identification_source") {
is_ok = startElement_identification_source(attributes);
} else if (qName == "param") {
is_ok = startElement_param(attributes);
}
//<sample value="P6_08_10"/>
else if (qName == "sample") {
......@@ -180,6 +182,23 @@ bool XtpXpipSaxHandler::startElement_description(QXmlAttributes attributes) {
return true;
}
bool XtpXpipSaxHandler::startElement_param(QXmlAttributes attributes) {
/*
<param key="0" value="48.5"/>
*/
qDebug() << "startElement_param ";
if (_sp_current_peptide_evidence.get() != nullptr) {
PeptideEvidenceParam type = static_cast<PeptideEvidenceParam>(attributes.value("key").toUInt());
_sp_current_peptide_evidence.get()->setParam(type, QVariant( attributes.value("value").toDouble()));
}
qDebug() << "startElement_param end" ;
return true;
}
bool XtpXpipSaxHandler::startElement_modification(QXmlAttributes attributes) {
/*
......@@ -249,8 +268,8 @@ bool XtpXpipSaxHandler::startElement_peptide_evidence(QXmlAttributes attributes)
_p_peptide_evidence->setExperimentalMass(attributes.value("exp_mass").toDouble());
_p_peptide_evidence->setPeptideXtpSp(_map_peptides.at( attributes.value("peptide_id").simplified()));
PeptideEvidenceSp sp_peptide_evidence = sp_ident_source.get()->getPeptideEvidenceStore().getInstance(_p_peptide_evidence);
_map_peptide_evidences.insert(std::pair<QString, PeptideEvidenceSp>(attributes.value("id").simplified(), sp_peptide_evidence));
_sp_current_peptide_evidence = sp_ident_source.get()->getPeptideEvidenceStore().getInstance(_p_peptide_evidence);
_map_peptide_evidences.insert(std::pair<QString, PeptideEvidenceSp>(attributes.value("id").simplified(), _sp_current_peptide_evidence));
qDebug() << "startElement_peptide_evidence end" ;
return true;
}
......
......@@ -78,6 +78,7 @@ private:
bool startElement_identification_source(QXmlAttributes attributes);
bool startElement_modification(QXmlAttributes attributes);
bool startElement_mod(QXmlAttributes attributes);
bool startElement_param(QXmlAttributes attributes);
//bool endElement_identification();
bool endElement_sequence();
bool endElement_protein();
......@@ -103,6 +104,7 @@ private:
std::map<QString, MsRunSp> _map_msruns;
std::map<QString, IdentificationDataSourceSp> _map_ident_sources;
std::map<QString, PeptideEvidenceSp> _map_peptide_evidences;
PeptideEvidenceSp _sp_current_peptide_evidence;
ProteinXtp _current_protein;
PeptideXtpSp _current_peptide_sp;
std::map<QString, PeptideXtpSp> _map_peptides;
......
......@@ -107,7 +107,7 @@ void SpectraSheet::writeBestPeptideEvidence(const GroupingGroup * p_group,const
}
}
_p_writer->writeCell(p_peptide_evidence->getEvalue());
_p_writer->writeCell(p_peptide_evidence->getParam(PeptideMatchParam::tandem_hyperscore).toDouble());
_p_writer->writeCell(p_peptide_evidence->getParam(PeptideEvidenceParam::tandem_hyperscore).toDouble());
}
......
......@@ -487,7 +487,7 @@ void ProticdbMl::writePeptideHit(QString xml_id, ProticPeptideHit & protic_pepti
writeCvParam("PROTICdbO:0000287", Utils::getXmlDouble(protic_peptide_hit.peptide_match->getPeptideEvidence()->getEvalue()),
"xtandem peptide evalue");
writeCvParam("PROTICdbO:0000288", Utils::getXmlDouble(protic_peptide_hit.peptide_match->getPeptideEvidence()->getParam(PeptideMatchParam::tandem_hyperscore).toDouble()),
writeCvParam("PROTICdbO:0000288", Utils::getXmlDouble(protic_peptide_hit.peptide_match->getPeptideEvidence()->getParam(PeptideEvidenceParam::tandem_hyperscore).toDouble()),
"xtandem peptide hyperscore");
}
......
......@@ -389,11 +389,11 @@ void Xpip::writePeptideEvidence(const PeptideEvidence * p_peptide_evidence) {
_output_stream->writeAttribute("checked","false");
}
const std::map<PeptideMatchParam, QVariant> & params = p_peptide_evidence->getParamList();
const std::map<PeptideEvidenceParam, QVariant> & params = p_peptide_evidence->getParamList();
//if (params.size() > 0) {
// _output_stream->writeStartElement("stats");
for (const std::pair<PeptideMatchParam, QVariant> param_pair: params) {
for (const std::pair<PeptideEvidenceParam, QVariant> param_pair: params) {
_output_stream->writeStartElement("param");
_output_stream->writeAttribute("key",QString("%1").arg(static_cast<std::int8_t>(param_pair.first)));
_output_stream->writeAttribute("value",param_pair.second.toString());
......
......@@ -50,18 +50,18 @@ enum class IdentificationEngine: std::int8_t {
peptider=3 ///< peptider
};
/** \def PeptideMatchParam peptide match specific parameters
/** \def PeptideEvidenceParam peptide evidence specific parameters
*
*/
enum class PeptideMatchParam: std::int8_t {
enum class PeptideEvidenceParam: std::int8_t {
tandem_hyperscore=0 ///< X!Tandem hyperscore
};
/** \def IdentificationEngineParam identification engine parameters
*
*/
enum class IdentificationEngineParam {
tandem_param ///< X!Tandem xml parameters file
enum class IdentificationEngineParam: std::int8_t {
tandem_param=0 ///< X!Tandem xml parameters file
};
......
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