Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mdist

Metabolite Distance Metric


Description

This function calculates a distance metric between two metabolomic measurements. These measurements can be either scalers or vectors.

Usage

mdist(x, y)

Arguments

x

a numerical scalar or vector of metabolomic measurements.

y

a numerical scalar or vector of metabolomic measurements.

Details

If x and y are of different dimensions, function mdist returns a value of -1, which indicates the mdist(x,y) is not defined in this scenario. When x and y have the same dimension, suppose they have p components. If p=1, then x or y is the abundance level measurement of a single metabolite, which is a non-negative real number. If p>1, then x or y is measurements of a metebolite-set with multiple metabolites. In this case, let x_i be the ith component of x, which is non-negative and denotes the abundance level measurement of the ith metabolite in the metabolite-set. The distance between x and y is defined as:

mdist(x,y)= √ { ∑_i I[δ_{x_i} \neq δ_{y_i}]+ ∑_i (x_i-y_i)^2 },

where δ_{x_i}=0 if x_i=0, elsewise, δ_{x_i}=1, and I[\cdot] is the indicator function.

Value

This function returns a non-negative value if x and y are of the same dimension. Otherwise it returns -1.

References

Zhan, X., Patterson, A. D., & Ghosh, D. (2015). Kernel approaches for differential expression analysis of mass spectrometry-based metabolomics data. BMC Bioinformatics, 16(1), 77.

Examples

x=c(0,1,2)
	y=c(1,0,3)
	z=c(0,1,2,3)
	mdist(x,y)
	mdist(x,z)

KMDA

Kernel-Based Metabolite Differential Analysis

v1.0
GNU General Public License
Authors
Xiang Zhan and Debashis Ghosh
Initial release
2015-03-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.