From f964928020a032dcb6d05832b20d8f13938f42db Mon Sep 17 00:00:00 2001 From: Olivier Langella <olivier.langella@u-psud.fr> Date: Sat, 16 Dec 2017 22:45:34 +0100 Subject: [PATCH] peptide/mass are counted per valid proteins --- src/core/identificationgroup.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index 36ed21580..be027124b 100644 --- a/src/core/identificationgroup.cpp +++ b/src/core/identificationgroup.cpp @@ -42,7 +42,7 @@ IdentificationGroup::~IdentificationGroup() } const PtmGroupingExperiment * IdentificationGroup::getPtmGroupingExperiment() const { - return _p_grp_ptm_experiment; + return _p_grp_ptm_experiment; } const GroupStore & IdentificationGroup::getGroupStore() const { return _group_store; @@ -52,7 +52,9 @@ unsigned int IdentificationGroup::countPeptideMass(ValidationState state) const std::vector<pappso::GrpPeptide *> count_peptide_mass; for (auto & p_protein_match : _protein_match_list) { - p_protein_match->countPeptideMass(count_peptide_mass, state); + if (p_protein_match->getValidationState() >= state) { + p_protein_match->countPeptideMass(count_peptide_mass, state); + } } std::sort(count_peptide_mass.begin(), count_peptide_mass.end()); auto last = std::unique(count_peptide_mass.begin(),count_peptide_mass.end()); @@ -63,7 +65,9 @@ unsigned int IdentificationGroup::countPeptideMassSample(ValidationState state) std::vector<std::size_t> count_peptide_mass_sample; for (auto & p_protein_match : _protein_match_list) { - p_protein_match->countPeptideMassSample(count_peptide_mass_sample, state); + if (p_protein_match->getValidationState() >= state) { + p_protein_match->countPeptideMassSample(count_peptide_mass_sample, state); + } } std::sort(count_peptide_mass_sample.begin(), count_peptide_mass_sample.end()); auto last = std::unique(count_peptide_mass_sample.begin(),count_peptide_mass_sample.end()); @@ -74,7 +78,9 @@ unsigned int IdentificationGroup::countDecoyPeptideMassSample(ValidationState st std::vector<std::size_t> count_peptide_mass_sample; for (auto & p_protein_match : _protein_match_list) { if (p_protein_match->getProteinXtpSp().get()->isDecoy()) { - p_protein_match->countPeptideMassSample(count_peptide_mass_sample, state); + if (p_protein_match->getValidationState() >= state) { + p_protein_match->countPeptideMassSample(count_peptide_mass_sample, state); + } } } std::sort(count_peptide_mass_sample.begin(), count_peptide_mass_sample.end()); @@ -86,11 +92,11 @@ unsigned int IdentificationGroup::countDecoyPeptideMassSample(ValidationState st unsigned int IdentificationGroup::countDecoyPeptideMatch(ValidationState state) const { unsigned int i=0; for (auto & p_protein_match : _protein_match_list) { - //if (p_protein_match->getValidationState() == state) { - if (p_protein_match->getProteinXtpSp().get()->isDecoy()) { - i+=p_protein_match->countPeptideMatch(state); + if (p_protein_match->getValidationState() >= state) { + if (p_protein_match->getProteinXtpSp().get()->isDecoy()) { + i+=p_protein_match->countPeptideMatch(state); + } } - //} } return i; } @@ -108,9 +114,9 @@ unsigned int IdentificationGroup::countDecoyProteinMatch(ValidationState state) unsigned int IdentificationGroup::countPeptideMatch(ValidationState state) const { unsigned int i=0; for (auto & p_protein_match : _protein_match_list) { - //if (p_protein_match->getValidationState() >= state) { - i+=p_protein_match->countPeptideMatch(state); - //} + if (p_protein_match->getValidationState() >= state) { + i+=p_protein_match->countPeptideMatch(state); + } } return i; } @@ -203,6 +209,7 @@ std::size_t IdentificationGroup::countSubGroup()const { } void IdentificationGroup::collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const { + std::set<PeptideEvidence *> already_counted; for (auto & p_protein_match : _protein_match_list) { if (p_protein_match->getValidationState() >= state) { if (!p_protein_match->getProteinXtpSp().get()->isDecoy()) { -- GitLab