OpenMS
PScore.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: Timo Sachsenberg $
6 // $Authors: Timo Sachsenberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
13 #include <OpenMS/CONCEPT/Types.h>
14 #include <vector>
15 #include <map>
16 
17 namespace OpenMS
18 {
23 struct OPENMS_DLLAPI PScore
24 {
36  static std::vector<Size> calculateIntensityRankInMZWindow(const std::vector<double>& mz, const std::vector<double>& intensities, double mz_window);
37 
51  static std::vector<std::vector<Size> > calculateRankMap(const PeakMap& peak_map, double mz_window = 100);
52 
60  static std::map<Size, PeakSpectrum > calculatePeakLevelSpectra(const PeakSpectrum& spec, const std::vector<Size>& ranks, Size min_level = 1, Size max_level = 9);
61 
73  static double computePScore(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const std::map<Size, PeakSpectrum>& peak_level_spectra, const std::vector<PeakSpectrum>& theo_spectra, double mz_window = 100.0);
74 
83  static double computePScore(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const std::map<Size, PeakSpectrum>& peak_level_spectra, const PeakSpectrum& theo_spectrum, double mz_window = 100.0);
84 
87  static double massCorrectionTerm(double mass);
88 
91  static double cleavageCorrectionTerm(Size cleavages, bool consecutive_cleavage);
92 
95  static double modificationCorrectionTerm(Size modifications);
96 };
97 
98 }
99 
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
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
Implementation of the PScore PSM scoring algorithm.
Definition: PScore.h:24
static std::vector< Size > calculateIntensityRankInMZWindow(const std::vector< double > &mz, const std::vector< double > &intensities, double mz_window)
calculate local (windowed) peak ranks.
static double cleavageCorrectionTerm(Size cleavages, bool consecutive_cleavage)
static double modificationCorrectionTerm(Size modifications)
static double computePScore(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const std::map< Size, PeakSpectrum > &peak_level_spectra, const std::vector< PeakSpectrum > &theo_spectra, double mz_window=100.0)
Computes the PScore for a vector of theoretical spectra.
static double computePScore(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const std::map< Size, PeakSpectrum > &peak_level_spectra, const PeakSpectrum &theo_spectrum, double mz_window=100.0)
Computes the PScore for a single theoretical spectrum.
static double massCorrectionTerm(double mass)
static std::map< Size, PeakSpectrum > calculatePeakLevelSpectra(const PeakSpectrum &spec, const std::vector< Size > &ranks, Size min_level=1, Size max_level=9)
Calculates spectra for peak level between min_level to max_level and stores them in the map A spectru...
static std::vector< std::vector< Size > > calculateRankMap(const PeakMap &peak_map, double mz_window=100)
precalculated, windowed peak ranks for a whole experiment.