OpenMS  2.8.0
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
ConsensusIDAlgorithm Class Referenceabstract

Abstract base class for all ConsensusID algorithms (that calculate a consensus from multiple ID runs). More...

#include <OpenMS/ANALYSIS/ID/ConsensusIDAlgorithm.h>

Inheritance diagram for ConsensusIDAlgorithm:
[legend]
Collaboration diagram for ConsensusIDAlgorithm:
[legend]

Classes

struct  HitInfo
 

Public Member Functions

void apply (std::vector< PeptideIdentification > &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) feature. More...
 
void apply (std::vector< PeptideIdentification > &ids, Size number_of_runs=0)
 
 ~ConsensusIDAlgorithm () override
 Virtual destructor. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
virtual DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Protected Types

typedef std::map< AASequence, HitInfoSequenceGrouping
 Mapping: peptide sequence -> (charge, scores) More...
 

Protected Member Functions

 ConsensusIDAlgorithm ()
 Default constructor. More...
 
virtual void apply_ (std::vector< PeptideIdentification > &ids, const std::map< String, String > &se_info, SequenceGrouping &results)=0
 Consensus computation (to be implemented by subclasses). More...
 
void updateMembers_ () override
 Docu in base class. More...
 
void compareChargeStates_ (Int &recorded_charge, Int new_charge, const AASequence &peptide)
 Compare (and possibly update) charge state information. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

Size considered_hits_
 Number of peptide hits considered per ID run (input parameter) More...
 
Size number_of_runs_
 Number of ID runs. More...
 
double min_support_
 Fraction of required support by other ID runs (input parameter) More...
 
bool count_empty_
 Count empty runs in "min_support" calculation? (input parameter) More...
 
bool keep_old_scores_
 Keep old scores? More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Private Member Functions

 ConsensusIDAlgorithm (const ConsensusIDAlgorithm &)
 Not implemented. More...
 
ConsensusIDAlgorithmoperator= (const ConsensusIDAlgorithm &)
 Not implemented. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 

Detailed Description

Abstract base class for all ConsensusID algorithms (that calculate a consensus from multiple ID runs).

The main function is apply(), which aggregates several peptide identifications into one.

Derived classes should implement apply_(), which takes a list of peptide identifications and produces a map of peptide sequences with accompanying scores (and charge states). Currently there are two derived classes, OpenMS::ConsensusIDAlgorithmIdentity and OpenMS::ConsensusIDAlgorithmSimilarity. They serve as abstract base classes for algorithms that score only identical peptide sequences together and algorithms that take similarities between peptides into account, respectively.

See also the documentation of the TOPP tool, ConsensusID, for more information (e.g. on the filter: parameters).

Parameters of this class are:

NameTypeDefaultRestrictionsDescription
filter:considered_hits int0 min: 0The number of top hits in each ID run that are considered for consensus scoring ('0' for all hits).
filter:min_support float0.0 min: 0.0 max: 1.0For each peptide hit from an ID run, the fraction of other ID runs that must support that hit (otherwise it is removed).
filter:count_empty stringfalse true, falseCount empty ID runs (i.e. those containing no peptide hit for the current spectrum) when calculating 'min_support'?
filter:keep_old_scores stringfalse true, falseif set, keeps the original scores as user params

Note:

Class Documentation

◆ OpenMS::ConsensusIDAlgorithm::HitInfo

struct OpenMS::ConsensusIDAlgorithm::HitInfo
Collaboration diagram for ConsensusIDAlgorithm::HitInfo:
[legend]
Class Members
Int charge
set< PeptideEvidence > evidence
double final_score
vector< double > scores
double support
String target_decoy
vector< String > types

Member Typedef Documentation

◆ SequenceGrouping

typedef std::map<AASequence, HitInfo> SequenceGrouping
protected

Mapping: peptide sequence -> (charge, scores)

Constructor & Destructor Documentation

◆ ~ConsensusIDAlgorithm()

~ConsensusIDAlgorithm ( )
override

Virtual destructor.

◆ ConsensusIDAlgorithm() [1/2]

ConsensusIDAlgorithm ( )
protected

Default constructor.

◆ ConsensusIDAlgorithm() [2/2]

Not implemented.

Member Function Documentation

◆ apply() [1/2]

void apply ( std::vector< PeptideIdentification > &  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) feature.

Make sure that the score type (PeptideIdentification::getScoreType()) and the score orientation (PeptideIdentification::isHigherScoreBetter()) are set properly!

Parameters
idsPeptide identifications (input: more than one, output: one)
number_of_runsNumber of ID runs (default: size of "ids")
se_infomap from run identifiers to search engine infos to retain original search engine information
Todo:
we could pass the score_types that we want to carry over in the map as well (right now it always takes main)

◆ apply() [2/2]

void apply ( std::vector< PeptideIdentification > &  ids,
Size  number_of_runs = 0 
)

◆ apply_()

virtual void apply_ ( std::vector< PeptideIdentification > &  ids,
const std::map< String, String > &  se_info,
SequenceGrouping results 
)
protectedpure virtual

Consensus computation (to be implemented by subclasses).

Parameters
idsPeptide identifications (input)
se_infomapping from run identifier to search engine to carry over infos to result
resultsAlgorithm results (output). For each peptide sequence, two scores are expected: the actual consensus score and the "support" value, in this order.

Implemented in ConsensusIDAlgorithmSimilarity, and ConsensusIDAlgorithmIdentity.

◆ compareChargeStates_()

void compareChargeStates_ ( Int recorded_charge,
Int  new_charge,
const AASequence peptide 
)
protected

Compare (and possibly update) charge state information.

◆ operator=()

ConsensusIDAlgorithm& operator= ( const ConsensusIDAlgorithm )
private

Not implemented.

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

Docu in base class.

Reimplemented from DefaultParamHandler.

Reimplemented in ConsensusIDAlgorithmPEPMatrix, and ConsensusIDAlgorithmPEPIons.

Member Data Documentation

◆ considered_hits_

Size considered_hits_
protected

Number of peptide hits considered per ID run (input parameter)

◆ count_empty_

bool count_empty_
protected

Count empty runs in "min_support" calculation? (input parameter)

◆ keep_old_scores_

bool keep_old_scores_
protected

Keep old scores?

◆ min_support_

double min_support_
protected

Fraction of required support by other ID runs (input parameter)

◆ number_of_runs_

Size number_of_runs_
protected

Number of ID runs.