big_scale_grm: Scale and normalize genotypes for GRM.

Description Usage Arguments Details Value Examples

View source: R/biglmmg.R

Description

The function creates a scaling function to be used for linear algebra operations on FBMs through the fun.scaling argument in downstream functions from bigstatsr.

Usage

1
big_scale_grm(center = TRUE, scale = TRUE, M)

Arguments

center

Center?

scale

Scale?

M

A normalization value. It is typically equal to the number of columns in a matrix (for which the scaling function is created).

Details

The scaling function works such that the input matrix of raw genotypes is represented as a matrix Z, which cross product is the genetic relationship matrix (GRM), defined as scale(G) scale(G)' / M. In other words, GRM = ZZ'.

Value

A function that returns a data.frame with two columns "center" and "scale".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
G <- attach_example200()
dim(G)

M <- dim(G)[2] # number of columns
fun_sc <- big_scale_grm(M = M)
stats <- do.call(fun_sc, list(G))
str(stats)

# compare to the standard scaling function from bigstatsr
fun_sc0 <- big_scale()
stats0 <- do.call(fun_sc0, list(G))
str(stats0)

variani/biglmmz documentation built on Dec. 15, 2020, 7:58 a.m.