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

peptide/mass are counted per valid proteins

parent b0a021b6
No related branches found
No related tags found
No related merge requests found
......@@ -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()) {
......
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