OpenMS
PrecursorPurity.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: Eugen Netz $
6 // $Authors: Eugen Netz $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/CONCEPT/Types.h>
14 #include <vector>
15 
16 
17 namespace OpenMS
18 {
33  class OPENMS_DLLAPI PrecursorPurity
34  {
35 
36  public:
37 
38  struct PurityScores
39  {
40  double total_intensity = 0.0;
41  double target_intensity = 0.0;
42  double signal_proportion = 0.0;
43  Size target_peak_count = 0;
44  Size residual_peak_count = 0;
45  };
46 
55  static std::map<String, PurityScores> computePrecursorPurities(const PeakMap& spectra, double precursor_mass_tolerance, bool precursor_mass_tolerance_unit_ppm);
56 
67  static PurityScores computePrecursorPurity(const PeakSpectrum& ms1, const Precursor& pre, const double precursor_mass_tolerance, const bool precursor_mass_tolerance_unit_ppm);
68 
69 
70  private:
71  // simple helper to combine the metrics contained in two PurityScores
73 
74  };
75 }
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Precursor purity or noise estimation.
Definition: PrecursorPurity.h:34
static PurityScores computePrecursorPurity(const PeakSpectrum &ms1, const Precursor &pre, const double precursor_mass_tolerance, const bool precursor_mass_tolerance_unit_ppm)
compute precursor purity metrics for one MS2 precursor
static std::map< String, PurityScores > computePrecursorPurities(const PeakMap &spectra, double precursor_mass_tolerance, bool precursor_mass_tolerance_unit_ppm)
compute precursor purity metrics for each MS2 spectrum in a PeakMap This is the main function of this...
static PurityScores combinePrecursorPurities(const PrecursorPurity::PurityScores &score1, const PrecursorPurity::PurityScores &score2)
Definition: PrecursorPurity.h:39
Precursor meta information.
Definition: Precursor.h:35
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22