grm: Genetic relationship matrix

Description Usage Arguments Examples

View source: R/rel.R

Description

Computers a genetic relationship matrix (GRM) from SNP data.

Usage

1
grm(x, checkPD = TRUE, ...)

Arguments

x

a matrix (n x p) of n individuals (rows) and p SNPs (columns). The alleles have to be coded by AA = 0, AB = 0.5, and BB = 1. Missing data are not yet allowed.

checkPD

logickal, if true (default) the nearest positive definite matrix to the GRM is compute if the GRM does not fulfill these requirements anyways.

...

additional arguments to nearPD.

Examples

1
2
3
4
5
6
# simulate data
set.seed(123)
x <- matrix(rbinom(1000, 2, .7)/2, 10, 100)
rownames(x) <- paste0("indiv", 1:nrow(x))
# estimated relationship matrix
genorel <- grm(x)

jrklasen/relMM documentation built on May 19, 2019, 11:53 p.m.