OpenMS
Loading...
Searching...
No Matches
BasicProteinInferenceAlgorithm.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Julianus Pfeuffer $
6// $Authors: Julianus Pfeuffer $
7// --------------------------------------------------------------------------
8#pragma once
9
17
18namespace OpenMS
19{
20
59 class OPENMS_DLLAPI BasicProteinInferenceAlgorithm :
61 public ProgressLogger
62 {
63 public:
64
65 typedef std::unordered_map<std::string, std::map<Int, PeptideHit*>> SequenceToChargeToPSM;
66
71 {
72 PROD,
73 SUM,
74 BEST
75 };
76
79
93 void run(PeptideIdentificationList& pep_ids, std::vector<ProteinIdentification>& prot_ids) const;
94
106
121 void run(ConsensusMap& cmap, ProteinIdentification& prot_id, bool include_unassigned) const;
122
139 const PeptideIdentificationList& peptides,
140 Size use_top_psms = 1,
141 bool add_singletons = true);
142
143 private:
144
155 std::unordered_map<std::string, std::pair<ProteinHit*, Size>>& acc_to_protein_hitP_and_count,
156 SequenceToChargeToPSM& best_pep,
157 ProteinIdentification& prot_run,
158 PeptideIdentificationList& pep_ids) const;
159
169 SequenceToChargeToPSM& best_pep,
171 const std::string& overall_score_type,
172 bool higher_better,
173 const std::string& run_id) const;
174
184 std::unordered_map<std::string, std::pair<ProteinHit*, Size>>& acc_to_protein_hitP_and_count,
185 const SequenceToChargeToPSM& best_pep,
186 bool pep_scores,
187 bool higher_better) const;
188
198 AggregationMethod aggFromString_(const std::string& method_string) const;
199
210 const std::string& score_type,
211 const AggregationMethod& aggregation_method
212 ) const;
213
221 const IDScoreSwitcherAlgorithm::ScoreType& score_type,
222 const AggregationMethod& aggregation_method
223 ) const;
224
235 double getInitScoreForAggMethod_(const AggregationMethod& aggregation_method, bool higher_better) const;
236
238 typedef double (*fptr)(double, double);
239
247 fptr aggFunFromEnum_(const BasicProteinInferenceAlgorithm::AggregationMethod& agg_method, bool higher_better) const;
248 };
249} //namespace OpenMS
Simple protein inference by aggregation of per-peptide PSM scores.
Definition BasicProteinInferenceAlgorithm.h:62
static void annotateIndistinguishableGroups(ProteinIdentification &proteins, const PeptideIdentificationList &peptides, Size use_top_psms=1, bool add_singletons=true)
Computes the indistinguishable protein groups of one run, without scoring anything.
BasicProteinInferenceAlgorithm()
Default constructor.
void checkCompat_(const IDScoreSwitcherAlgorithm::ScoreType &score_type, const AggregationMethod &aggregation_method) const
Same as the string overload, but takes a typed IDScoreSwitcherAlgorithm::ScoreType so the check can b...
void run(PeptideIdentificationList &pep_ids, std::vector< ProteinIdentification > &prot_ids) const
Run inference per protein-ID run, iterating each prot_ids entry separately.
void updateProteinScores_(std::unordered_map< std::string, std::pair< ProteinHit *, Size > > &acc_to_protein_hitP_and_count, const SequenceToChargeToPSM &best_pep, bool pep_scores, bool higher_better) const
aggregates and updates protein scores based on aggregation settings and aggregated peptide level resu...
void checkCompat_(const std::string &score_type, const AggregationMethod &aggregation_method) const
Reject score-type / aggregation-method combinations that don't make statistical sense.
std::unordered_map< std::string, std::map< Int, PeptideHit * > > SequenceToChargeToPSM
Definition BasicProteinInferenceAlgorithm.h:65
void run(ConsensusMap &cmap, ProteinIdentification &prot_id, bool include_unassigned) const
Run inference over a ConsensusMap, treating every peptide identification it carries as evidence for t...
void processRun_(std::unordered_map< std::string, std::pair< ProteinHit *, Size > > &acc_to_protein_hitP_and_count, SequenceToChargeToPSM &best_pep, ProteinIdentification &prot_run, PeptideIdentificationList &pep_ids) const
Performs simple aggregation-based inference on one protein run.
double getInitScoreForAggMethod_(const AggregationMethod &aggregation_method, bool higher_better) const
Return the identity-element initial score for the chosen aggregation method.
void run(PeptideIdentificationList &pep_ids, ProteinIdentification &prot_id) const
Run inference for a single protein-ID run.
AggregationMethod
The aggregation method.
Definition BasicProteinInferenceAlgorithm.h:71
AggregationMethod aggFromString_(const std::string &method_string) const
Map a score_aggregation_method parameter string to the AggregationMethod enum.
void aggregatePeptideScores_(SequenceToChargeToPSM &best_pep, PeptideIdentificationList &pep_ids, const std::string &overall_score_type, bool higher_better, const std::string &run_id) const
fills and updates the map of best peptide scores best_pep (by sequence or modified sequence,...
fptr aggFunFromEnum_(const BasicProteinInferenceAlgorithm::AggregationMethod &agg_method, bool higher_better) const
Pick the two-argument accumulator function matching the chosen aggregation method.
A container for consensus elements.
Definition ConsensusMap.h:67
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
Base class for all classes that want to report their progress.
Definition ProgressLogger.h:28
Representation of a protein identification run.
Definition ProteinIdentification.h:55
IDType
Hierarchy of possible score types in MS identification.
Definition Scores.h:51
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19