OpenMS
Loading...
Searching...
No Matches
IDConflictResolverAlgorithm Class Reference

Resolves ambiguous annotations of features with peptide identifications. More...

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

Classes

struct  UnresolvedIdentifications
 What reduceToOnePerSpectrum() found and did. All counts are over the input list. More...
 

Static Public Member Functions

static void resolve (FeatureMap &features, bool keep_matching=false)
 Resolves ambiguous annotations of features with peptide identifications. The the filtered identifications are added to the vector of unassigned peptides and also reduced to a single best hit.
 
static void resolve (ConsensusMap &features, bool keep_matching=false)
 Resolves ambiguous annotations of consensus features with peptide identifications. The the filtered identifications are added to the vector of unassigned peptides and also reduced to a single best hit.
 
static void resolveAllHitRankAggregation (FeatureMap &features)
 Resolves ambiguous annotations of features with peptide identifications using rank aggregation.
 
static void resolveAllHitRankAggregation (ConsensusMap &features)
 Resolves ambiguous annotations of consensus features with peptide identifications using rank aggregation.
 
static void resolveBetweenFeatures (FeatureMap &features)
 In a single (feature/consensus) map, features with the same (possibly modified) sequence and charge state may appear. This filter removes the peptide sequence annotations from features, if a higher-intensity feature with the same (charge, sequence) combination exists in the map. The total number of features remains unchanged. In the final output, each (charge, sequence) combination appears only once, i.e. no multiplicities.
 
static void resolveBetweenFeatures (ConsensusMap &features)
 In a single (feature/consensus) map, features with the same (possibly modified) sequence and charge state may appear. This filter removes the peptide sequence annotations from features, if a higher-intensity feature with the same (charge, sequence) combination exists in the map. The total number of features remains unchanged. In the final output, each (charge, sequence) combination appears only once, i.e. no multiplicities.
 
static UnresolvedIdentifications reduceToOnePerSpectrum (PeptideIdentificationList &ids)
 Reduce identifications a quantification workflow cannot tell apart to one per spectrum.
 

Static Protected Member Functions

template<class T >
static void resolveConflict_ (T &map, bool keep_matching)
 
static bool compareIDsSmallerScores_ (const PeptideIdentification &left, const PeptideIdentification &right)
 
static void resolveConflict_ (PeptideIdentificationList &peptides, PeptideIdentificationList &removed, UInt64 uid)
 
static void resolveConflictKeepMatching_ (PeptideIdentificationList &peptides, PeptideIdentificationList &removed, UInt64 uid)
 
static void resolveAggregateConflict_ (PeptideIdentificationList &peptides, PeptideIdentificationList &removed, UInt64 uid)
 
template<class T >
static void rankAggregation_ (T &map)
 
template<class T >
static void resolveBetweenFeatures_ (T &map)
 

Detailed Description

Resolves ambiguous annotations of features with peptide identifications.

The peptide identifications are filtered so that only one identification with a single hit (with the best score) is associated to each feature. (If two IDs have the same best score, either one of them may be selected.)


Class Documentation

◆ OpenMS::IDConflictResolverAlgorithm::UnresolvedIdentifications

struct OpenMS::IDConflictResolverAlgorithm::UnresolvedIdentifications

What reduceToOnePerSpectrum() found and did. All counts are over the input list.

Class Members
string example First reduced group, as "<spectrum reference> / <sequence> / charge <n>", for logging.
Size inconsistent_score_direction = 0

Identifications whose group disagreed on isHigherScoreBetter(), so "best" was undefined. Left untouched rather than reduced by a coin flip.

Size multiply_identified_spectra = 0

Spectra that still carry more than one identification AFTER the reduction, i.e. ones whose identifications name different peptidoforms (a chimeric spectrum, or search engines that disagree). Not reduced - both are quantifiable - but worth reporting.

Size removed = 0

Identifications removed because another one claimed the same (spectrum reference, top-hit sequence, top-hit charge).

Size without_spectrum_reference = 0

Identifications that could not be keyed because they carry no spectrum reference. Left untouched: without a reference there is nothing to tell them apart by.

Member Function Documentation

◆ compareIDsSmallerScores_()

static bool compareIDsSmallerScores_ ( const PeptideIdentification &  left,
const PeptideIdentification &  right 
)
staticprotected

◆ rankAggregation_()

template<class T >
static void rankAggregation_ ( T &  map)
inlinestaticprotected

◆ reduceToOnePerSpectrum()

static UnresolvedIdentifications reduceToOnePerSpectrum ( PeptideIdentificationList &  ids)
static

Reduce identifications a quantification workflow cannot tell apart to one per spectrum.

Quantification tools measure one value per (spectrum, peptidoform, charge). Where the input carries several identifications of that same triple - e.g. two search engines that agree, concatenated rather than combined - only one of them can own the measurement, and keeping all of them counts one measurement several times.

This keeps the best-scoring identification of each such group and removes the rest. That is a tie-break on scores something upstream already assigned, not a scoring decision: combining scores from different engines is ConsensusIDAlgorithm's job and is deliberately not done here.

Identifications are keyed on the top hit as stored; hits are never re-sorted, so the key matches what the exporters and quantifiers read. Surviving identifications keep their original relative order.

Parameters
[in,out]idsOne identification run's peptide identifications.
Returns
What was found and removed; see UnresolvedIdentifications.

◆ resolve() [1/2]

static void resolve ( ConsensusMap &  features,
bool  keep_matching = false 
)
static

Resolves ambiguous annotations of consensus features with peptide identifications. The the filtered identifications are added to the vector of unassigned peptides and also reduced to a single best hit.

Parameters
[in]featuresFeatures to work on
[in,out]keep_matchingKeeps all IDs that match the modified sequence of the best hit in the feature (e.g. keeps all IDs in a ConsensusMap if id'd same across multiple runs)

◆ resolve() [2/2]

static void resolve ( FeatureMap &  features,
bool  keep_matching = false 
)
static

Resolves ambiguous annotations of features with peptide identifications. The the filtered identifications are added to the vector of unassigned peptides and also reduced to a single best hit.

Parameters
[in]featuresFeatures to work on
[in,out]keep_matchingKeeps all IDs that match the modified sequence of the best hit in the feature (e.g. keeps all IDs in a ConsensusMap if id'd same across multiple runs)

◆ resolveAggregateConflict_()

static void resolveAggregateConflict_ ( PeptideIdentificationList &  peptides,
PeptideIdentificationList &  removed,
UInt64  uid 
)
staticprotected

◆ resolveAllHitRankAggregation() [1/2]

static void resolveAllHitRankAggregation ( ConsensusMap &  features)
static

Resolves ambiguous annotations of consensus features with peptide identifications using rank aggregation.

For each consensus feature, peptide hits across all identifications are aggregated by rank. Each unique sequence is assigned a rank in every identification in which it appears (rank 0 = best hit, 1 = second best, etc.). Sequences not found in an identification receive a penalty rank equal to the maximum number of considered hits. The aggregate score for each sequence is computed as:

1.0 - (sum_of_ranks + penalty_for_missing_runs) / (max_hits * n_runs)

The sequence with the highest aggregate score is selected as the winner and the corresponding best-scoring identification is kept with only that hit. All other identifications are moved to the unassigned list.

Parameters
[in]featuresConsensusMap to work on

◆ resolveAllHitRankAggregation() [2/2]

static void resolveAllHitRankAggregation ( FeatureMap &  features)
static

Resolves ambiguous annotations of features with peptide identifications using rank aggregation.

For each feature, peptide hits across all identifications are aggregated by rank. Each unique sequence is assigned a rank in every identification in which it appears (rank 0 = best hit, 1 = second best, etc.). Sequences not found in an identification receive a penalty rank equal to the maximum number of considered hits. The aggregate score for each sequence is computed as:

1.0 - (sum_of_ranks + penalty_for_missing_runs) / (max_hits * n_runs)

The sequence with the highest aggregate score is selected as the winner and the corresponding best-scoring identification is kept with only that hit. All other identifications are moved to the unassigned list.

Parameters
[in]featuresFeatureMap to work on

◆ resolveBetweenFeatures() [1/2]

static void resolveBetweenFeatures ( ConsensusMap &  features)
static

In a single (feature/consensus) map, features with the same (possibly modified) sequence and charge state may appear. This filter removes the peptide sequence annotations from features, if a higher-intensity feature with the same (charge, sequence) combination exists in the map. The total number of features remains unchanged. In the final output, each (charge, sequence) combination appears only once, i.e. no multiplicities.

◆ resolveBetweenFeatures() [2/2]

static void resolveBetweenFeatures ( FeatureMap &  features)
static

In a single (feature/consensus) map, features with the same (possibly modified) sequence and charge state may appear. This filter removes the peptide sequence annotations from features, if a higher-intensity feature with the same (charge, sequence) combination exists in the map. The total number of features remains unchanged. In the final output, each (charge, sequence) combination appears only once, i.e. no multiplicities.

◆ resolveBetweenFeatures_()

◆ resolveConflict_() [1/2]

static void resolveConflict_ ( PeptideIdentificationList &  peptides,
PeptideIdentificationList &  removed,
UInt64  uid 
)
staticprotected

◆ resolveConflict_() [2/2]

template<class T >
static void resolveConflict_ ( T &  map,
bool  keep_matching 
)
inlinestaticprotected

◆ resolveConflictKeepMatching_()

static void resolveConflictKeepMatching_ ( PeptideIdentificationList &  peptides,
PeptideIdentificationList &  removed,
UInt64  uid 
)
staticprotected