Learn R Programming

ALS (version 0.0.7)

matchFactor: 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")

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.

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.

Author

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