OpenMS
Ms2SpectrumStats.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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>
14 
15 
16 namespace OpenMS
17 {
18  class FeatureMap;
19  class MSExperiment;
20  class PeptideIdentification;
21  class TransformationDescription;
22 
40  class OPENMS_DLLAPI Ms2SpectrumStats : public QCBase
41  {
42  public:
43  struct ScanEvent {
44  ScanEvent(UInt32 sem, bool ms2) : scan_event_number(sem), ms2_presence(ms2)
45  {
46  }
49  };
50 
52  Ms2SpectrumStats() = default;
53 
55  virtual ~Ms2SpectrumStats() = default;
56 
67  std::vector<PeptideIdentification> compute(const MSExperiment& exp, FeatureMap& features, const QCBase::SpectraMap& map_to_spectrum);
68 
70  const String& getName() const override;
72  Status requirements() const override;
73 
74  private:
76  const String name_ = "Ms2SpectrumStats";
77 
79  std::vector<ScanEvent> ms2_included_ {};
80 
83 
85  void setPresenceAndScanEventNumber_(PeptideIdentification& peptide_ID, const MSExperiment& exp, const QCBase::SpectraMap& map_to_spectrum);
86 
88  std::vector<PeptideIdentification> getUnassignedPeptideIdentifications_(const MSExperiment& exp);
89 
92  };
93 } // namespace OpenMS
A container for features.
Definition: FeatureMap.h:80
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:46
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:41
virtual ~Ms2SpectrumStats()=default
Destructor.
Ms2SpectrumStats()=default
Constructor.
static MSSpectrum::PeakType::IntensityType getBPI_(const MSSpectrum &spec)
calculate highest intensity (base peak intensity)
std::vector< PeptideIdentification > getUnassignedPeptideIdentifications_(const MSExperiment &exp)
return all unidentified MS2-Scans as unassignedPeptideIDs, these contain only Information about RT an...
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 PeptideId...
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...
float IntensityType
Intensity type.
Definition: Peak1D.h:36
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
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
OPENMS_UINT32_TYPE UInt32
Unsigned integer type (32bit)
Definition: Types.h:37
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: Ms2SpectrumStats.h:43
ScanEvent(UInt32 sem, bool ms2)
Definition: Ms2SpectrumStats.h:44
bool ms2_presence
Definition: Ms2SpectrumStats.h:48
UInt32 scan_event_number
Definition: Ms2SpectrumStats.h:47