GRM: Genetic Relationship Matrix

View source: R/bm_grm.r

GRMR Documentation

Genetic Relationship Matrix

Description

Compute the Genetic Relationship Matrix

Usage

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

Arguments

x

A bed.matrix

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

Details

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.

Value

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.

Author(s)

Hervé Perdry and Claire Dandine-Roulland

See Also

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

Examples

# 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)

gaston documentation built on May 29, 2024, 7:33 a.m.