OpenMS
FragmentMassError Class Reference

#include <OpenMS/QC/FragmentMassError.h>

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

Classes

struct  Statistics
 Structure for storing results: average and variance of all FragmentMassErrors in ppm. More...
 

Public Member Functions

 FragmentMassError ()=default
 Default constructor. More...
 
virtual ~FragmentMassError ()=default
 Destructor. More...
 
void compute (FeatureMap &fmap, const MSExperiment &exp, const QCBase::SpectraMap &map_to_spectrum, ToleranceUnit tolerance_unit=ToleranceUnit::AUTO, double tolerance=20)
 computes FragmentMassError (FME) in ppm and Dalton (only of the first PeptideHit of each PepID) More...
 
void compute (std::vector< PeptideIdentification > &pep_ids, const ProteinIdentification::SearchParameters &search_params, const MSExperiment &exp, const QCBase::SpectraMap &map_to_spectrum, ToleranceUnit tolerance_unit=ToleranceUnit::AUTO, double tolerance=20)
 computes FragmentMassError (FME) in ppm and Dalton (only of the first PeptideHit of each PepID) More...
 
const StringgetName () const override
 returns the name of the metric More...
 
const std::vector< Statistics > & getResults () const
 returns results More...
 
QCBase::Status requirements () const override
 Returns the input data requirements of the compute(...) function. More...
 
- Public Member Functions inherited from QCBase
bool isRunnable (const Status &s) const
 

Static Private Member Functions

static void calculateFME_ (PeptideIdentification &pep_id, const MSExperiment &exp, const QCBase::SpectraMap &map_to_spectrum, bool &print_warning, double tolerance, FragmentMassError::ToleranceUnit tolerance_unit, double &accumulator_ppm, UInt32 &counter_ppm, WindowMower &window_mower_filter)
 
static void calculateVariance_ (FragmentMassError::Statistics &result, const PeptideIdentification &pep_id, const UInt num_ppm)
 

Private Attributes

std::vector< Statisticsresults_
 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...
 

Class Documentation

◆ OpenMS::FragmentMassError::Statistics

struct OpenMS::FragmentMassError::Statistics

Structure for storing results: average and variance of all FragmentMassErrors in ppm.

Collaboration diagram for FragmentMassError::Statistics:
[legend]
Class Members
double average_ppm
double variance_ppm

Constructor & Destructor Documentation

◆ FragmentMassError()

FragmentMassError ( )
default

Default constructor.

◆ ~FragmentMassError()

virtual ~FragmentMassError ( )
virtualdefault

Destructor.

Member Function Documentation

◆ calculateFME_()

static void calculateFME_ ( PeptideIdentification pep_id,
const MSExperiment exp,
const QCBase::SpectraMap map_to_spectrum,
bool &  print_warning,
double  tolerance,
FragmentMassError::ToleranceUnit  tolerance_unit,
double &  accumulator_ppm,
UInt32 counter_ppm,
WindowMower window_mower_filter 
)
staticprivate

◆ calculateVariance_()

static void calculateVariance_ ( FragmentMassError::Statistics result,
const PeptideIdentification pep_id,
const UInt  num_ppm 
)
staticprivate

◆ compute() [1/2]

void compute ( FeatureMap fmap,
const MSExperiment exp,
const QCBase::SpectraMap map_to_spectrum,
ToleranceUnit  tolerance_unit = ToleranceUnit::AUTO,
double  tolerance = 20 
)

computes FragmentMassError (FME) in ppm and Dalton (only of the first PeptideHit of each PepID)

Stores average FME over all spectra (one for each PeptideIdentification) and its variance in ppm as a struct in a vector. Each FME (in ppm) is stored at the first PeptideHit of the corresponding PeptideIdentification as metavalue Constants::UserParam::FRAGMENT_ERROR_PPM_METAVALUE_USERPARAM and contains the FME for each peak in the corresponding spectrum. Same is done for the FME in Da - as metavalue Constants::UserParam::FRAGMENT_ERROR_DA_METAVALUE_USERPARAM. For both tolerance units the variance of FMEs over the spectrum is also stored as a metavalue with the extension "_variance" to the metavalue name. Note: Variance will not be written if 1 or less FMEs were calculated. Note: If the metavalues already exist, they will be overwritten.

Parameters
fmapInput FeatureMap for annotation and data for theoretical spectra
expInput MSExperiment for MS2 spectra; spectra should be sorted (ascending RT)
map_to_spectrumMap to find index of spectrum given by meta value at PepID
tolerance_unitTolerance in ppm or Dalton (if auto was chosen, the unit and value will taken from FeatureMap metadata)
toleranceSearch window for matching peaks; distance has to be lower than tolerance value (Will be overwritten if tolerance_unit AUTO is chosen)
Exceptions
Exceptions::MissingInformationIf fragment mass tolerance is missing in metadata of FeatureMap
Exception::InvalidParameterPeptideID is missing meta value 'spectrum_reference'
Exception::IllegalArgumentSpectrum for a PepID has ms-level of 1
Exception::MissingInformationIf no fragmentation method given in a MS2 precursor
Exception::InvalidParameterIf the fragmentation method is not ECD, ETD, CID or HCD

◆ compute() [2/2]

void compute ( std::vector< PeptideIdentification > &  pep_ids,
const ProteinIdentification::SearchParameters search_params,
const MSExperiment exp,
const QCBase::SpectraMap map_to_spectrum,
ToleranceUnit  tolerance_unit = ToleranceUnit::AUTO,
double  tolerance = 20 
)

computes FragmentMassError (FME) in ppm and Dalton (only of the first PeptideHit of each PepID)

Stores average FME over all spectra and its variance in ppm as a struct in a vector. Each FME (in ppm) is stored at the first PeptideHit of the corresponding PeptideIdentification as metavalue Constants::UserParam::FRAGMENT_ERROR_PPM_METAVALUE_USERPARAM and contains the FME for each peak in the corresponding spectrum. Same is done for the FME in Da - as metavalue Constants::UserParam::FRAGMENT_ERROR_DA_METAVALUE_USERPARAM. For both tolerance units the variance of FMEs over the spectrum is also stored as a metavalue with the extension "_variance" to the metavalue name. Note: Variance will not be written if 1 or less FMEs were calculated. Note: If the metavalues already exist, they will be overwritten.

Parameters
pep_idsInput vector of peptide identifications for annotation and data for theoretical spectra
search_paramsInput search parameters (corresponding to ID search that generated pep_ids) for finding fragment mass tolerance and unit automatically
expInput MSExperiment for MS2 spectra; spectra should be sorted (ascending RT)
map_to_spectrumMap to find index of spectrum given by meta value at PepID
tolerance_unitTolerance in ppm or Dalton (if auto was chosen, the unit and value will taken from FeatureMap metadata)
toleranceSearch window for matching peaks; distance has to be lower than tolerance value (Will be overwritten if tolerance_unit AUTO is chosen)
Exceptions
Exceptions::MissingInformationIf fragment mass tolerance is missing in search_params
Exception::InvalidParameterPeptideID is missing meta value 'spectrum_reference'
Exception::IllegalArgumentSpectrum for a PepID has ms-level of 1
Exception::MissingInformationIf no fragmentation method given in a MS2 precursor
Exception::InvalidParameterIf the fragmentation method is not ECD, ETD, CID or HCD

◆ getName()

const String& getName ( ) const
overridevirtual

returns the name of the metric

Implements QCBase.

◆ getResults()

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

returns results

◆ requirements()

QCBase::Status requirements ( ) const
overridevirtual

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

Returns
Status for RAWMZML and POSTFDRFEAT

Implements QCBase.

Member Data Documentation

◆ results_

std::vector<Statistics> results_
private

container that stores results