matchFactor: Matching factor functions to describe similarity of two...

View source: R/matchFactor.R

matchFactorR Documentation

Matching factor functions to describe similarity of two vectors

Description

Matching factor functions to describe similarity of two vectors. This function may be useful to match an estimated mass spectrum against mass spectra of known compounds, in order to identify the compound represented by the estimated mass spectrum.

Usage

matchFactor(u, s, type="dot")

Arguments

u

numeric vector of length n

s

numeric vector of length n

type

character vector describing the matching factor function to apply; the choices are "dot" for the normalized dot product or "euclid" for the normalized euclidean distance.

Value

numeric between 0 and 1 representing the matching factor; vectors that are more similar have a larger matching factor. Note that if both u and s are all zero, we let the matching factor be 1; if one and only one of u and s are all zero, we let the matching factor be 0.

Author(s)

Katharine M. Mullen

References

Alfassi ZB. On the normalization of a mass spectrum for comparison of two spectra. Journal of the American Society for Mass Spectrometry 2004; 15:385-387.

Stein SE, Scott DR. Optimization and testing of mass spectral library search algorithms for compound identication. Journal of the American Society for Mass Spectrometry 1994; 5:859-866.

See Also

als


ALS documentation built on Aug. 25, 2022, 9:09 a.m.

Related to matchFactor in ALS...