geometricMF: Euclidean geometric distance matching factor

Description Usage Arguments Details Value Note Author(s) References Examples

Description

The similarity measurement, Euclidean geometric distance matching factor, for two spectra.

Usage

1
  geometricMF(x, y)

Arguments

x

numeric(n): the peak intensity values of the first spectrum.

y

numeric(n): the peak intensity values of the second spectrum, with same length of x.

Details

This metric measures the geometric distance between two spectra. The component of each spectrum is normalised into the unit length. Then the normalised vector of spectrum can be considered as a single point a sphere with unit radius in a hyperspace of n dimensions, where n is the number of components of the vector. Two closer spectra will result in smaller geometric distance.

The inverse of the geometric distance plus 1 is returned in this function, as a measure of the similarity of two spectra.

This measurement is one to one correlated with cosine similarity.

Value

numeric(1): the similarity score of two spectra between 0.5 and 1. 1 means perfect identification and 0.5 means the most dissimilarity.

Note

This similarity measure potentially can be problematic. For instance, in the example, a and b are closer to each other than a to c. However, considering the magnitude of change of first and last peak, a to b is more dramatically different than a to c.

Author(s)

Yang Yang

References

Alfassi, Z.B. (2004). On the normalization of a mass spectrum for comparison of two spectra. Journal of the American Society for Mass Spectrometry 15, 385-387.

Examples

1
2
3
4
5
6
  a <- c(1, 10, 5, 8)
  b <- c(2, 10, 5, 8)
  c <- c(1, 10, 5, 9)
  geometricMF(a, b)
  geometricMF(a, c)
  geometricMF(b, c)

Yang0014/MassSpectrometry documentation built on May 10, 2019, 12:05 a.m.