grMatrix: C++ implementation to compute the genomic relationship matrix...

View source: R/locStra.r

grMatrixR Documentation

C++ implementation to compute the genomic relationship matrix (grm) for a (sparse) input matrix as defined in Yang et al. (2011).

Description

C++ implementation to compute the genomic relationship matrix (grm) for a (sparse) input matrix as defined in Yang et al. (2011).

Usage

grMatrix(m, useCpp = TRUE, sparse = TRUE, robust = TRUE)

Arguments

m

A (sparse) matrix for which the genomic relationship matrix is sought. The input matrix is assumed to be oriented to contain the data for one individual per column.

useCpp

Flag to switch between R or C++ implementations. Default is useCpp=TRUE.

sparse

Flag to switch between purpose-built dense or sparse implementations. Default is sparse=TRUE.

robust

Flag to indicate if the classic (robust=FALSE) or robust (robust=TRUE) version of the genomic relationship matrix is desired. Default is robust=TRUE.

Value

The genomic relationship matrix of m.

References

Yang J, Lee SH, Goddard ME, Visscher PM (2011). GCTA: a tool for genome-wide complex trait analysis. Am J Hum Genet, 88(1):76-82.

Examples

require(locStra)
require(Matrix)
m <- matrix(sample(0:1,15,replace=TRUE),ncol=3)
sparseM <- Matrix(m,sparse=TRUE)
print(grMatrix(sparseM))


locStra documentation built on April 13, 2022, 1:07 a.m.

Related to grMatrix in locStra...