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 annotateTransfers (ConsensusMap &features)
 Annotates the runs a consensus feature's identification was transferred to (match-between-runs).
 
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

◆ annotateTransfers()

static void annotateTransfers ( ConsensusMap &  features)
static

Annotates the runs a consensus feature's identification was transferred to (match-between-runs).

A feature linker that groups unidentified features with identified ones, e.g. FeatureGroupingAlgorithmQT, transfers the identification to the runs of the unidentified features without recording it. This lists, for each consensus feature with an identification, the map indices of its features that are not identified as that peptide in their own run (meta value Constants::UserParam::MBR_TRANSFER_MAP_INDICES, as written by PipEchoAlgorithm, but without q-values).

The identifications of a run are found by their "map_index" meta value (see ConsensusFeature::insert()). Call this after resolve(features, true), which leaves the identifications of the best hit's sequence (and moves those of other sequences off the feature): a run whose feature was identified as a different peptide counts as a transfer, as its signal is reported for the feature's peptide. Call it after filtering the identifications, too: identifications without hits do not count, so a run whose hits were filtered out counts as a transfer, and a consensus feature without any hit left gets no annotation.

Consensus features are left unchanged if they have no identification with a hit, if one of their identifications has no "map_index", or if they already carry transfers (e.g. from PipEchoAlgorithm).

Parameters
[in,out]featuresConsensus map to annotate

◆ 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. the concatenated results of two search engines that agree - 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 the scores as given, not a rescoring: it does not make the scores of different engines comparable.

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.

Note
If keep_matching is true and every identification attached to a feature has an empty hit list, the identifications remain attached in their original order with unchanged metadata, so a nonempty identification list does not imply an identified peptide.
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.

Note
If keep_matching is true and every identification attached to a feature has an empty hit list, the identifications remain attached in their original order with unchanged metadata, so a nonempty identification list does not imply an identified peptide.
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