All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Ms2SpectrumStats.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow $
6 // $Authors: Juliane Schmachtenberg, Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/KERNEL/Peak1D.h>
13 #include <OpenMS/QC/QCBase.h>
15 
16 
17 namespace OpenMS
18 {
19  class FeatureMap;
20  class MSExperiment;
21  class PeptideIdentification;
22  class TransformationDescription;
23 
41  class OPENMS_DLLAPI Ms2SpectrumStats : public QCBase
42  {
43  public:
44  struct ScanEvent {
45  ScanEvent(UInt32 sem, bool ms2) : scan_event_number(sem), ms2_presence(ms2)
46  {
47  }
50  };
51 
53  Ms2SpectrumStats() = default;
54 
56  virtual ~Ms2SpectrumStats() = default;
57 
68  PeptideIdentificationList compute(const MSExperiment& exp, FeatureMap& features, const QCBase::SpectraMap& map_to_spectrum);
69 
71  const String& getName() const override;
73  Status requirements() const override;
74 
75  private:
77  const String name_ = "Ms2SpectrumStats";
78 
80  std::vector<ScanEvent> ms2_included_ {};
81 
84 
86  void setPresenceAndScanEventNumber_(PeptideIdentification& peptide_ID, const MSExperiment& exp, const QCBase::SpectraMap& map_to_spectrum);
87 
90 
93  };
94 } // namespace OpenMS
A container for features.
Definition: FeatureMap.h:82
Stores and handles combinations of enum values, e.g. a set of flags as bits flipped in an UInt64.
Definition: FlagSet.h:28
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:49
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
QC metric to determine the number of MS2 scans per MS1 scan over RT.
Definition: Ms2SpectrumStats.h:42
virtual ~Ms2SpectrumStats()=default
Destructor.
Ms2SpectrumStats()=default
Constructor.
static MSSpectrum::PeakType::IntensityType getBPI_(const MSSpectrum &spec)
calculate highest intensity (base peak intensity)
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
void setScanEventNumber_(const MSExperiment &exp)
compute "ScanEventNumber" for every spectrum: MS1=0, MS2=1-n, write into ms2_included_
const String & getName() const override
returns the name of the metric
Status requirements() const override
define the required input file: featureXML after FDR (=POSTFDRFEAT), MzML-file (MSExperiment) with al...
PeptideIdentificationList getUnassignedPeptideIdentifications_(const MSExperiment &exp)
return all unidentified MS2-Scans as unassignedPeptideIDs, these contain only Information about RT an...
PeptideIdentificationList 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 PeptideId...
float IntensityType
Intensity type.
Definition: Peak1D.h:36
Container for peptide identifications from multiple spectra.
Definition: PeptideIdentificationList.h:66
Represents the set of candidates (SpectrumMatches) identified for a single precursor spectrum.
Definition: PeptideIdentification.h:63
Map to find a spectrum via its NativeID.
Definition: QCBase.h:63
This class serves as an abstract base class for all QC classes.
Definition: QCBase.h:29
A more convenient string class.
Definition: String.h:34
uint32_t UInt32
Unsigned integer type (32bit)
Definition: Types.h:33
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition: Ms2SpectrumStats.h:44
ScanEvent(UInt32 sem, bool ms2)
Definition: Ms2SpectrumStats.h:45
bool ms2_presence
Definition: Ms2SpectrumStats.h:49
UInt32 scan_event_number
Definition: Ms2SpectrumStats.h:48