diff --git a/src/core/peptidematch.cpp b/src/core/peptidematch.cpp index 2bcde69a5f09c997f693f29b8c81ad699c9ef9ea..2c92fc7853aea557dd41715a06befcd084f26bae 100644 --- a/src/core/peptidematch.cpp +++ b/src/core/peptidematch.cpp @@ -45,7 +45,20 @@ void PeptideMatch::setRetentionTime(pappso::pappso_double rt) { void PeptideMatch::setEvalue(pappso::pappso_double evalue) { _evalue = evalue; } - + + /** \brief set specific parameter value + */ +void PeptideMatch::setParam(PeptideMatchParam param, const QVariant& value) { + _params.insert(std::pair<PeptideMatchParam, QVariant>(param, value)); +} +const QVariant PeptideMatch::getParam(PeptideMatchParam param) const { + try { + return _params.at(param); + } + catch (std::out_of_range) { + return QVariant(); + } +} std::size_t PeptideMatch::getHashPeptideMassSample() const { return PeptideMatch::_hash_fn (QString("%1 %2").arg(_peptide_sp.get()->toAbsoluteString()).arg(_msrunid_sp->getXmlId()).toStdString()); diff --git a/src/core/peptidematch.h b/src/core/peptidematch.h index 42bcbabfe2e6bfb41b8e380d45a69182ed32956d..573442a6a030e9124a886f008c0a3291cd585685 100644 --- a/src/core/peptidematch.h +++ b/src/core/peptidematch.h @@ -42,6 +42,15 @@ public : void setEvalue(pappso::pappso_double evalue); void setExperimentalMass(pappso::pappso_double exp_mass); + + /** \brief set specific parameter value + */ + virtual void setParam(PeptideMatchParam param, const QVariant& value); + /** \brief get specific parameter value + */ + virtual const QVariant getParam(PeptideMatchParam param) const; + + /** @brief set start position of this peptide inside the protein sequence * @param start position in the protein amino acid sequence (starts at 0) * */ @@ -94,6 +103,7 @@ private : unsigned int _start=0; unsigned int _charge; IdentificationDataSource* _p_identification_source = nullptr; + std::map<PeptideMatchParam, QVariant> _params; /** @brief manually checked by user (true by default) */ diff --git a/src/input/xpipsaxhandler.cpp b/src/input/xpipsaxhandler.cpp index a8f9b20c5037140f55181994e44833d469f7ac06..c9288cd27026a6095bf3f1c1e159ac7abde0566b 100644 --- a/src/input/xpipsaxhandler.cpp +++ b/src/input/xpipsaxhandler.cpp @@ -239,6 +239,7 @@ bool XpipSaxHandler::startElement_peptide(QXmlAttributes attributes) { _p_peptide_match->setExperimentalMass(exp_mass); _p_peptide_match->setStart(attributes.value("start").simplified().toUInt()-1); _p_peptide_match->setCharge(attributes.value("charge").simplified().toUInt()); + _p_peptide_match->setParam(PeptideMatchParam::tandem_hyperscore, QVariant( attributes.value("hypercorr").toDouble())); IdentificationDataSource* p_identification_data_source = _p_project->getIdentificationDataSourceStore().getInstance(attributes.value("sample_file").simplified()).get(); _p_peptide_match->setIdentificationDataSource( p_identification_data_source); diff --git a/src/input/xtandemsaxhandler.cpp b/src/input/xtandemsaxhandler.cpp index 58c59468c29aee9aaa7deeb16de7acc95160a335..acef364d2e5ccdd6c966a89576e12a0fe75b9d7a 100644 --- a/src/input/xtandemsaxhandler.cpp +++ b/src/input/xtandemsaxhandler.cpp @@ -293,6 +293,8 @@ bool XtandemSaxHandler::startElement_domain(QXmlAttributes attributes) { _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); diff --git a/src/utils/types.h b/src/utils/types.h index aa354e8cd2401f7b6564e551674d7ab4da297c18..7244df9944560482a90ccbcaa39f2ab3b6a39386 100644 --- a/src/utils/types.h +++ b/src/utils/types.h @@ -37,6 +37,13 @@ enum class IdentificationEngine { peptider ///< peptider }; +/** \def PeptideMatchParam peptide match specific parameters + * + */ +enum class PeptideMatchParam { + tandem_hyperscore ///< X!Tandem hyperscore +}; + /** \def IdentificationEngineParam identification engine parameters * */