OpenMS
ZhangSimilarityScore.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: $
7 // --------------------------------------------------------------------------
8 //
9 #pragma once
10 
12 
13 namespace OpenMS
14 {
15 
28  class OPENMS_DLLAPI ZhangSimilarityScore :
30  {
31 public:
32 
33  // @name Constructors and Destructors
34  // @{
37 
40 
43  // @}
44 
45  // @name Operators
46  // @{
49 
51  double operator()(const PeakSpectrum & spec1, const PeakSpectrum & spec2) const override;
52 
53  double operator()(const PeakSpectrum & spec) const override;
54  // @}
55 
56  // @name Accessors
57  // @{
60 
62  static const String getProductName()
63  {
64  return "ZhangSimilarityScore";
65  }
66 
67  // @}
68 
69 protected:
70 
72  double getFactor_(double mz_tolerance, double mz_difference, bool is_gaussian = false) const;
73 
74 
75  };
76 
77 }
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
A more convenient string class.
Definition: String.h:34
Similarity score of Zhang.
Definition: ZhangSimilarityScore.h:30
double getFactor_(double mz_tolerance, double mz_difference, bool is_gaussian=false) const
returns the factor associated with the m/z tolerance and m/z difference of the peaks
~ZhangSimilarityScore() override
destructor
ZhangSimilarityScore()
default constructor
double operator()(const PeakSpectrum &spec1, const PeakSpectrum &spec2) const override
function call operator, calculates the similarity
double operator()(const PeakSpectrum &spec) const override
calculates self similarity
ZhangSimilarityScore(const ZhangSimilarityScore &source)
copy constructor
ZhangSimilarityScore & operator=(const ZhangSimilarityScore &source)
assignment operator
static PeakSpectrumCompareFunctor * create()
Definition: ZhangSimilarityScore.h:59
static const String getProductName()
Definition: ZhangSimilarityScore.h:62
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22