| OpenMS 2.5.0

Classes | Static Public Member Functions | List of all members
IDScoreGetterSetter Class Reference

A class for extracting and reinserting IDScores from Peptide/ProteinIdentifications and from ConsensusMaps. More...

`#include <OpenMS/ANALYSIS/ID/IDScoreGetterSetter.h>`

## Classes

struct | IsHitType
struct | IsIDType

## Static Public Member Functions

static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const std::vector< ProteinIdentification::ProteinGroup > &grps, const std::unordered_set< std::string > &decoy_accs)
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const ProteinIdentification &id)
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, int charge, const String &identifier)
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, const String &identifier)
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, int charge, const String &identifier)
template<typename IDType , typename std::enable_if< IsIDType< IDType >::value >::type * = nullptr>
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const IDType &id, const String &identifier)
template<class ... Args>
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, Args &&... args)
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const PeptideHit &hit, int charge)
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, int charge)
template<typename HitType , typename std::enable_if< IsHitType< HitType >::value >::type * = nullptr>
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const HitType &hit)
template<typename IDType , typename std::enable_if< IsIDType< IDType >::value >::type * = nullptr>
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const IDType &id)
template<class ... Args>
static void | getScores_ (ScoreToTgtDecLabelPairs &scores_labels, const std::vector< PeptideIdentification > &ids, Args &&... args)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides)
| Helper for getting scores in ConsensusMaps. More...
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, int charge)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, const String &identifier)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, int charge, const String &identifier)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, bool all_hits)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, bool all_hits, int charge)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, bool all_hits, const String &identifier)
static void | getPeptideScoresFromMap_ (ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, bool all_hits, int charge, const String &identifier)
static bool | getTDLabel_ (const MetaInfoInterface &idOrHit)
| For peptide hits, a hit is considered target also if it maps to both a target and a decoy protein (i.e. "target+decoy") as value in the "target_decoy" metavalue e.g. annotated by PeptideIndexer. More...
template<typename IDType , class ... Args>
static void | setScores_ (const std::map< double, double > &scores_to_FDR, std::vector< IDType > &ids, const std::string &score_type, bool higher_better, Args &... args)
template<typename IDType >
static String | setScoreType_ (IDType &id, const std::string &score_type, bool higher_better)
template<typename IDType >
static void | setScores_ (const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, bool keep_decoy)
template<typename IDType >
static void | setScores_ (const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type)
template<typename IDType , class ... Args>
static void | setScoresAndRemoveDecoys_ (const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type, Args ... args)
template<typename HitType >
static void | setScore_ (const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type)
template<typename IDType >
static void | setScores_ (const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better)
static void | setScores_ (const std::map< double, double > &scores_to_FDR, PeptideIdentification &id, const std::string &score_type, bool higher_better, bool keep_decoy, int charge)
static void | setScores_ (const std::map< double, double > &scores_to_FDR, PeptideIdentification &id, const std::string &score_type, bool higher_better, bool keep_decoy, int charge, const String &identifier)
template<typename IDType >
static void | setScores_ (const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, bool keep_decoy, const String &identifier)
static void | setScores_ (const std::map< double, double > &scores_to_FDR, PeptideIdentification &id, const std::string &score_type, bool higher_better, int charge, const String &identifier)
template<typename IDType >
static void | setScores_ (const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, const String &identifier)
static void | setScores_ (const std::map< double, double > &scores_to_FDR, std::vector< ProteinIdentification::ProteinGroup > &grps, const std::string &score_type, bool higher_better)
template<typename HitType >
static void | setScoreAndMoveIfTarget_ (const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type, std::vector< HitType > &new_hits)
| Used when keep_decoy_peptides or proteins is false. More...
static void | setScoreAndMoveIfTarget_ (const std::map< double, double > &scores_to_FDR, PeptideHit &hit, const std::string &old_score_type, std::vector< PeptideHit > &new_hits, int charge)
| Used when keep_decoy_peptides is false and charge states are considered. More...
static void | setPeptideScoresForMap_ (const std::map< double, double > &scores_to_FDR, ConsensusMap &cmap, bool include_unassigned_peptides, const std::string &score_type, bool higher_better, bool keep_decoy)
| Helper for applying set Scores on ConsensusMaps. More...
static void | setPeptideScoresForMap_ (const std::map< double, double > &scores_to_FDR, ConsensusMap &cmap, bool include_unassigned_peptides, const std::string &score_type, bool higher_better, bool keep_decoy, int charge)
static void | setPeptideScoresForMap_ (const std::map< double, double > &scores_to_FDR, ConsensusMap &cmap, bool include_unassigned_peptides, const std::string &score_type, bool higher_better, bool keep_decoy, const String &run_identifier)
static void | setPeptideScoresForMap_ (const std::map< double, double > &scores_to_FDR, ConsensusMap &cmap, bool include_unassigned_peptides, const std::string &score_type, bool higher_better, bool keep_decoy, int charge, const String &run_identifier)
static void | checkTDAnnotation_ (const MetaInfoInterface &id_or_hit)
| To check the metavalues before we do anything. More...

## Detailed Description

A class for extracting and reinserting IDScores from Peptide/ProteinIdentifications and from ConsensusMaps.

## Member Function Documentation

## ◆ checkTDAnnotation_()

static void checkTDAnnotation_ | ( | const MetaInfoInterface & | id_or_hit | ) |

inline static

To check the metavalues before we do anything.

Parameters

  id_or_hit | Any Object with MetaInfoInterface. Specifically ID or Hit Type here.

Exceptions

  Exception::MissingInformation | if target_decoy annotation does not exist

References MetaInfoInterface::metaValueExists().

Referenced by IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [1/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides
| ) |  |

inline static

Helper for getting scores in ConsensusMaps.

Todo:
  allow FeatureMap?

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [2/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | int | charge
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [3/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | const String & | identifier
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [4/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | int | charge,
|  | const String & | identifier
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [5/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | bool | all_hits
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [6/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | bool | all_hits,
|  | int | charge
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [7/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | bool | all_hits,
|  | const String & | identifier
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getPeptideScoresFromMap_() [8/8]

static void getPeptideScoresFromMap_ | ( | ScoreToTgtDecLabelPairs & | scores_labels,
|  | const ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | bool | all_hits,
|  | int | charge,
|  | const String & | identifier
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::getScores_().

## ◆ getTDLabel_()

static bool getTDLabel_ | ( | const MetaInfoInterface & | idOrHit | ) |

inline static

For peptide hits, a hit is considered target also if it maps to both a target and a decoy protein (i.e. "target+decoy") as value in the "target_decoy" metavalue e.g. annotated by PeptideIndexer.

References MetaInfoInterface::getMetaValue().

Referenced by IDScoreGetterSetter::getScores_().

## ◆ setPeptideScoresForMap_() [1/4]

static void setPeptideScoresForMap_ | ( | const std::map< double, double > & | scores_to_FDR,
|  | ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | const std::string & | score_type,
|  | bool | higher_better,
|  | bool | keep_decoy
| ) |  |

inline static

Helper for applying set Scores on ConsensusMaps.

Template Parameters

  Args | optional additional arguments (charge, run ID)

Parameters

  scores_to_FDR | maps original scores to FDR
  cmap | the ConsensusMap
  score_type | FDR or q-Value
  higher_better | usually false
  keep_decoy | read from Param object
  args | optional additional arguments (int charge, string run ID)

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::setScores_().

## ◆ setPeptideScoresForMap_() [2/4]

static void setPeptideScoresForMap_ | ( | const std::map< double, double > & | scores_to_FDR,
|  | ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | const std::string & | score_type,
|  | bool | higher_better,
|  | bool | keep_decoy,
|  | int | charge
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::setScores_().

## ◆ setPeptideScoresForMap_() [3/4]

static void setPeptideScoresForMap_ | ( | const std::map< double, double > & | scores_to_FDR,
|  | ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | const std::string & | score_type,
|  | bool | higher_better,
|  | bool | keep_decoy,
|  | const String & | run_identifier
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::setScores_().

## ◆ setPeptideScoresForMap_() [4/4]

static void setPeptideScoresForMap_ | ( | const std::map< double, double > & | scores_to_FDR,
|  | ConsensusMap & | cmap,
|  | bool | include_unassigned_peptides,
|  | const std::string & | score_type,
|  | bool | higher_better,
|  | bool | keep_decoy,
|  | int | charge,
|  | const String & | run_identifier
| ) |  |

inline static

References ConsensusMap::applyFunctionOnPeptideIDs(), and IDScoreGetterSetter::setScores_().

## ◆ setScoreAndMoveIfTarget_() [1/2]

static void setScoreAndMoveIfTarget_ | ( | const std::map< double, double > & | scores_to_FDR,
|  | HitType & | hit,
|  | const std::string & | old_score_type,
|  | std::vector< HitType > & | new_hits
| ) |  |

inline static

Used when keep_decoy_peptides or proteins is false.

Template Parameters

  HitType | ProteinHit or PeptideHit

Parameters

  scores_to_FDR | map from original score to FDR/qVal
  hit | The hit (moved to `new_hits` if its a target hit)
  old_score_type | to save it in metavalue
  new_hits | where to move if target (i.e. target or target+decoy)

Referenced by IDScoreGetterSetter::setScoresAndRemoveDecoys_().

## ◆ setScoreAndMoveIfTarget_() [2/2]

static void setScoreAndMoveIfTarget_ | ( | const std::map< double, double > & | scores_to_FDR,
|  | PeptideHit & | hit,
|  | const std::string & | old_score_type,
|  | std::vector< PeptideHit > & | new_hits,
|  | int | charge
| ) |  |

inline static

Used when keep_decoy_peptides is false and charge states are considered.

Parameters

  scores_to_FDR | map from original score to FDR/qVal
  hit | the PeptideHit itself
  old_score_type | to save it in metavalue
  new_hits | where to move if target (i.e. target or target+decoy)
  charge | If only peptides with charge X are currently considered

References PeptideHit::getCharge(), MetaInfoInterface::getMetaValue(), PeptideHit::getScore(), MetaInfoInterface::setMetaValue(), and PeptideHit::setScore().