snphamming: Diffusion kernels on SNP genotypes

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function construct a diffusion kernel on a p-dimensional SNP hamming graph, where each genotype takes on three possible configurations, namely 0 ('aa'), 1 ('Aa'), and 2('AA'). This graph is obained by the p-Cartesian graph product of a complete graph K_3. It contains 3^p vertices corresponding to sequences of genotypes, and two vertices are adjacent if and only if just one SNP locus differs.

Usage

1
snphamming(X, theta)

Arguments

X

A genotype matrix of n individuals with p SNPs (n \times p).

theta

The rate of diffusion.

Value

Diffusion kernel matrix of size n \times n. This can be viewed as a covariance among individuals given the diffusion rate.

Author(s)

Gota Morota morota@unl.edu and Masanori Koyama koyama.masanori@gmail.com

References

Kondor R and Lafferty J: (2002) Diffusion Kernels on Graphs and Other Discrete Input Spaces. ICML.

Morota G, Koyama M, Rosa GJM, Weigel KA, and Gianola D. (2013). Predicting complex traits using a diffusion kernel on genetic markers with an application to dairy cattle and wheat data. Genetics Selection Evolution. 45:17.

See Also

snpgrid

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# set a seed
set.seed(4321)

# create a genotype matrix of 5 individuals with 10 SNPs
X <- matrix(sample(c(0,1,2), 50, prob=c(0.35, 0.3, 0.35), replace=TRUE),
ncol=10)

# set the rate of diffusion equal to 1
theta <- 1

# compute a SNP hamming kernel 
snphamming(X, theta)

Example output

          [,1]      [,2]      [,3]      [,4]      [,5]
[1,] 1.0000000 0.5576808 0.5576808 0.4164650 0.3110079
[2,] 0.5576808 1.0000000 0.4819279 0.3110079 0.3110079
[3,] 0.5576808 0.4819279 1.0000000 0.5576808 0.4164650
[4,] 0.4164650 0.3110079 0.5576808 1.0000000 0.5576808
[5,] 0.3110079 0.3110079 0.4164650 0.5576808 1.0000000

dkDNA documentation built on May 2, 2019, 5:15 a.m.