SpectraSTSimilarityScore#

class pyopenms.SpectraSTSimilarityScore#

Bases: object

Similarity score of SpectraST PeakSpectrumCompareFunctor inheritance

__init__() → None#
__init__(arg: pyopenms.SpectraSTSimilarityScore, /) → None

Methods

__init__()

compute_F(dot_product, delta_D, dot_bias)

Computes the overall all score

delta_D(top_hit, runner_up)

Calculates the normalized distance between top_hit and runner_up

dot_bias(bin1, bin2[, dot_product])

Calculates how much of the dot product is dominated by a few peaks

preprocess(spec[, ...])

Preprocesses the spectrum

transform(spec)

Spectrum is transformed into a binned spectrum with bin size 1 and spread 1 and the intensities are normalized

compute_F(dot_product: float, delta_D: float, dot_bias: float) → float#

Computes the overall all score

Parameters:
  • dot_product – dot_product of a match

  • delta_D – delta_D should be calculated after all dot products for a unidentified spectrum are computed

  • dot_bias – the bias

Returns:

The SpectraST similarity score

delta_D(top_hit: float, runner_up: float) → float#

Calculates the normalized distance between top_hit and runner_up

Parameters:
  • top_hit – Is the best score for a given match

  • runner_up – A match with a worse score than top_hit, e.g. the second best score

Returns:

normalized distance

dot_bias(bin1: pyopenms.BinnedSpectrum, bin2: pyopenms.BinnedSpectrum, dot_product: float = -1) → float#

Calculates how much of the dot product is dominated by a few peaks

Parameters:
  • dot_product – If -1 this value will be calculated as well.

  • bin1 – First spectrum in binned representation

  • bin2 – Second spectrum in binned representation

preprocess(spec: pyopenms.MSSpectrum, remove_peak_intensity_threshold: float = 2.01, cut_peaks_below: int = 1000, min_peak_number: int = 5, max_peak_number: int = 150) → bool#

Preprocesses the spectrum

The preprocessing removes peak below a intensity threshold, reject spectra that does not have enough peaks, and cuts peaks exceeding the max_peak_number most intense peaks

Returns:

true if spectrum passes filtering

transform(spec: pyopenms.MSSpectrum) → pyopenms.BinnedSpectrum#

Spectrum is transformed into a binned spectrum with bin size 1 and spread 1 and the intensities are normalized