OpenMS
Loading...
Searching...
No Matches
PrecursorPurity.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: Eugen Netz $
6// $Authors: Eugen Netz $
7// --------------------------------------------------------------------------
8
9#pragma once
10
14#include <unordered_map>
15#include <vector>
16
17
18namespace OpenMS
19{
20 class AASequence;
21
36 class OPENMS_DLLAPI PrecursorPurity
37 {
38
39 public:
40
42 {
43 double total_intensity = 0.0;
44 double target_intensity = 0.0;
45 double signal_proportion = 0.0;
46 Size target_peak_count = 0;
47 Size interfering_peak_count = 0;
48 PeakSpectrum interfering_peaks; // peaks left after precursor (isotopic) peaks have been removed
49 };
50
60 static std::unordered_map<std::string, PurityScores> computePrecursorPurities(const PeakMap& spectra, double precursor_mass_tolerance, bool precursor_mass_tolerance_unit_ppm, bool ignore_missing_precursor_spectra = false);
61
72 static PurityScores computePrecursorPurity(const PeakSpectrum& ms1, const Precursor& pre, const double precursor_mass_tolerance, const bool precursor_mass_tolerance_unit_ppm);
73
86 static std::vector<double> computeSingleScanPrecursorPurities(int ms2_spec_idx, int precursor_spec_idx, const MSExperiment & exp, double max_precursor_isotope_deviation);
87
106 static std::vector<double> computeInterpolatedPrecursorPurity(int ms2_spec_idx, int precursor_spec_idx, int next_ms1_spec_idx, const MSExperiment & exp, double max_precursor_isotope_deviation);
107
123 static Size countSPSPrecursorsMatchingPeptideFragments(const std::vector<Precursor>& sps_precursors, const AASequence& peptide, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, int max_fragment_charge = 1);
124
125 private:
126 // simple helper to combine the metrics contained in two PurityScores
128
129 };
130}
Representation of a peptide/protein sequence.
Definition AASequence.h:88
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Precursor purity or noise estimation.
Definition PrecursorPurity.h:37
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::vector< double > computeSingleScanPrecursorPurities(int ms2_spec_idx, int precursor_spec_idx, const MSExperiment &exp, double max_precursor_isotope_deviation)
Computes a simple purity score aggregate for all Precursors (and their windows) of spectrum at ms2_sp...
static std::vector< double > computeInterpolatedPrecursorPurity(int ms2_spec_idx, int precursor_spec_idx, int next_ms1_spec_idx, const MSExperiment &exp, double max_precursor_isotope_deviation)
Computes a simple purity score aggregate for all Precursors (and their windows) of spectrum at ms2_sp...
static PurityScores combinePrecursorPurities(const PrecursorPurity::PurityScores &score1, const PrecursorPurity::PurityScores &score2)
static Size countSPSPrecursorsMatchingPeptideFragments(const std::vector< Precursor > &sps_precursors, const AASequence &peptide, double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, int max_fragment_charge=1)
Counts how many SPS precursor windows of an MS3 spectrum contain a fragment ion of the identified pep...
static std::unordered_map< std::string, PurityScores > computePrecursorPurities(const PeakMap &spectra, double precursor_mass_tolerance, bool precursor_mass_tolerance_unit_ppm, bool ignore_missing_precursor_spectra=false)
compute precursor purity metrics for each MS2 spectrum in a PeakMap This is the main function of this...
PeakSpectrum interfering_peaks
Definition PrecursorPurity.h:48
Definition PrecursorPurity.h:42
Precursor meta information.
Definition Precursor.h:37
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19