OpenMS  2.7.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:
[legend]
Collaboration diagram for Contaminants:
[legend]

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 StringgetName () 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...
 
- Public Member Functions inherited from QCBase
bool isRunnable (const Status &s) const
 

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::ContaminantsSummaryresults_
 container that stores results More...
 
std::unordered_set< Stringdigested_db_
 unordered set that contains the contaminant sequences 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 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

Collaboration diagram for Contaminants::ContaminantsSummary:
[legend]
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 ( )
virtualdefault

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
keyString that will be the key for searching in the unordered set
pep_hitPeptideHit to store the result "is_contaminant = 0/1"
totalcounter of all checked peptides
contcounter of all checked peptides that are contaminants
sum_totalintensity of all checked peptides
sum_contintensity of all checked peptides that are contaminants
intensityintensity 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
featuresInput FeatureMap with peptideidentifications of features
contaminantsVector of FASTAEntries that need to be digested to check whether a peptide is a contaminant or not
Exceptions
Exception::MissingInformationif the contaminants database is empty
Exception::MissingInformationif no enzyme is given
Exception::MissingInformationif proteinidentification of FeatureMap is empty
Warning
LOG_WARN if the FeatureMap is empty

◆ getName()

const String& getName ( ) const
overridevirtual

returns the name of the metric

Implements QCBase.

◆ getResults()

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

returns results

◆ requires()

Status requires ( ) const
overridevirtual

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