SpectraSTSimilarityScore#
- class pyopenms.SpectraSTSimilarityScore#
Bases:
object
Cython implementation of _SpectraSTSimilarityScore
Original C++ documentation is available here
- __init__()#
Overload:
- __init__(self) None
Overload:
- __init__(self, in_0: SpectraSTSimilarityScore) None
Methods
Overload:
compute_F
(self, dot_product, delta_D, dot_bias)Computes the overall all score
delta_D
(self, top_hit, runner_up)Calculates the normalized distance between top_hit and runner_up
dot_bias
(self, bin1, bin2, dot_product)Calculates how much of the dot product is dominated by a few peaks
preprocess
(self, spec, ...)Preprocesses the spectrum
transform
(self, spec)Spectrum is transformed into a binned spectrum with bin size 1 and spread 1 and the intensities are normalized
- compute_F(self, 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(self, 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(self, bin1: BinnedSpectrum, bin2: BinnedSpectrum, dot_product: float) 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(self, spec: MSSpectrum, remove_peak_intensity_threshold: float, cut_peaks_below: int, min_peak_number: int, max_peak_number: int) 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(self, spec: MSSpectrum) BinnedSpectrum #
Spectrum is transformed into a binned spectrum with bin size 1 and spread 1 and the intensities are normalized