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

FDR within classes of PSMs (e.g. modified vs. unmodified, isoform-specific vs. canonical) More...

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

Classes

struct  ClassSummary
 per-class summary More...
 

Public Types

enum class  Method { POOLED_NULL , CLASS_TDC }
 how the q-values of a class were estimated More...
 

Static Public Member Functions

static std::vector< ClassSummary > annotateClassQValues (PeptideIdentificationList &ids, const std::function< std::string(const PeptideHit &)> &class_of, bool use_all_hits=false)
 Annotate every target hit with its class q-value (meta value CLASS_Q_VALUE)
 
static Size raiseToClassQValues (PeptideIdentificationList &ids)
 Raise each hit's q-value (main score, which must be a q-value) to its class q-value, where annotated.
 
static std::string classFromMetaValue (const PeptideHit &hit, const std::string &name)
 Class of a hit from the meta value name (its string form; "NA" if missing)
 
static std::string classFromModifications (const PeptideHit &hit, const std::vector< std::string > &ignore)
 
static std::vector< double > storeyQValues (const std::vector< double > &p, double &pi0)
 Storey q-values (lambda = 0.5) of p in the same order; pi0 receives the null-fraction estimate.
 

Static Public Attributes

static const std::string CLASS_Q_VALUE
 meta value holding the class q-value of a hit
 

Detailed Description

FDR within classes of PSMs (e.g. modified vs. unmodified, isoform-specific vs. canonical)

One q-value over all PSMs lets a small class pass at a much higher error rate than the large class: its decoys are diluted among the large class's targets. ClassFDR gives every target PSM a q-value within its class; a PSM is then accepted at a cutoff only if both its global and its class q-value pass it (see raiseToClassQValues()).

Within a class, each target gets an empirical p-value against all decoys (the pooled null), and Storey q-values (lambda = 0.5) are computed over the class's targets. This borrows the power of the large decoy set and is conservative for a class whose own decoys score no higher than the pool. That is checked: a class with fewer than 20 decoys, or whose decoys fall in the pool's top 5% significantly more often than 5% (one-sided z > 2.33), uses target-decoy competition inside the class instead, q = (decoys + 1) / targets.

Ported from bigbio/andes #164.

Experimental classes:
The estimator and its guard may change.

Class Documentation

◆ OpenMS::ClassFDR::ClassSummary

struct OpenMS::ClassFDR::ClassSummary

per-class summary

Class Members
Size decoys = 0
Method method = Method::POOLED_NULL
string name
double pi0 = 1.0
Size targets = 0

Member Enumeration Documentation

◆ Method

enum class Method
strong

how the q-values of a class were estimated

Enumerator
POOLED_NULL 

pooled-decoy p-values, Storey q-values within the class

CLASS_TDC 

target-decoy competition within the class

Member Function Documentation

◆ annotateClassQValues()

static std::vector< ClassSummary > annotateClassQValues ( PeptideIdentificationList &  ids,
const std::function< std::string(const PeptideHit &)> &  class_of,
bool  use_all_hits = false 
)
static

Annotate every target hit with its class q-value (meta value CLASS_Q_VALUE)

Must run before decoys are removed. Hits are ranked by the main score of their identification (its orientation from PeptideIdentification::isHigherScoreBetter()). Decoys are hits with target_decoy "decoy". With a single class, nothing is annotated.

Parameters
idsIdentifications
class_ofThe class of a hit
use_all_hitsUse all hits, not only the best hit of each identification
Returns
The classes, largest first

◆ classFromMetaValue()

static std::string classFromMetaValue ( const PeptideHit &  hit,
const std::string &  name 
)
static

Class of a hit from the meta value name (its string form; "NA" if missing)

◆ classFromModifications()

static std::string classFromModifications ( const PeptideHit &  hit,
const std::vector< std::string > &  ignore 
)
static

Class of a hit from its modifications: "unmodified", or the sorted names of its modifications joined by '+', ignoring those in ignore (e.g. fixed modifications)

◆ raiseToClassQValues()

static Size raiseToClassQValues ( PeptideIdentificationList &  ids)
static

Raise each hit's q-value (main score, which must be a q-value) to its class q-value, where annotated.

Returns
Number of hits whose q-value was raised

◆ storeyQValues()

static std::vector< double > storeyQValues ( const std::vector< double > &  p,
double &  pi0 
)
static

Storey q-values (lambda = 0.5) of p in the same order; pi0 receives the null-fraction estimate.

Member Data Documentation

◆ CLASS_Q_VALUE

const std::string CLASS_Q_VALUE
static

meta value holding the class q-value of a hit