OpenMS
PSMExplainedIonCurrent Class Reference

#include <OpenMS/QC/PSMExplainedIonCurrent.h>

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

Classes

struct  Statistics
 Structure for storing results: average and variance over all PSMs. More...
 

Public Member Functions

 PSMExplainedIonCurrent ()=default
 Default constructor. More...
 
virtual ~PSMExplainedIonCurrent ()=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 PSMExplainedIonCurrent (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 PSMExplainedIonCurrent (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 double annotatePSMExplainedIonCurrent_ (PeptideIdentification &pep_id, const MSExperiment &exp, const QCBase::SpectraMap &map_to_spectrum, WindowMower &filter, PSMExplainedIonCurrent::ToleranceUnit tolerance_unit, double tolerance)
 

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::PSMExplainedIonCurrent::Statistics

struct OpenMS::PSMExplainedIonCurrent::Statistics

Structure for storing results: average and variance over all PSMs.

Collaboration diagram for PSMExplainedIonCurrent::Statistics:
[legend]
Class Members
double average_correctness
double variance_correctness

Constructor & Destructor Documentation

◆ PSMExplainedIonCurrent()

Default constructor.

◆ ~PSMExplainedIonCurrent()

virtual ~PSMExplainedIonCurrent ( )
virtualdefault

Destructor.

Member Function Documentation

◆ annotatePSMExplainedIonCurrent_()

static double annotatePSMExplainedIonCurrent_ ( PeptideIdentification pep_id,
const MSExperiment exp,
const QCBase::SpectraMap map_to_spectrum,
WindowMower filter,
PSMExplainedIonCurrent::ToleranceUnit  tolerance_unit,
double  tolerance 
)
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 PSMExplainedIonCurrent (only of the first PeptideHit of each PepID)

To calculate PSMExplainedIonCurrent the theoretical spectrum is generated and matched with the original one. After that: PSMExplainedIonCurrent = sum of matched peaks intensity / total intensity

Stores average and variance of PSMExplainedIonCurrent as a struct and stores it in the results vector (can be accessed by getResults()). Each PSMExplainedIonCurrent is also stored in the first PeptideHit of the corresponding PeptideIdentification as metavalue "PSM_correctness".

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
toleranceSearch window for matching peaks; distance has to be lower than tolerance value
tolerance_unitTolerance in ppm or Dalton (if auto was chosen, the unit and value will taken from FeatureMap metadata)
Exceptions
Exceptions::MissingInformationIf fragment mass tolerance is missing in metadata of FeatureMap (& no ToleranceUnit is given)
Exception::InvalidParameterPeptideID is missing meta value 'spectrum_reference'
Exception::IllegalArgumentSpectrum for a PepID has ms-level of 1
Exception::MissingInformationIf PSMExplainedIonCurrent couldn't be calculated for any spectrum. (i.e. all spectra are: empty, contain only peaks with intensity 0 or the matching pep_id has no hits)
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 PSMExplainedIonCurrent (only of the first PeptideHit of each PepID)

Same as above, but with PeptideIdentification + SearchParameter input instead of FeatureMap

Parameters
pep_idsInput peptide identifications for annotation and data for theoretical spectra
search_paramsInput search parameters from ID-search that generated the peptide identifications from @pep_ids
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
toleranceSearch window for matching peaks; distance has to be lower than tolerance value
tolerance_unitTolerance in ppm or Dalton (if auto was chosen, the unit and value will taken from FeatureMap metadata)
Exceptions
Exceptions::MissingInformationIf fragment mass tolerance is missing in metadata of FeatureMap (& no ToleranceUnit is given)
Exception::InvalidParameterPeptideID is missing meta value 'spectrum_reference'
Exception::IllegalArgumentSpectrum for a PepID has ms-level of 1
Exception::MissingInformationIf PSMExplainedIonCurrent couldn't be calculated for any spectrum. (i.e. all spectra are: empty, contain only peaks with intensity 0 or the matching pep_id has no hits)
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