OpenMS
XFDRAlgorithm Class Reference

Calculates false discovery rate estimates on crosslink identifications. More...

#include <OpenMS/ANALYSIS/XLMS/XFDRAlgorithm.h>

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

Public Types

enum  ExitCodes { EXECUTION_OK , ILLEGAL_PARAMETERS , UNEXPECTED_RESULT }
 Exit codes. More...
 
- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 

Public Member Functions

 XFDRAlgorithm ()
 Default constructor. More...
 
 ~XFDRAlgorithm () override
 Default destructor. More...
 
ExitCodes run (std::vector< PeptideIdentification > &peptide_ids, ProteinIdentification &protein_id)
 Performs the main function of this class, the FDR estimation for cross-linked peptide experiments. More...
 
ExitCodes validateClassArguments () const
 Checks whether the parameters of the object are valid. 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...
 
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...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Private Member Functions

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void initDataStructures_ (std::vector< PeptideIdentification > &peptide_ids, ProteinIdentification &protein_id)
 Prepares vector of PeptideIdentification such that it can be processed downstream. The encompassed steps are: * Set min_score_ and max_score_ encountered in the data * Ensure that crosslink_type and crosslink_rank are available in the PeptideIdentification * Define the crosslink as either inter/or intraprotein * Set the identifier of the Peptide Identification if there is only one protein identification. More...
 
void fdr_xprophet_ (std::map< String, Math::Histogram<> > &cum_histograms, const String &targetclass, const String &decoyclass, const String &fulldecoyclass, std::vector< double > &fdr, bool mono) const
 xprophet method for target hits counting as implemented in xProphet More...
 
void findTopUniqueHits_ (std::vector< PeptideIdentification > &peptide_ids)
 
void writeArgumentsLog_ () const
 
String getId_ (const PeptideHit &ph) const
 

Static Private Member Functions

static void assignTypes_ (PeptideHit &pep_id, StringList &types)
 Inspects a PeptideIdentification and assigns all cross-link types that this identification belongs to. More...
 
static void calc_qfdr_ (const std::vector< double > &fdr, std::vector< double > &qfdr)
 Calculates the qFDR values for the provided FDR values, assuming that the FDRs are sorted by score in the input vector. More...
 
static Size getMinIonsMatched_ (const PeptideHit &ph)
 
static void setIntraProtein_ (PeptideHit &ph, const bool value)
 
static void setInterProtein_ (PeptideHit &ph, const bool value)
 
static bool isSameProtein_ (String prot1, String prot2, const String &decoy_string)
 Determines whether the Peptide Evidences belong to the same protein, modulo decoy. More...
 

Private Attributes

Int min_score_
 
Int max_score_
 
std::vector< Stringunique_ids_
 
std::vector< double > unique_id_scores_
 
std::map< String, std::vector< String > > cross_link_classes_
 
String decoy_string_
 
double arg_mindeltas_
 
double arg_minborder_
 
double arg_maxborder_
 
Int arg_minionsmatched_
 
double arg_minscore_
 
bool arg_uniquex_
 
bool arg_no_qvalues_
 
double arg_binsize_
 

Static Private Attributes

static const String param_decoy_string_
 
static const String param_minborder_
 
static const String param_maxborder_
 
static const String param_mindeltas_
 
static const String param_minionsmatched_
 
static const String param_uniquexl_
 
static const String param_no_qvalues_
 
static const String param_minscore_
 
static const String param_binsize_
 
static const String crosslink_class_intradecoys_
 
static const String crosslink_class_fulldecoysintralinks_
 
static const String crosslink_class_interdecoys_
 
static const String crosslink_class_fulldecoysinterlinks_
 
static const String crosslink_class_monodecoys_
 
static const String crosslink_class_intralinks_
 
static const String crosslink_class_interlinks_
 
static const String crosslink_class_monolinks_
 
static const String crosslink_class_decoys_
 
static const String crosslink_class_targets_
 
static const String crosslink_class_hybriddecoysintralinks_
 
static const String crosslink_class_hybriddecoysinterlinks_
 

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...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. 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...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

Calculates false discovery rate estimates on crosslink identifications.

This tool calculates and FDR estimate for crosslink identifications, which are produced by OpenPepXL. The method employed currently is identical to the target-decoy approach used by xProphet (Walzthoeni et al., 2012). Consequently, this tool can also consume xquest.xml files (produced either by OpenPepXL or xQuest). The tool supports output in the idXML and mzIdentML formats.

Experimental classes:
This tool is work in progress and usage and input requirements might change.

Member Enumeration Documentation

◆ ExitCodes

enum ExitCodes

Exit codes.

Enumerator
EXECUTION_OK 
ILLEGAL_PARAMETERS 
UNEXPECTED_RESULT 

Constructor & Destructor Documentation

◆ XFDRAlgorithm()

Default constructor.

◆ ~XFDRAlgorithm()

~XFDRAlgorithm ( )
override

Default destructor.

Member Function Documentation

◆ assignTypes_()

static void assignTypes_ ( PeptideHit pep_id,
StringList types 
)
staticprivate

Inspects a PeptideIdentification and assigns all cross-link types that this identification belongs to.

Parameters
pep_idPeptide ID to be assigned.
typesResult vector containing the names of the crosslink classes

◆ calc_qfdr_()

static void calc_qfdr_ ( const std::vector< double > &  fdr,
std::vector< double > &  qfdr 
)
staticprivate

Calculates the qFDR values for the provided FDR values, assuming that the FDRs are sorted by score in the input vector.

Parameters
fdrVector with FDR values which should be used for qFDR calculation
qfdrResult qFDR values

◆ fdr_xprophet_()

void fdr_xprophet_ ( std::map< String, Math::Histogram<> > &  cum_histograms,
const String targetclass,
const String decoyclass,
const String fulldecoyclass,
std::vector< double > &  fdr,
bool  mono 
) const
private

xprophet method for target hits counting as implemented in xProphet

Target counting as performed by the xProphet software package

Parameters
cum_histogramsCumulative score distributions

◆ findTopUniqueHits_()

void findTopUniqueHits_ ( std::vector< PeptideIdentification > &  peptide_ids)
private

◆ getId_()

String getId_ ( const PeptideHit ph) const
private

◆ getMinIonsMatched_()

static Size getMinIonsMatched_ ( const PeptideHit ph)
inlinestaticprivate

◆ initDataStructures_()

void initDataStructures_ ( std::vector< PeptideIdentification > &  peptide_ids,
ProteinIdentification protein_id 
)
private

Prepares vector of PeptideIdentification such that it can be processed downstream. The encompassed steps are: * Set min_score_ and max_score_ encountered in the data * Ensure that crosslink_type and crosslink_rank are available in the PeptideIdentification * Define the crosslink as either inter/or intraprotein * Set the identifier of the Peptide Identification if there is only one protein identification.

◆ isSameProtein_()

static bool isSameProtein_ ( String  prot1,
String  prot2,
const String decoy_string 
)
inlinestaticprivate

Determines whether the Peptide Evidences belong to the same protein, modulo decoy.

References String::hasSubstring(), and String::substitute().

◆ run()

ExitCodes run ( std::vector< PeptideIdentification > &  peptide_ids,
ProteinIdentification protein_id 
)

Performs the main function of this class, the FDR estimation for cross-linked peptide experiments.

Parameters
peptide_idsThe PeptideIdentifications from an XL-MS experiment

◆ setInterProtein_()

static void setInterProtein_ ( PeptideHit ph,
const bool  value 
)
inlinestaticprivate

◆ setIntraProtein_()

static void setIntraProtein_ ( PeptideHit ph,
const bool  value 
)
inlinestaticprivate

◆ updateMembers_()

void updateMembers_ ( )
overrideprivatevirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

◆ validateClassArguments()

ExitCodes validateClassArguments ( ) const

Checks whether the parameters of the object are valid.

Returns
ExitCode EXECUTION_OK if they are valid, ILLEGAL_PARAMETERS otherwise

◆ writeArgumentsLog_()

void writeArgumentsLog_ ( ) const
private

Member Data Documentation

◆ arg_binsize_

double arg_binsize_
private

◆ arg_maxborder_

double arg_maxborder_
private

◆ arg_minborder_

double arg_minborder_
private

◆ arg_mindeltas_

double arg_mindeltas_
private

◆ arg_minionsmatched_

Int arg_minionsmatched_
private

◆ arg_minscore_

double arg_minscore_
private

◆ arg_no_qvalues_

bool arg_no_qvalues_
private

◆ arg_uniquex_

bool arg_uniquex_
private

◆ cross_link_classes_

std::map<String, std::vector<String> > cross_link_classes_
private

◆ crosslink_class_decoys_

const String crosslink_class_decoys_
staticprivate

◆ crosslink_class_fulldecoysinterlinks_

const String crosslink_class_fulldecoysinterlinks_
staticprivate

◆ crosslink_class_fulldecoysintralinks_

const String crosslink_class_fulldecoysintralinks_
staticprivate

◆ crosslink_class_hybriddecoysinterlinks_

const String crosslink_class_hybriddecoysinterlinks_
staticprivate

◆ crosslink_class_hybriddecoysintralinks_

const String crosslink_class_hybriddecoysintralinks_
staticprivate

◆ crosslink_class_interdecoys_

const String crosslink_class_interdecoys_
staticprivate

◆ crosslink_class_interlinks_

const String crosslink_class_interlinks_
staticprivate

◆ crosslink_class_intradecoys_

const String crosslink_class_intradecoys_
staticprivate

◆ crosslink_class_intralinks_

const String crosslink_class_intralinks_
staticprivate

◆ crosslink_class_monodecoys_

const String crosslink_class_monodecoys_
staticprivate

◆ crosslink_class_monolinks_

const String crosslink_class_monolinks_
staticprivate

◆ crosslink_class_targets_

const String crosslink_class_targets_
staticprivate

◆ decoy_string_

String decoy_string_
private

◆ max_score_

Int max_score_
private

◆ min_score_

Int min_score_
private

◆ param_binsize_

const String param_binsize_
staticprivate

◆ param_decoy_string_

const String param_decoy_string_
staticprivate

◆ param_maxborder_

const String param_maxborder_
staticprivate

◆ param_minborder_

const String param_minborder_
staticprivate

◆ param_mindeltas_

const String param_mindeltas_
staticprivate

◆ param_minionsmatched_

const String param_minionsmatched_
staticprivate

◆ param_minscore_

const String param_minscore_
staticprivate

◆ param_no_qvalues_

const String param_no_qvalues_
staticprivate

◆ param_uniquexl_

const String param_uniquexl_
staticprivate

◆ unique_id_scores_

std::vector<double> unique_id_scores_
private

◆ unique_ids_

std::vector<String> unique_ids_
private