OpenMS  2.8.0
Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Ms2IdentificationRate Class Reference

This class is a metric for the QualityControl-ToppTool. More...

#include <OpenMS/QC/Ms2IdentificationRate.h>

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

Classes

struct  IdentificationRateData
 Structure for storing results. More...
 

Public Member Functions

 Ms2IdentificationRate ()=default
 Default constructor. More...
 
virtual ~Ms2IdentificationRate ()=default
 Destructor. More...
 
void compute (const FeatureMap &feature_map, const MSExperiment &exp, bool assume_all_target=false)
 computes Ms2 Identification Rate with FeatureMap More...
 
void compute (const std::vector< PeptideIdentification > &pep_ids, const MSExperiment &exp, bool assume_all_target=false)
 computes Ms2 Identification Rate with PeptideIdentifications More...
 
const StringgetName () const override
 returns the name of the metric More...
 
const std::vector< IdentificationRateData > & getResults () const
 returns results More...
 
QCBase::Status requires () const override
 Returns the input data requirements of the compute(...) function. More...
 
void addMetaDataMetricsToMzTab (MzTabMetaData &meta) const
 
- Public Member Functions inherited from QCBase
bool isRunnable (const Status &s) const
 

Private Member Functions

Size getMS2Count_ (const MSExperiment &exp)
 returns number of all ms2 spectra in an MSExperiment More...
 
void writeResults_ (Size pep_ids_count, Size ms2_spectra_count)
 

Static Private Member Functions

static bool isTargetPeptide_ (const PeptideIdentification &id, bool all_targets)
 

Private Attributes

const String name_ = "Ms2IdentificationRate"
 name of the metric More...
 
std::vector< IdentificationRateDatarate_result_
 container that stores results More...
 

Additional Inherited Members

- Public Types inherited from QCBase
enum class  Requires : UInt64 {
  NOTHING , RAWMZML , POSTFDRFEAT , PREFDRFEAT ,
  CONTAMINANTS , TRAFOALIGN , ID , SIZE_OF_REQUIRES
}
 Enum to encode a file type as a bit. More...
 
enum class  ToleranceUnit { AUTO , PPM , DA , SIZE_OF_TOLERANCEUNIT }
 
using Status = FlagSet< Requires >
 
- Static Public Member Functions inherited from QCBase
static bool isLabeledExperiment (const ConsensusMap &cm)
 check if the IsobaricAnalyzer TOPP tool was used to create this ConsensusMap More...
 
template<typename MAP >
static bool hasPepID (const MAP &fmap)
 does the container have a PeptideIdentification in its members or as unassignedPepID ? More...
 
- Static Public Attributes inherited from QCBase
static const std::string names_of_requires []
 strings corresponding to enum Requires More...
 
static const std::string names_of_toleranceUnit []
 strings corresponding to enum ToleranceUnit More...
 

Detailed Description

This class is a metric for the QualityControl-ToppTool.

This class computes the MS2 Identification Rate (as #identified PSMs divided by total number of MS2 scans) given a FeatureMap and an MSExperiment. Only pep-ids with FDR metavalue 'target_decoy' equal to 'target' are counted, unless assume_all_target flag is set (assumes all pep-ids are target peptides)


Class Documentation

◆ OpenMS::Ms2IdentificationRate::IdentificationRateData

struct OpenMS::Ms2IdentificationRate::IdentificationRateData

Structure for storing results.

Collaboration diagram for Ms2IdentificationRate::IdentificationRateData:
[legend]
Class Members
double identification_rate
Size num_ms2_spectra
Size num_peptide_identification

Constructor & Destructor Documentation

◆ Ms2IdentificationRate()

Ms2IdentificationRate ( )
default

Default constructor.

◆ ~Ms2IdentificationRate()

virtual ~Ms2IdentificationRate ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addMetaDataMetricsToMzTab()

void addMetaDataMetricsToMzTab ( MzTabMetaData meta) const

◆ compute() [1/2]

void compute ( const FeatureMap feature_map,
const MSExperiment exp,
bool  assume_all_target = false 
)

computes Ms2 Identification Rate with FeatureMap

stores results as a struct in a vector Only pep-ids with target/decoy annotation as 'target' are counted, unless force_index flag is set (assumes all pep-ids are target peptides)

Parameters
feature_mapInput FeatureMap with target/decoy annotation
expMSExperiment for counting number of MS2 spectra
assume_all_targetCount all(!) PepIDs towards number of identified MS2 spectra (ignore target/decoy information if any)
Exceptions
MissingInformationis thrown if the mzML is empty
MissingInformationis thrown if the experiment doesn't contain MS2 spectra
Preconditionis thrown if there are more identifications than MS2 spectra

◆ compute() [2/2]

void compute ( const std::vector< PeptideIdentification > &  pep_ids,
const MSExperiment exp,
bool  assume_all_target = false 
)

computes Ms2 Identification Rate with PeptideIdentifications

stores results as a struct in a vector Only pep-ids with target/decoy annotation as 'target' are counted, unless force_index flag is set (assumes all pep-ids are target peptides)

Parameters
pep_idsInput PeptideIdentifications with target/decoy annotation
expMSExperiment for counting number of MS2 spectra
assume_all_targetCount all(!) PepIDs towards number of identified MS2 spectra (ignore target/decoy information if any)
Exceptions
MissingInformationis thrown if the mzML is empty
MissingInformationis thrown if the experiment doesn't contain MS2 spectra
Preconditionis thrown if there are more identifications than MS2 spectra

◆ getMS2Count_()

Size getMS2Count_ ( const MSExperiment exp)
private

returns number of all ms2 spectra in an MSExperiment

◆ getName()

const String& getName ( ) const
overridevirtual

returns the name of the metric

Implements QCBase.

◆ getResults()

const std::vector<IdentificationRateData>& getResults ( ) const

returns results

◆ isTargetPeptide_()

static bool isTargetPeptide_ ( const PeptideIdentification id,
bool  all_targets 
)
staticprivate

◆ requires()

QCBase::Status requires ( ) const
overridevirtual

Returns the input data requirements of the compute(...) function.

Returns
Status for RAWMZML and POSTFDRFEAT

Implements QCBase.

◆ writeResults_()

void writeResults_ ( Size  pep_ids_count,
Size  ms2_spectra_count 
)
private

Member Data Documentation

◆ name_

const String name_ = "Ms2IdentificationRate"
private

name of the metric

◆ rate_result_

std::vector<IdentificationRateData> rate_result_
private

container that stores results