| OpenMS 2.5.0

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

QC metric to determine the number of MS2 scans per MS1 scan over RT. More...

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

Inheritance diagram for Ms2SpectrumStats:

## Classes

struct | ScanEvent

## Public Member Functions

| Ms2SpectrumStats ()=default
| Constructor. More...
virtual | ~Ms2SpectrumStats ()=default
| Destructor. More...
std::vector< PeptideIdentification > | compute (const MSExperiment &exp, FeatureMap &features, const QCBase::SpectraMap &map_to_spectrum)
| Calculate the ScanEventNumber, find all unidentified MS2-Spectra and add them to unassigned PeptideIdentifications, write meta values "ScanEventNumber" and "identified" in PeptideIdentification. More...
const String & | getName () const override
| returns the name of the metric More...
Status | requires () const override
| define the required input file: featureXML after FDR (=POSTFDRFEAT), MzML-file (MSExperiment) with all MS2-Spectra (=RAWMZML) More...

## Private Member Functions

void | setScanEventNumber_ (const MSExperiment &exp)
| compute "ScanEventNumber" for every spectrum: MS1=0, MS2=1-n, write into ms2_included_ More...
void | setPresenceAndScanEventNumber_ (PeptideIdentification &peptide_ID, const MSExperiment &exp, const QCBase::SpectraMap &map_to_spectrum)
| set ms2_included_ bool to true, if PeptideID exist and set "ScanEventNumber" for every PeptideID More...
std::vector< PeptideIdentification > | getUnassignedPeptideIdentifications_ (const MSExperiment &exp)
| return all unidentified MS2-Scans as unassignedPeptideIDs, these contain only Information about RT and "ScanEventNumber" More...

## Static Private Member Functions

static MSSpectrum::PeakType::IntensityType | getBPI_ (const MSSpectrum &spec)
| calculate highest intensity (base peak intensity) More...

## Private Attributes

const String | name_ = "Ms2SpectrumStats"
| name of the metric More...
std::vector< ScanEvent > | ms2_included_ {}
| ms2_included_ contains for every spectrum the information "ScanEventNumber" and presence MS2-scan in PeptideIDs 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

QC metric to determine the number of MS2 scans per MS1 scan over RT.

Ms2SpectrumStats collects data from MS2 scans and stores the result into PeptideIdentifications, which already exist in the FeatureMap, or are newly created as empty PeptideIdentifications (with no sequence).

The following meta-values are computed: "ScanEventNumber": consecutive number of each MS2 scan after the preceding MS1 scan "identified": All PeptideIdentifications of the FeatureMap are marked with '+' and all unidentified MS2-Spectra with '-'. "ion_injection_time": from MS2 spectrum "activation_method": from MS2 spectrum "total_ion_count": summed intensity from MS2 spectrum "base_peak_intensity": highest intensity from MS2 spectrum

"FWHM": RT peak width for all assigned PIs (if provided)

## Constructor & Destructor Documentation

## ◆ Ms2SpectrumStats()

Ms2SpectrumStats | ( |  | ) |

default

Constructor.

## ◆ ~Ms2SpectrumStats()

virtual ~Ms2SpectrumStats | ( |  | ) |

virtual default

Destructor.

## Member Function Documentation

## ◆ compute()

std::vector<PeptideIdentification> compute | ( | const MSExperiment & | exp,
|  | FeatureMap & | features,
|  | const QCBase::SpectraMap & | map_to_spectrum
| ) |  |

Calculate the ScanEventNumber, find all unidentified MS2-Spectra and add them to unassigned PeptideIdentifications, write meta values "ScanEventNumber" and "identified" in PeptideIdentification.

Parameters

  exp | Imported calibrated MzML file as MSExperiment
  features | Imported featureXML file after FDR as FeatureMap
  map_to_spectrum | Map to find index of spectrum given by meta value at PepID

Returns
  unassigned peptide identifications newly generated from unidentified MS2-Spectra

Exceptions

  MissingInformation | If exp is empty
  InvalidParameter | PeptideID is missing meta value 'spectrum_reference'

## ◆ getBPI_()

static MSSpectrum::PeakType::IntensityType getBPI_ | ( | const MSSpectrum & | spec | ) |

static private

calculate highest intensity (base peak intensity)

## ◆ getName()

const String& getName | ( |  | ) | const

override virtual

returns the name of the metric

Implements QCBase.

## ◆ getUnassignedPeptideIdentifications_()

std::vector<PeptideIdentification> getUnassignedPeptideIdentifications_ | ( | const MSExperiment & | exp | ) |

private

return all unidentified MS2-Scans as unassignedPeptideIDs, these contain only Information about RT and "ScanEventNumber"

## ◆ requires()

Status requires | ( |  | ) | const

override virtual

define the required input file: featureXML after FDR (=POSTFDRFEAT), MzML-file (MSExperiment) with all MS2-Spectra (=RAWMZML)

Implements QCBase.

## ◆ setPresenceAndScanEventNumber_()

void setPresenceAndScanEventNumber_ | ( | PeptideIdentification & | peptide_ID,
|  | const MSExperiment & | exp,
|  | const QCBase::SpectraMap & | map_to_spectrum
| ) |  |

private

set ms2_included_ bool to true, if PeptideID exist and set "ScanEventNumber" for every PeptideID

## ◆ setScanEventNumber_()

void setScanEventNumber_ | ( | const MSExperiment & | exp | ) |

private

compute "ScanEventNumber" for every spectrum: MS1=0, MS2=1-n, write into ms2_included_

## Member Data Documentation

## ◆ ms2_included_

std::vector<ScanEvent> ms2_included_ {}

private

ms2_included_ contains for every spectrum the information "ScanEventNumber" and presence MS2-scan in PeptideIDs

## ◆ name_

const String name_ = "Ms2SpectrumStats"

private

name of the metric