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

Classes

struct  ScanEvent
 

Public Member Functions

 Ms2SpectrumStats ()=default
 Constructor. More...
 
virtual ~Ms2SpectrumStats ()=default
 Destructor. More...
 
std::vector< PeptideIdentificationcompute (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 StringgetName () 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...
 
- Public Member Functions inherited from QCBase
bool isRunnable (const Status &s) const
 

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< PeptideIdentificationgetUnassignedPeptideIdentifications_ (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< ScanEventms2_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 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

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 ( )
virtualdefault

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
expImported calibrated MzML file as MSExperiment
featuresImported featureXML file after FDR as FeatureMap
map_to_spectrumMap to find index of spectrum given by meta value at PepID
Returns
unassigned peptide identifications newly generated from unidentified MS2-Spectra
Exceptions
MissingInformationIf exp is empty
InvalidParameterPeptideID is missing meta value 'spectrum_reference'

◆ getBPI_()

static MSSpectrum::PeakType::IntensityType getBPI_ ( const MSSpectrum spec)
staticprivate

calculate highest intensity (base peak intensity)

◆ getName()

const String& getName ( ) const
overridevirtual

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
overridevirtual

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