biglmmz: (depreciated) Fit a low-rank LMM on normalized genotypes.

Description Usage Arguments Details Examples

View source: R/biglmmz.R

Description

This function requires more resources to store the matrix of standardized genotypes in comparison to the function biglmmg. The two functions biglmmz and biglmmg perform the same model fitting, but biglmmg is recommended.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
biglmmz(
  y,
  X,
  Z,
  M,
  cols,
  backingfile = tempfile(),
  copy_Z = TRUE,
  K = NULL,
  scale = FALSE,
  impute = FALSE,
  REML = TRUE,
  compute_K = TRUE,
  store_mat = FALSE,
  verbose = 0
)

Arguments

y

A vector of trait values (quantitative trait).

X

A matrix of covariates. The default value is matrix of ones for the intercept (one column).

Z

A matrix of genotypes, that can be raw genotypes or normalized genotypes for the GRM. Missing values can be imputed by genotype means. The matrix can be either the standard R matrix or FBM. In the process of model fitting, the matrix Z is copied to a FBM matrix (that requires additional resources for storage on disk).

M

A scalar for normalization of the genetic relationship matrix: GRM = Z'Z / M, where Z is a matrix of standardized genotypes. If M is missing, M = length(cols).

cols

A vector of columns of Z to be used in the model. By default, all columns of Z are used.

backingfile

The path to a file where the matrix of standardized genotypes (internal to the function) is to be stored. By default, backingfile = tempfile().

copy_Z

(advanced) A boolean indicating whether the input matrix Z is ready for analysis or need to be copied. By default, copy_Z = TRUE.

K

A matrix with the pre-computed cross-product Z'Z / M. By default, K = NULL, that means K is pre-computed inside the function.

scale

Scale genotypes in Z? By default, scale = FALSE.

impute

Impute genotypes in Z by genotype means? By default, impute = FALSE.

REML

A boolean specifying the likelihood function, REML or ML.

compute_K

(advanced) Compute K? The default value is TRUE.

store_mat

(advanced) Store matrices? The default value is FALSE.

verbose

The verbose level. The default value is 0 (verbose).

Details

The linear mixed model (LMM) is: y_i = X_i b + u_i + e_i, where

u ~ N(0, s2*h2*G) and e ~ N(0, s2 I)

var(y) = V = s2 * (h2*G + I)

Examples

1
2
3
4
5
6
7
8
9
G <- attach_example200() # load simulated genotypes
G
G[1:5, 1:10]

y <- rnorm(nrow(G)) # generate a random phenotype
head(y)

mod <- biglmmz(y, Z = G, scale = TRUE)
mod$gamma # estimated h2

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