| OpenMS 2.5.0

Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Contaminants Class Reference

This class is a metric for the QualityControl TOPP tool. More...

`#include <OpenMS/QC/Contaminants.h>`

Inheritance diagram for Contaminants:

## Classes

struct | ContaminantsSummary
| structure for storing results More...

## Public Member Functions

| Contaminants ()=default
| Constructor. More...
virtual | ~Contaminants ()=default
| Destructor. More...
void | compute (FeatureMap &features, const std::vector< FASTAFile::FASTAEntry > &contaminants)
| Checks if the peptides are in the contaminant database. More...
const String & | getName () const override
| returns the name of the metric More...
const std::vector< Contaminants::ContaminantsSummary > & | getResults ()
| returns results More...
Status | requires () const override
| Returns the input data requirements of the compute(...) function. More...

## Private Member Functions

void | compare_ (const String &key, PeptideHit &pep_hit, Int64 &total, Int64 &cont, double &sum_total, double &sum_cont, double intensity)
| checks if the peptide is in the contaminant database More...

## Private Attributes

const String | name_ = "Contaminants"
| name of the metric More...
std::vector< Contaminants::ContaminantsSummary > | results_
| container that stores results More...
std::unordered_set< String > | digested_db_
| unordered set that contains the contaminant sequences More...

## Additional Inherited Members

Public Types inherited from QCBase
enum | Requires : UInt64 { FAIL, RAWMZML, POSTFDRFEAT, PREFDRFEAT, CONTAMINANTS, TRAFOALIGN, SIZE_OF_REQUIRES }
| Enum to encode a file type as a bit. More...
Static Public Member Functions inherited from QCBase
template<typename MAP , typename T >
static void | iterateFeatureMap (MAP &fmap, T lambda)
| function, which iterates through all PeptideIdentifications of a given FeatureMap and applies a given lambda function More...
Static Public Attributes inherited from QCBase
static const std::string | names_of_requires []
| strings corresponding to enum Requires More...

## Detailed Description

This class is a metric for the QualityControl TOPP tool.

This class checks whether a peptide is a contaminant (given a protein DB) and adds that result as metavalue "is_contaminant" to the first hit of each PeptideIdentification.

## Class Documentation

## ◆ OpenMS::Contaminants::ContaminantsSummary

struct OpenMS::Contaminants::ContaminantsSummary

structure for storing results

Class Members
double | all_contaminants_ratio | (#all contaminants/ #peptides in all)
double | assigned_contaminants_intensity_ratio | (intensity of contaminants in assigned/ intensity of peptides in assigned)
double | assigned_contaminants_ratio | (#contaminants in assigned/ #peptides in assigned)
pair< Int64, Int64 > | empty_features | (features without peptideidentification or with peptideidentifications but without hits; all features)
double | unassigned_contaminants_ratio | (#contaminants in unassigned/ #peptides in unassigned)

## Constructor & Destructor Documentation

## ◆ Contaminants()

Contaminants | ( |  | ) |

default

Constructor.

## ◆ ~Contaminants()

virtual ~Contaminants | ( |  | ) |

virtual default

Destructor.

## Member Function Documentation

## ◆ compare_()

void compare_ | ( | const String & | key,
|  | PeptideHit & | pep_hit,
|  | Int64 & | total,
|  | Int64 & | cont,
|  | double & | sum_total,
|  | double & | sum_cont,
|  | double | intensity
| ) |  |

private

checks if the peptide is in the contaminant database

Parameters

  key | String that will be the key for searching in the unordered set
  pep_hit | PeptideHit to store the result "is_contaminant = 0/1"
  total | counter of all checked peptides
  cont | counter of all checked peptides that are contamiants
  sum_total | intensity of all checked peptides
  sum_cont | intensity of all checked peptides that are contaminants
  intensity | intensity of current peptide

## ◆ compute()

void compute | ( | FeatureMap & | features,
|  | const std::vector< FASTAFile::FASTAEntry > & | contaminants
| ) |  |

Checks if the peptides are in the contaminant database.

"is_contaminant" metavalue is added to the first hit of each PeptideIdentification of each feature and to the first hit of all unsigned PeptideIdentifications. The enzyme and number of missed cleavages used to digest the given protein DB is taken from the ProteinIdentification[0].getSearchParameters() within the given FeatureMap.

Parameters

  features | Input FeatureMap with peptideidentifications of features
  contaminants | Vector of FASTAEntries that need to be digested to check whether a peptide is a contaminant or not

Exceptions

  Exception::MissingInformation | if the contaminants database is empty
  Exception::MissingInformation | if no enzyme is given
  Exception::MissingInformation | if proteinidentification of FeatureMap is empty

Warning
  LOG_WARN if the FeatureMap is empty

## ◆ getName()

const String& getName | ( |  | ) | const

override virtual

returns the name of the metric

Implements QCBase.

## ◆ getResults()

const std::vector<Contaminants::ContaminantsSummary>& getResults | ( |  | ) |

returns results

## ◆ requires()

Status requires | ( |  | ) | const

override virtual

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

Returns
  Status for POSTFDRFEAT and CONTAMINANTS

Implements QCBase.

## Member Data Documentation

## ◆ digested_db_

std::unordered_set<String> digested_db_

private

unordered set that contains the contaminant sequences

## ◆ name_

const String name_ = "Contaminants"

private

name of the metric

## ◆ results_

std::vector<Contaminants::ContaminantsSummary> results_

private

container that stores results