OpenMS
HyperScore.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: Timo Sachsenberg $
6 // $Authors: Timo Sachsenberg, Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/CONCEPT/Types.h>
13 #include <OpenMS/CONCEPT/Macros.h>
15 #include <vector>
16 
17 namespace OpenMS
18 {
19 
24 struct OPENMS_DLLAPI HyperScore
25 {
26  typedef std::pair<Size, double> IndexScorePair;
27 
37 // static double compute(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum& exp_spectrum, const RichPeakSpectrum& theo_spectrum);
38 
39  static double compute(double fragment_mass_tolerance,
40  bool fragment_mass_tolerance_unit_ppm,
41  const PeakSpectrum& exp_spectrum,
42  const PeakSpectrum& theo_spectrum);
43 
47  struct PSMDetail
48  {
49  size_t matched_b_ions = 0;
50  size_t matched_y_ions = 0;
51  double mean_error = 0.0;
52  };
53 
54  static double computeWithDetail(double fragment_mass_tolerance,
55  bool fragment_mass_tolerance_unit_ppm,
56  const PeakSpectrum& exp_spectrum,
57  const PeakSpectrum& theo_spectrum,
58  PSMDetail& d
59  );
60 
61  private:
63  static double logfactorial_(const int x, int base = 2);
64 };
65 
66 }
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
An implementation of the X!Tandem HyperScore PSM scoring function.
Definition: HyperScore.h:25
static double computeWithDetail(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &exp_spectrum, const PeakSpectrum &theo_spectrum, PSMDetail &d)
static double logfactorial_(const int x, int base=2)
helper to compute the log factorial
std::pair< Size, double > IndexScorePair
Definition: HyperScore.h:26
static double compute(double fragment_mass_tolerance, bool fragment_mass_tolerance_unit_ppm, const PeakSpectrum &exp_spectrum, const PeakSpectrum &theo_spectrum)
compute the (ln transformed) X!Tandem HyperScore 1. the dot product of peak intensities between match...
compute the (ln transformed) X!Tandem HyperScore overload that returns some additional information on...
Definition: HyperScore.h:48