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

refactoring

parent 51144af4
No related branches found
No related tags found
No related merge requests found
......@@ -231,14 +231,24 @@ std::size_t IdentificationGroup::countSubGroup()const {
}
void IdentificationGroup::collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const {
std::set<const PeptideEvidence *> already_counted;
std::set<const PeptideEvidence *> peptide_evidence_list;
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(already_counted, delta_list, unit, state);
//p_protein_match->collectMhDelta(already_counted, delta_list, unit, state);
p_protein_match->collectPeptideEvidences(peptide_evidence_list, state);
}
}
}
for (const PeptideEvidence * p_peptide_evidence: peptide_evidence_list) {
if (unit == pappso::PrecisionUnit::ppm) {
delta_list.push_back(p_peptide_evidence->getPpmDeltaMass());
}
else {
delta_list.push_back(p_peptide_evidence->getDeltaMass());
}
}
}
void IdentificationGroup::startGrouping (const GroupingType & grouping_type, WorkMonitorInterface * p_work_monitor) {
qDebug() << "IdentificationGroup::startGrouping begin ";
......
......@@ -126,6 +126,10 @@ public:
bool contains (const MsRun * p_msrun) const;
/** @brief collect mass delta between theoretical mass and observed mass
* each peptide evidence is only counted once
*/
void collectMhDelta(std::vector< pappso::pappso_double> & delta_list, pappso::PrecisionUnit unit, ValidationState state) const;
private :
......
......@@ -445,22 +445,6 @@ void ProteinMatch::setGroupInstance(GroupStore & group_store) {
}
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) {
const PeptideEvidence * p_peptide_evidence = peptide_match.getPeptideEvidence();
if ((p_peptide_evidence->getValidationState() >= state)&&(already_counted.find(p_peptide_evidence) == already_counted.end())) {
if (unit == pappso::PrecisionUnit::ppm) {
delta_list.push_back(p_peptide_evidence->getPpmDeltaMass());
}
else {
delta_list.push_back(p_peptide_evidence->getDeltaMass());
}
already_counted.insert(p_peptide_evidence);
}
}
}
void ProteinMatch::collectPeptideEvidences(std::set<const PeptideEvidence *> & peptide_evidence_set, ValidationState state) const {
for (auto & peptide_match : _peptide_match_list) {
const PeptideEvidence * p_peptide_evidence = peptide_match.getPeptideEvidence();
......
......@@ -114,10 +114,6 @@ public:
* */
void updateAutomaticFilters(const AutomaticFilterParameters & automatic_filter_parameters);
/** @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 collect distinct peptide evidences
*/
......
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