R/53_ms2_spectra_matching_scores.R
calculate_dotproduct.Rd
This function calculates the dot product score between experimental and library MS2 spectra intensities. It weights the intensities and computes the similarity score using a modified dot product formula.
calculate_dotproduct(exp.int, lib.int)
A numeric value representing the dot product similarity score between the experimental and library spectra.
The function applies a custom weighting scheme to the experimental and library intensities, where the weight for each intensity value is computed based on its proportion relative to the total sum of intensities in its respective spectrum. The weighted intensities are then used to calculate the dot product score, which is normalized to give a similarity score between the two spectra.
calculate_dotproduct(exp.int = 1:10, lib.int = 1:10)
#> [1] 1