OpenMS
Loading...
Searching...
No Matches
ConsensusIDAlgorithm.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: Hendrik Weisser $
6// $Authors: Andreas Bertsch, Marc Sturm, Sven Nahnsen, Hendrik Weisser $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14#include <map>
15#include <vector>
16
17namespace OpenMS
18{
34 class OPENMS_DLLAPI ConsensusIDAlgorithm : public DefaultParamHandler
35 {
36 public:
47 void apply(PeptideIdentificationList& ids, const std::map<String, String>& se_info, Size number_of_runs = 0);
48
49 void apply(PeptideIdentificationList& ids, Size number_of_runs = 0);
50
53
54 protected:
55 struct HitInfo {
57 std::vector<double> scores;
58 std::vector<String> types;
59 // in case too much information is stored, TD and evidence
60 // could be re-annotated with PeptideIndexer later
62 std::set<PeptideEvidence> evidence;
64 double support;
65 // TODO: we could gather spectrum_refs here as well,
66 // to support passing of spectrum_ref if ALL refs of a group are the same
67 // For now, we do it in the ConsensusID TOPP tool class in cases where we
68 // know that refs will be the same.
69 };
70
72 typedef std::map<AASequence, HitInfo> SequenceGrouping;
73
76
79
82
85
88
91
99 virtual void apply_(PeptideIdentificationList& ids, const std::map<String, String>& se_info, SequenceGrouping& results) = 0;
100
102 void updateMembers_() override;
103
105 void compareChargeStates_(Int& recorded_charge, Int new_charge, const AASequence& peptide);
106
107 private:
110
113 };
114
115} // namespace OpenMS
Representation of a peptide/protein sequence.
Definition AASequence.h:88
Abstract base class for all ConsensusID algorithms (that calculate a consensus from multiple ID runs)...
Definition ConsensusIDAlgorithm.h:35
void compareChargeStates_(Int &recorded_charge, Int new_charge, const AASequence &peptide)
Compare (and possibly update) charge state information.
Size considered_hits_
Number of peptide hits considered per ID run (input parameter)
Definition ConsensusIDAlgorithm.h:75
std::set< PeptideEvidence > evidence
Definition ConsensusIDAlgorithm.h:62
double support
Definition ConsensusIDAlgorithm.h:64
String target_decoy
Definition ConsensusIDAlgorithm.h:61
std::vector< double > scores
Definition ConsensusIDAlgorithm.h:57
Size number_of_runs_
Number of ID runs.
Definition ConsensusIDAlgorithm.h:78
void apply(PeptideIdentificationList &ids, const std::map< String, String > &se_info, Size number_of_runs=0)
Calculates the consensus ID for a set of peptide identifications of one spectrum or (consensus) featu...
double min_support_
Fraction of required support by other ID runs (input parameter)
Definition ConsensusIDAlgorithm.h:81
bool count_empty_
Count empty runs in "min_support" calculation? (input parameter)
Definition ConsensusIDAlgorithm.h:84
ConsensusIDAlgorithm & operator=(const ConsensusIDAlgorithm &)=delete
Not implemented.
Int charge
Definition ConsensusIDAlgorithm.h:56
std::map< AASequence, HitInfo > SequenceGrouping
Mapping: peptide sequence -> (charge, scores)
Definition ConsensusIDAlgorithm.h:72
void apply(PeptideIdentificationList &ids, Size number_of_runs=0)
bool keep_old_scores_
Keep old scores?
Definition ConsensusIDAlgorithm.h:87
ConsensusIDAlgorithm()
Default constructor.
double final_score
Definition ConsensusIDAlgorithm.h:63
void updateMembers_() override
Docu in base class.
ConsensusIDAlgorithm(const ConsensusIDAlgorithm &)=delete
Not implemented.
std::vector< String > types
Definition ConsensusIDAlgorithm.h:58
virtual void apply_(PeptideIdentificationList &ids, const std::map< String, String > &se_info, SequenceGrouping &results)=0
Consensus computation (to be implemented by subclasses).
~ConsensusIDAlgorithm() override
Virtual destructor.
Definition ConsensusIDAlgorithm.h:55
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Container for peptide identifications from multiple spectra.
Definition PeptideIdentificationList.h:66
A more convenient string class.
Definition String.h:34
int Int
Signed integer type.
Definition Types.h:72
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