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

change in mass delta compute : a peptide evidence is only counted once

parent f7a0540b
No related branches found
No related tags found
No related merge requests found
......@@ -209,11 +209,11 @@ 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;
std::set<const PeptideEvidence *> already_counted;
for (auto & p_protein_match : _protein_match_list) {
if (p_protein_match->getValidationState() >= state) {
if (!p_protein_match->getProteinXtpSp().get()->isDecoy()) {
p_protein_match->collectMhDelta(delta_list, unit, state);
p_protein_match->collectMhDelta(already_counted, delta_list, unit, state);
}
}
}
......
......@@ -445,17 +445,19 @@ void ProteinMatch::setGroupInstance(GroupStore & group_store) {
}
void ProteinMatch::collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const {
void ProteinMatch::collectMhDelta(std::set< const PeptideEvidence *> & already_counted, std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const {
for (auto & peptide_match : _peptide_match_list) {
if (peptide_match.getPeptideEvidence()->getValidationState() >= state) {
pappso::pappso_double diff = peptide_match.getPeptideEvidence()->getDeltaMass();
const PeptideEvidence * p_peptide_evidence = peptide_match.getPeptideEvidence();
if ((p_peptide_evidence->getValidationState() >= state)&&(already_counted.find(p_peptide_evidence) == already_counted.end())) {
pappso::pappso_double diff = p_peptide_evidence->getDeltaMass();
if (unit == pappso::PrecisionUnit::ppm) {
while (diff < -0.5) {
diff = diff + pappso::DIFFC12C13;
}
diff = (diff / peptide_match.getPeptideEvidence()->getPeptideXtpSp().get()->getMz(1)) * pappso::ONEMILLION;
diff = (diff / p_peptide_evidence->getPeptideXtpSp().get()->getMz(1)) * pappso::ONEMILLION;
}
delta_list.push_back(diff);
already_counted.insert(p_peptide_evidence);
}
}
}
......@@ -23,6 +23,7 @@
#include <QColor>
#include <vector>
#include <set>
#include <pappsomspp/types.h>
#include "proteinxtp.h"
#include "peptidematch.h"
......@@ -113,7 +114,10 @@ public:
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
void collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const;
/** @brief collect mass delta between theoretical mass and observed mass
* each peptide evidence is only counted once
*/
void collectMhDelta(std::set<const PeptideEvidence *> & already_counted, std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const;
/** @brief count distinct sequence taking into account equivalence between Leucine and Isoleucine
* @param state validation state of peptides to count
......
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