OpenMS
SpectraSTSimilarityScore.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, 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: David Wojnar $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 
14 namespace OpenMS
15 {
16 
36  class OPENMS_DLLAPI SpectraSTSimilarityScore :
38  {
39 public:
40 
41  // @name Constructors and Destructors
42  // @{
45 
48 
51  // @}
52 
55 
59  double operator()(const PeakSpectrum & spec1, const PeakSpectrum & spec2) const override;
63  double operator()(const BinnedSpectrum & bin1, const BinnedSpectrum & bin2) const;
67  double operator()(const PeakSpectrum & spec) const override;
68 
77  bool preprocess(PeakSpectrum & spec, float remove_peak_intensity_threshold = 2.01, UInt cut_peaks_below = 1000, Size min_peak_number = 5, Size max_peak_number = 150);
78 
79 
82 
90  double dot_bias(const BinnedSpectrum & bin1, const BinnedSpectrum & bin2, double dot_product = -1) const;
91 
102  double delta_D(double top_hit, double runner_up);
103 
112  double compute_F(double dot_product, double delta_D, double dot_bias);
113 
114 protected:
115 
116 
117  };
118 
119 }
This is a binned representation of a PeakSpectrum.
Definition: BinnedSpectrum.h:55
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
Base class for compare functors of spectra, that return a similarity value for two spectra.
Definition: PeakSpectrumCompareFunctor.h:28
Similarity score of SpectraST.
Definition: SpectraSTSimilarityScore.h:38
SpectraSTSimilarityScore & operator=(const SpectraSTSimilarityScore &source)
assignment operator
bool preprocess(PeakSpectrum &spec, float remove_peak_intensity_threshold=2.01, UInt cut_peaks_below=1000, Size min_peak_number=5, Size max_peak_number=150)
Preprocesses the spectrum.
double delta_D(double top_hit, double runner_up)
calculates the normalized distance between top_hit and runner_up.
~SpectraSTSimilarityScore() override
destructor
double dot_bias(const BinnedSpectrum &bin1, const BinnedSpectrum &bin2, double dot_product=-1) const
Calculates how much of the dot product is dominated by a few peaks.
double operator()(const BinnedSpectrum &bin1, const BinnedSpectrum &bin2) const
: calculates the dot product of the two spectra
SpectraSTSimilarityScore()
default constructor
double operator()(const PeakSpectrum &spec1, const PeakSpectrum &spec2) const override
: calculates the dot product of the two spectra
double operator()(const PeakSpectrum &spec) const override
: calculates the dot product of itself
SpectraSTSimilarityScore(const SpectraSTSimilarityScore &source)
copy constructor
BinnedSpectrum transform(const PeakSpectrum &spec)
spectrum is transformed into a binned spectrum with bin size 1 and spread 1 and the intensities are n...
double compute_F(double dot_product, double delta_D, double dot_bias)
computes the overall all score
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
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