Learn R Programming

gaston (version 1.4.9)

GRM: Genetic Relationship Matrix

Description

Compute the Genetic Relationship Matrix

Usage

GRM(x, which.snps, autosome.only = TRUE, chunk = 1L)

Arguments

which.snps
Logical vector, giving which snps to use in the computation. The default is to use all autosomal SNPs
autosome.only
If TRUE, only autosomal SNPs will be considered.
chunk
Parameter for the parallelization: how many SNPs are treated by each task

Value

Each entry can be interpreted as an estimated kinship coefficient between individuals, although some authors might disagree.

Details

The Genetic Relationship Matrix (GRM) is computed by the formula $XX'/q$, with $X$ the standardized genotype matrix and $q$ the number of SNPs (ncol(x)).

Note that x needs to be standardized before this computation, either by standardize(x) <- "p" or by standardize(x) <- "mu_sigma".

See Also

reshape.GRM, lmm.aireml, lmm.diago, standardize, bed.loadings

Examples

Run this code
# 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)

Run the code above in your browser using DataLab