Learn R Programming

KMDA (version 1.0)

skernel: Stratified Kernel

Description

This function defines a stratified kernel for metabolite abundance level measurements.

Usage

skernel(x, y, rho)

Arguments

x
a numerical scalar or vector of metabolomic measurements.
y
a numerical scalar or vector of metabolomic measurements.
rho
a positive kernel shape parameter.

Value

  • A non-negative real value.

Details

This function calculates a stratified kernel function $skernel$ between two metabolomic measurements x and y. Suppose the metabolite-set contains $p$ metabolites. Then measurements x and y have $p$ components. Let $x_i$ be the $i$th component of x. If $x_i=0$, then the $i$th metabolite in the metabolite-set is absent. If $x_i>0$, then the $i$th metabolite is present and $x_i$ measures the abundance level of the $i$th metabolite. Measurements x and y are said to from the same stratum if they have the same set of metabolites being absent (present). If x and y are from the same stratum, then $skernel(x,y,\rho)$ is assigned a Gaussian kernel with kernel parameter $\rho$. Otherwise $skernel(x,y,\rho)$ is defined to be 0. More details can be found in Zhan et al. (2015).

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

Run this code
x=c(0,0,1,2)
	y=c(0,1,2,0)
	z=c(0,0,3,4)
	## x and z are from the same stratum while x and y are not. 
	skernel(x,y,1)
	skernel(x,z,1)

Run the code above in your browser using DataLab