diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7a1be53fac2af067b3de8160977edb59680069c0..0410712ba83af5ff6444aa8d5c2065a6a8468cd7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,6 +62,7 @@ SET(CPP_FILES core/tandem_run/tandemcondorprocess.cpp core/tandem_run/tandemparameters.cpp core/msrun.cpp + core/peptideevidence.cpp core/peptidematch.cpp core/peptidextp.cpp core/project.cpp @@ -106,7 +107,7 @@ SET(CPP_FILES utils/identificationdatasourcestore.cpp utils/groupstore.cpp utils/msrunstore.cpp - utils/peptidematchstore.cpp + utils/peptideevidencestore.cpp utils/peptidestore.cpp utils/proteinstore.cpp utils/readspectrum.cpp diff --git a/src/core/identification_sources/identificationdatasource.cpp b/src/core/identification_sources/identificationdatasource.cpp index d300871d28df34d0eb05990bae4e3ecf099a790f..b06ae4d94787ea39499692b2251757826b4b4a60 100644 --- a/src/core/identification_sources/identificationdatasource.cpp +++ b/src/core/identification_sources/identificationdatasource.cpp @@ -44,8 +44,8 @@ IdentificationDataSource::~IdentificationDataSource() } -PeptideMatchStore & IdentificationDataSource::getPeptideMatchStore() { - return _peptide_match_store; +PeptideEvidenceStore & IdentificationDataSource::getPeptideEvidenceStore() { + return _peptide_evidence_store; } void IdentificationDataSource::setXmlId(const QString xmlid) { diff --git a/src/core/identification_sources/identificationdatasource.h b/src/core/identification_sources/identificationdatasource.h index de98f146b9960ebb3801bbf7ca5efca1ee0aee6b..f83588031bd4213c4d6126335632dd7b72fc1bcb 100644 --- a/src/core/identification_sources/identificationdatasource.h +++ b/src/core/identification_sources/identificationdatasource.h @@ -29,7 +29,7 @@ #include <QVariant> #include "../msrun.h" #include "../../utils/fastafilestore.h" -#include "../../utils/peptidematchstore.h" +#include "../../utils/peptideevidencestore.h" class Project; @@ -46,7 +46,7 @@ public: ~IdentificationDataSource(); bool operator==(const IdentificationDataSource& other) const; - PeptideMatchStore & getPeptideMatchStore(); + PeptideEvidenceStore & getPeptideEvidenceStore(); void setXmlId(const QString xmlid); const QString & getXmlId() const; @@ -122,7 +122,7 @@ private : std::map<IdentificationEngineStatistics, QVariant> _param_stats; std::vector<FastaFileSp> _fastafile_list; - PeptideMatchStore _peptide_match_store; + PeptideEvidenceStore _peptide_evidence_store; }; #endif // IDENTIFICATIONDATASOURCE_H diff --git a/src/core/peptideevidence.cpp b/src/core/peptideevidence.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c1669f2dc841fa492916897ca664280920a758b9 --- /dev/null +++ b/src/core/peptideevidence.cpp @@ -0,0 +1,217 @@ +/** + * \file utils/peptideevidence.cpp + * \date 18/11/2017 + * \author Olivier Langella + * \brief peptide evidence : a peptide sequence + spectrum + identification engine evaluation (psm) + */ + + +/******************************************************************************* +* Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>. +* +* This file is part of XTPcpp. +* +* XTPcpp is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* XTPcpp is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. +* +* Contributors: +* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and implementation +******************************************************************************/ + +#include "peptideevidence.h" +#include <pappsomspp/pappsoexception.h> + +std::hash<std::string> PeptideEvidence::_hash_fn; + +PeptideEvidence::PeptideEvidence(MsRun * msrunid_sp, unsigned int scan) { + _msrunid_sp = msrunid_sp; + _scan = scan; + + _hash_sample_scan = PeptideEvidence::_hash_fn (QString("%1 %2").arg(msrunid_sp->getXmlId()).arg(_scan).toStdString()); +} + +PeptideEvidence::PeptideEvidence(const PeptideEvidence & other): PeptideEvidence(other._msrunid_sp, other._scan) { + _hash_sample_scan = other._hash_sample_scan; + _sp_grp_peptide = other._sp_grp_peptide; + _peptide_sp = other._peptide_sp; + _rt = other._rt; + _evalue = other._evalue; + _exp_mass = other._exp_mass; + _start=other._start; + _charge= other._charge; + _p_identification_source = other._p_identification_source; + _params = other._params; + _checked = other._checked; + _proxy_valid = other._proxy_valid; + +} + +PeptideEvidenceSp PeptideEvidence::makePeptideEvidenceSp() const { + return std::make_shared<PeptideEvidence>(*this); +} + +void PeptideEvidence::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) { + _proxy_valid = false; + + if (_evalue <= automatic_filter_parameters.getFilterPeptideEvalue()) { + _proxy_valid = true; + } +} +void PeptideEvidence::setRetentionTime(pappso::pappso_double rt) { + _rt = rt; +} +void PeptideEvidence::setEvalue(pappso::pappso_double evalue) { + _evalue = evalue; +} + +/** \brief set specific parameter value + */ +void PeptideEvidence::setParam(PeptideMatchParam param, const QVariant& value) { + _params.insert(std::pair<PeptideMatchParam, QVariant>(param, value)); +} +const QVariant PeptideEvidence::getParam(PeptideMatchParam param) const { + try { + return _params.at(param); + } + catch (std::out_of_range) { + return QVariant(); + } +} +const std::map<PeptideMatchParam, QVariant> & PeptideEvidence::getParamList() const { + return _params; +} + +std::size_t PeptideEvidence::getHashPeptideMassSample() const { + return PeptideEvidence::_hash_fn (QString("%1 %2").arg(_peptide_sp.get()->toAbsoluteString()).arg(_msrunid_sp->getXmlId()).toStdString()); +} + +std::size_t PeptideEvidence::getHashSampleScan() const { + return _hash_sample_scan; +} +pappso::pappso_double PeptideEvidence::getEvalue() const { + return _evalue; +} +pappso::pappso_double PeptideEvidence::getExperimentalMass() const { + return _exp_mass; +} +pappso::pappso_double PeptideEvidence::getExperimentalMz() const { + pappso::mz mz = _exp_mass; + for (unsigned int i=0; i < _charge; i++) { + mz+=pappso::MHPLUS; + } + mz = mz/_charge; + return mz; +} +void PeptideEvidence::setExperimentalMass(pappso::pappso_double exp_mass) { + _exp_mass =exp_mass; +} +void PeptideEvidence::setStart(unsigned int start) { + _start =start; +} +pappso::mz PeptideEvidence::getDeltaMass() const { + return (_peptide_sp.get()->getMz(1) - (_exp_mass+pappso::MHPLUS)); +} +unsigned int PeptideEvidence::getStart() const { + return _start; +} +unsigned int PeptideEvidence::getStop() const { + return _start+_peptide_sp.get()->size(); +} + +bool PeptideEvidence::containsPosition(unsigned int position) const { + if (position < _start) { + return false; + } + if (position < getStop()) { + return true; + } + return false; + +} +void PeptideEvidence::setCharge(unsigned int charge) { + _charge =charge; +} + +void PeptideEvidence::setPeptideXtpSp (PeptideXtpSp peptide) { + _peptide_sp = peptide; +} + +void PeptideEvidence::setChecked(bool arg1) { + _checked = arg1; +} + +ValidationState PeptideEvidence::getValidationState() const { + if (isGrouped()) { + return ValidationState::grouped; + } else if (isValidAndChecked()) { + return ValidationState::validAndChecked; + } else if (isValid()) { + return ValidationState::valid; + } + return ValidationState::notValid; +} + +bool PeptideEvidence::isValid() const { + return _proxy_valid; +} +bool PeptideEvidence::isChecked() const { + return _checked; +} + +bool PeptideEvidence::isValidAndChecked() const { + return _proxy_valid && _checked; +} + +bool PeptideEvidence::isGrouped() const { + if (_sp_grp_peptide.get() == nullptr) { + return false; + } + if (_sp_grp_peptide.get()->getGroupNumber() ==0) { + return false; + } + return true; +} +void PeptideEvidence::setIdentificationDataSource(IdentificationDataSource* identification_source) { + _p_identification_source = identification_source; +} +IdentificationDataSource* PeptideEvidence::getIdentificationDataSource () const { + return _p_identification_source; +} +unsigned int PeptideEvidence::getScan() const { + return _scan; +} +pappso::pappso_double PeptideEvidence::getRetentionTime() const { + return _rt; +} +unsigned int PeptideEvidence::getCharge() const { + return _charge; +} + +const PeptideXtpSp & PeptideEvidence::getPeptideXtpSp() const { + //if (_sp_grp_peptide.get() == nullptr) { + // throw pappso::PappsoException(QObject::tr("Peptide is null in %1 %2").arg(_msrunid_sp->getXmlId()).arg(this->getScan())); + //} + return _peptide_sp; +} + +const MsRun * PeptideEvidence::getMsRunP() const { + return _msrunid_sp; +} +void PeptideEvidence::setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide) { + _sp_grp_peptide =sp_grp_peptide; +} + +const pappso::GrpPeptideSp & PeptideEvidence::getGrpPeptideSp() const { + return _sp_grp_peptide; +} + diff --git a/src/core/peptideevidence.h b/src/core/peptideevidence.h new file mode 100644 index 0000000000000000000000000000000000000000..6ecbb1a2d48fb9d589fb2740af49429f40e1b6f9 --- /dev/null +++ b/src/core/peptideevidence.h @@ -0,0 +1,159 @@ +/** + * \file utils/peptideevidence.h + * \date 18/11/2017 + * \author Olivier Langella + * \brief peptide evidence : a peptide sequence + spectrum + identification engine evaluation (psm) + */ + + +/******************************************************************************* +* Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>. +* +* This file is part of XTPcpp. +* +* XTPcpp is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* XTPcpp is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>. +* +* Contributors: +* Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and implementation +******************************************************************************/ +#ifndef PEPTIDEEVIDENCE_H +#define PEPTIDEEVIDENCE_H + +#include <pappsomspp/types.h> +#include "peptidextp.h" +#include "identification_sources/identificationdatasource.h" +#include "automaticfilterparameters.h" +#include "msrun.h" + +#include "../grouping/groupingexperiment.h" + +class PeptideEvidence; + +/** \brief shared pointer on a Peptide object + */ +typedef std::shared_ptr<PeptideEvidence> PeptideEvidenceSp; + +class PeptideEvidence +{ +public : + PeptideEvidence(MsRun * msrunid_sp, unsigned int scan); + PeptideEvidence(const PeptideEvidence & other); + std::size_t getHashSampleScan() const; + std::size_t getHashPeptideMassSample() const; + + PeptideEvidenceSp makePeptideEvidenceSp() const; + + void setRetentionTime(pappso::pappso_double rt); + void setEvalue(pappso::pappso_double evalue); + + /** @brief get experimental mass of this peptide + * @return the computed mass given the precursor measured mass and the deduced peptide charge + */ + pappso::pappso_double getExperimentalMass() const; + + /** @brief get experimental mz of this peptide + * @return the real mass measured (precuror mass) by the spectrometer + */ + pappso::pappso_double getExperimentalMz() const; + + + /** @brief set experimental mass of this peptide + * @arg exp_mass the computed mass given the precursor measured mass and the deduced peptide charge + */ + 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; + + const std::map<PeptideMatchParam, QVariant> & getParamList() const; + + + /** @brief set start position of this peptide inside the protein sequence + * @param start position in the protein amino acid sequence (starts at 0) + * */ + void setStart(unsigned int start); + /** @brief get start position of this peptide inside the protein sequence + * @return start position in the protein amino acid sequence (starts at 0) + * */ + unsigned int getStart() const; + /** @brief get stop position of this peptide inside the protein sequence + * @return stop position in the protein amino acid sequence (starts at 0) + * */ + unsigned int getStop() const; + void setCharge(unsigned int charge); + void setPeptideXtpSp (PeptideXtpSp peptide); + void setIdentificationDataSource(IdentificationDataSource* identification_source); + void setChecked(bool arg1); + bool isChecked() const; + bool isValid() const; + bool isValidAndChecked() const; + bool isGrouped() const; + + const MsRun * getMsRunP() const; + IdentificationDataSource* getIdentificationDataSource () const; + unsigned int getScan() const; + pappso::pappso_double getRetentionTime() const; + unsigned int getCharge() const; + const PeptideXtpSp & getPeptideXtpSp() const; + pappso::pappso_double getEvalue() const; + + void setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide); + const pappso::GrpPeptideSp & getGrpPeptideSp() const; + + /** @brief validate or invalidate peptides and proteins based automatic filters and manual checks + * */ + void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters); + + /** @brief get delta between theoretical mhplus mass and mhplus experimental mass + * theoretical mhplus mass - mhplus experimental mass + */ + pappso::mz getDeltaMass() const; + + ValidationState getValidationState() const; + + /** @brief tells if this peptide contains a protein position + * the position is the amino acid position on the protein sequence (starts from 0) + * */ + bool containsPosition(unsigned int position) const; + +private : + static std::hash<std::string> _hash_fn; + MsRun * _msrunid_sp; + unsigned int _scan; + size_t _hash_sample_scan; + pappso::GrpPeptideSp _sp_grp_peptide; + PeptideXtpSp _peptide_sp; + pappso::pappso_double _rt; + pappso::pappso_double _evalue=0; + pappso::pappso_double _exp_mass; + 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) + */ + bool _checked = true; + + /** @brief automatic filter result (false by default) + */ + bool _proxy_valid = false; +}; +#endif // PEPTIDEEVIDENCE_H diff --git a/src/core/peptidematch.cpp b/src/core/peptidematch.cpp index ad0938af0b99b32021fc746d6546510836caf011..4f600217148e06263f02c09b9daba427c1651eea 100644 --- a/src/core/peptidematch.cpp +++ b/src/core/peptidematch.cpp @@ -24,101 +24,32 @@ #include "peptidematch.h" #include <pappsomspp/pappsoexception.h> -std::hash<std::string> PeptideMatch::_hash_fn; -PeptideMatch::PeptideMatch(MsRun * msrunid_sp, unsigned int scan) { - _msrunid_sp = msrunid_sp; - _scan = scan; - - _hash_sample_scan = PeptideMatch::_hash_fn (QString("%1 %2").arg(msrunid_sp->getXmlId()).arg(_scan).toStdString()); +PeptideMatch::PeptideMatch() { } -PeptideMatch::PeptideMatch(const PeptideMatch & other): PeptideMatch(other._msrunid_sp, other._scan) { - _hash_sample_scan = other._hash_sample_scan; - _sp_grp_peptide = other._sp_grp_peptide; - _peptide_sp = other._peptide_sp; - _rt = other._rt; - _evalue = other._evalue; - _exp_mass = other._exp_mass; +PeptideMatch::PeptideMatch(const PeptideMatch & other) { _start=other._start; - _charge= other._charge; - _p_identification_source = other._p_identification_source; - _params = other._params; - _checked = other._checked; - _proxy_valid = other._proxy_valid; - -} - -PeptideMatchSp PeptideMatch::makePeptideMatchSp() const { - return std::make_shared<PeptideMatch>(*this); -} - -void PeptideMatch::updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters) { - _proxy_valid = false; - - if (_evalue <= automatic_filter_parameters.getFilterPeptideEvalue()) { - _proxy_valid = true; - } -} -void PeptideMatch::setRetentionTime(pappso::pappso_double rt) { - _rt = 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(); - } -} -const std::map<PeptideMatchParam, QVariant> & PeptideMatch::getParamList() const { - return _params; -} + _p_peptide_evidence = other._p_peptide_evidence; -std::size_t PeptideMatch::getHashPeptideMassSample() const { - return PeptideMatch::_hash_fn (QString("%1 %2").arg(_peptide_sp.get()->toAbsoluteString()).arg(_msrunid_sp->getXmlId()).toStdString()); } - -std::size_t PeptideMatch::getHashSampleScan() const { - return _hash_sample_scan; +void PeptideMatch::setPeptideEvidenceSp(PeptideEvidenceSp sp_peptide_evidence) { + _p_peptide_evidence = sp_peptide_evidence.get(); } -pappso::pappso_double PeptideMatch::getEvalue() const { - return _evalue; -} -pappso::pappso_double PeptideMatch::getExperimentalMass() const { - return _exp_mass; -} -pappso::pappso_double PeptideMatch::getExperimentalMz() const { - pappso::mz mz = _exp_mass; - for (unsigned int i=0; i < _charge; i++) { - mz+=pappso::MHPLUS; - } - mz = mz/_charge; - return mz; +const PeptideEvidence * PeptideMatch::getPeptideEvidence() const { + return _p_peptide_evidence; } -void PeptideMatch::setExperimentalMass(pappso::pappso_double exp_mass) { - _exp_mass =exp_mass; +PeptideEvidence * PeptideMatch::getPeptideEvidence() { + return _p_peptide_evidence; } void PeptideMatch::setStart(unsigned int start) { _start =start; } -pappso::mz PeptideMatch::getDeltaMass() const { - return (_peptide_sp.get()->getMz(1) - (_exp_mass+pappso::MHPLUS)); -} unsigned int PeptideMatch::getStart() const { return _start; } unsigned int PeptideMatch::getStop() const { - return _start+_peptide_sp.get()->size(); + return _start+_p_peptide_evidence->getPeptideXtpSp().get()->size(); } bool PeptideMatch::containsPosition(unsigned int position) const { @@ -131,79 +62,3 @@ bool PeptideMatch::containsPosition(unsigned int position) const { return false; } -void PeptideMatch::setCharge(unsigned int charge) { - _charge =charge; -} - -void PeptideMatch::setPeptideXtpSp (PeptideXtpSp peptide) { - _peptide_sp = peptide; -} - -void PeptideMatch::setChecked(bool arg1) { - _checked = arg1; -} - -ValidationState PeptideMatch::getValidationState() const { - if (isGrouped()) { - return ValidationState::grouped; - } else if (isValidAndChecked()) { - return ValidationState::validAndChecked; - } else if (isValid()) { - return ValidationState::valid; - } - return ValidationState::notValid; -} - -bool PeptideMatch::isValid() const { - return _proxy_valid; -} -bool PeptideMatch::isChecked() const { - return _checked; -} - -bool PeptideMatch::isValidAndChecked() const { - return _proxy_valid && _checked; -} - -bool PeptideMatch::isGrouped() const { - if (_sp_grp_peptide.get() == nullptr) { - return false; - } - if (_sp_grp_peptide.get()->getGroupNumber() ==0) { - return false; - } - return true; -} -void PeptideMatch::setIdentificationDataSource(IdentificationDataSource* identification_source) { - _p_identification_source = identification_source; -} -IdentificationDataSource* PeptideMatch::getIdentificationDataSource () const { - return _p_identification_source; -} -unsigned int PeptideMatch::getScan() const { - return _scan; -} -pappso::pappso_double PeptideMatch::getRetentionTime() const { - return _rt; -} -unsigned int PeptideMatch::getCharge() const { - return _charge; -} - -const PeptideXtpSp & PeptideMatch::getPeptideXtpSp() const { - //if (_sp_grp_peptide.get() == nullptr) { - // throw pappso::PappsoException(QObject::tr("Peptide is null in %1 %2").arg(_msrunid_sp->getXmlId()).arg(this->getScan())); - //} - return _peptide_sp; -} - -const MsRun * PeptideMatch::getMsRunP() const { - return _msrunid_sp; -} -void PeptideMatch::setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide) { - _sp_grp_peptide =sp_grp_peptide; -} - -const pappso::GrpPeptideSp & PeptideMatch::getGrpPeptideSp() const { - return _sp_grp_peptide; -} diff --git a/src/core/peptidematch.h b/src/core/peptidematch.h index 2f28bfe01659eb88122fe2077126c64f3236bb20..1794efc211c2adf75b0789f1b07a91a4a9ad678b 100644 --- a/src/core/peptidematch.h +++ b/src/core/peptidematch.h @@ -23,59 +23,14 @@ #ifndef PEPTIDEMATCH_H #define PEPTIDEMATCH_H -#include <pappsomspp/types.h> -#include "peptidextp.h" -#include "identification_sources/identificationdatasource.h" -#include "automaticfilterparameters.h" -#include "msrun.h" +#include "peptideevidence.h" -#include "../grouping/groupingexperiment.h" - -class PeptideMatch; - -/** \brief shared pointer on a Peptide object - */ -typedef std::shared_ptr<PeptideMatch> PeptideMatchSp; class PeptideMatch { public : - PeptideMatch(MsRun * msrunid_sp, unsigned int scan); + PeptideMatch(); PeptideMatch(const PeptideMatch & other); - std::size_t getHashSampleScan() const; - std::size_t getHashPeptideMassSample() const; - - PeptideMatchSp makePeptideMatchSp() const; - - void setRetentionTime(pappso::pappso_double rt); - void setEvalue(pappso::pappso_double evalue); - - /** @brief get experimental mass of this peptide - * @return the computed mass given the precursor measured mass and the deduced peptide charge - */ - pappso::pappso_double getExperimentalMass() const; - - /** @brief get experimental mz of this peptide - * @return the real mass measured (precuror mass) by the spectrometer - */ - pappso::pappso_double getExperimentalMz() const; - - - /** @brief set experimental mass of this peptide - * @arg exp_mass the computed mass given the precursor measured mass and the deduced peptide charge - */ - 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; - - const std::map<PeptideMatchParam, QVariant> & getParamList() const; /** @brief set start position of this peptide inside the protein sequence @@ -90,64 +45,19 @@ public : * @return stop position in the protein amino acid sequence (starts at 0) * */ unsigned int getStop() const; - void setCharge(unsigned int charge); - void setPeptideXtpSp (PeptideXtpSp peptide); - void setIdentificationDataSource(IdentificationDataSource* identification_source); - void setChecked(bool arg1); - bool isChecked() const; - bool isValid() const; - bool isValidAndChecked() const; - bool isGrouped() const; - - const MsRun * getMsRunP() const; - IdentificationDataSource* getIdentificationDataSource () const; - unsigned int getScan() const; - pappso::pappso_double getRetentionTime() const; - unsigned int getCharge() const; - const PeptideXtpSp & getPeptideXtpSp() const; - pappso::pappso_double getEvalue() const; - - void setGrpPeptideSp(const pappso::GrpPeptideSp & sp_grp_peptide); - const pappso::GrpPeptideSp & getGrpPeptideSp() const; - - /** @brief validate or invalidate peptides and proteins based automatic filters and manual checks - * */ - void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters); - - /** @brief get delta between theoretical mhplus mass and mhplus experimental mass - * theoretical mhplus mass - mhplus experimental mass - */ - pappso::mz getDeltaMass() const; - - ValidationState getValidationState() const; /** @brief tells if this peptide contains a protein position * the position is the amino acid position on the protein sequence (starts from 0) * */ bool containsPosition(unsigned int position) const; + + void setPeptideEvidenceSp(PeptideEvidenceSp sp_peptide_evidence); + const PeptideEvidence * getPeptideEvidence() const; + PeptideEvidence * getPeptideEvidence(); private : - static std::hash<std::string> _hash_fn; - MsRun * _msrunid_sp; - unsigned int _scan; - size_t _hash_sample_scan; - pappso::GrpPeptideSp _sp_grp_peptide; - PeptideXtpSp _peptide_sp; - pappso::pappso_double _rt; - pappso::pappso_double _evalue=0; - pappso::pappso_double _exp_mass; 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) - */ - bool _checked = true; - - /** @brief automatic filter result (false by default) - */ - bool _proxy_valid = false; + PeptideEvidence * _p_peptide_evidence=nullptr; }; #endif // PEPTIDEMATCH_H diff --git a/src/core/proteinmatch.h b/src/core/proteinmatch.h index e4d0c66065d289ef68f1ac2aba57858097a6724e..4652c3edcbd02a97c07d2d8228b031a4d4ac33b8 100644 --- a/src/core/proteinmatch.h +++ b/src/core/proteinmatch.h @@ -74,7 +74,7 @@ public: pappso::pappso_double getEmPAI(const MsRun * sp_msrun_id = nullptr) const; void setProteinXtpSp(ProteinXtpSp protein_sp); - void addPeptideMatchSp(PeptideMatchSp peptide_match); + void addPeptideMatch(const PeptideMatch & peptide_match); std::vector<PeptideMatch *> & getPeptideMatchList(); const std::vector<PeptideMatch *> & getPeptideMatchList() const; diff --git a/src/utils/peptidematchstore.cpp b/src/utils/peptideevidencestore.cpp similarity index 79% rename from src/utils/peptidematchstore.cpp rename to src/utils/peptideevidencestore.cpp index f2fbef9d23db3c0af8acd1d69ada99f871fe7c2e..1de93d17124eb44d42a6db76ab282597805592a6 100644 --- a/src/utils/peptidematchstore.cpp +++ b/src/utils/peptideevidencestore.cpp @@ -1,11 +1,12 @@ /** - * \file utils/peptidematchstore.cpp + * \file utils/peptideevidencestore.cpp * \date 18/11/2017 * \author Olivier Langella - * \brief store unique instances of peptide match + * \brief store unique instances of peptide evidences */ + /******************************************************************************* * Copyright (c) 2017 Olivier Langella <Olivier.Langella@u-psud.fr>. * @@ -28,9 +29,9 @@ * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and implementation ******************************************************************************/ -#include "peptidematchstore.h" +#include "peptideevidencestore.h" -#include "../core/peptidematch.h" +#include "../core/peptideevidence.h" -std::shared_ptr<PeptideMatch> & PeptideMatchStore::getInstance(const PeptideMatch * p_peptide_match) { +std::shared_ptr<PeptideEvidence> & PeptideEvidenceStore::getInstance(const PeptideEvidence * p_peptide_evidence) { } diff --git a/src/utils/peptidematchstore.h b/src/utils/peptideevidencestore.h similarity index 77% rename from src/utils/peptidematchstore.h rename to src/utils/peptideevidencestore.h index 912f17382144844351dfd6b709a3e771d31c200b..14727d03def2d7c807f3efba4ae10b202715cc5b 100644 --- a/src/utils/peptidematchstore.h +++ b/src/utils/peptideevidencestore.h @@ -1,8 +1,8 @@ /** - * \file utils/peptidematchstore.h + * \file utils/peptideevidencestore.h * \date 18/11/2017 * \author Olivier Langella - * \brief store unique instances of peptide match + * \brief store unique instances of peptide evidences */ @@ -28,17 +28,17 @@ * Olivier Langella <Olivier.Langella@u-psud.fr> - initial API and implementation ******************************************************************************/ -#ifndef PEPTIDEMATCHSTORE_H -#define PEPTIDEMATCHSTORE_H +#ifndef PEPTIDEEVIDENCESTORE_H +#define PEPTIDEEVIDENCESTORE_H #include <memory> -class PeptideMatch; +class PeptideEvidence; -class PeptideMatchStore +class PeptideEvidenceStore { public: - std::shared_ptr<PeptideMatch> & getInstance(const PeptideMatch * p_peptide_match); + std::shared_ptr<PeptideEvidence> & getInstance(const PeptideEvidence * p_peptide_evidence); }; -#endif // PEPTIDEMATCHSTORE_H +#endif // PEPTIDEEVIDENCESTORE_H