GRM | R Documentation |
Compute the Genetic Relationship Matrix
GRM(x, which.snps, autosome.only = TRUE, chunk = 1L)
x |
A |
which.snps |
Logical vector, giving which snps to use in the computation. The default is to use all autosomal SNPs |
autosome.only |
If |
chunk |
Parameter for the parallelization: how many SNPs are treated by each task |
The Genetic Relationship Matrix (GRM) is computed by the formula {1\over q}XX'
,
with X
the standardized genotype matrix and q
the number of SNPs
(ncol(x)
).
If x
is not standardized before this computation, the function
will use standardize(x) <- "p"
by default.
The GRM is a symmetric square matrix of dimension equal to the number of individuals. Each entry can be interpreted as an estimated kinship coefficient between individuals, although some authors might disagree. Note in particular that some entries will be negative.
Hervé Perdry and Claire Dandine-Roulland
DM
, reshape.GRM
, lmm.aireml
, lmm.diago
, standardize
, bed.loadings
# load chr2 data set (~10k SNPs in low LD)
x <- read.bed.matrix( system.file("extdata", "chr2.bed", package="gaston") )
# Compute Genetic Relationship Matrix
K <- GRM(x)
dim(K)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.