diff --git a/src/core/identificationgroup.cpp b/src/core/identificationgroup.cpp index 36ed21580d10cdc21d0da720c8fe8f2757c27f22..be027124b05c5bfd7f31d2d89b91e069f7305dc9 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()) {