Learn R Programming

GRAB (version 0.2.4)

SAGELD.NullModel: Construct SAGELD/GALLOP null model from a mixed-effects fit

Description

Builds the SAGELD (or GALLOP) null model from a fitted mixed-effects model and relatedness inputs. Extracts variance components, forms the penalization matrix, derives residual summaries, and (for SAGELD) integrates sparse GRM and pairwise IBD to prepare graph-based components for marker testing.

Usage

SAGELD.NullModel(
  NullModel,
  UsedMethod = "SAGELD",
  PlinkFile,
  SparseGRMFile,
  PairwiseIBDFile,
  PvalueCutoff = 0.001,
  control = list()
)

Value

A list of class "SAGELD_NULL_Model" with elements:

subjData

Character vector of subject IDs.

N

Number of subjects.

Method

Method label: "SAGELD" or "GALLOP".

XTs

Per-subject sums for crossprod(X, G) terms.

SS

Per-subject Rot %*% Si matrices for random effects.

AtS

Per-subject cross-products used in variance assembly.

Q

Fixed-effect precision matrix (p x p).

A21

Block matrix linking random and fixed effects.

TTs

Per-subject sums for crossprod(G).

Tys

Per-subject sums for crossprod(G, y).

sol

Fixed-effects solution vector.

blups

Random-effects BLUPs per subject.

sig

Scale parameter extracted from VarCorr.

Resid

Residuals used in SAGELD testing.

Resid_G

Genetic component residuals.

Resid_GxE

GxE component residuals.

Resid_E

Environmental component residuals.

Resid.unrelated.outliers

Residuals for unrelated outlier subjects.

Resid.unrelated.outliers_G

G residuals for unrelated outliers.

Resid.unrelated.outliers_GxE

GxE residuals for unrelated outliers.

R_GRM_R

Quadratic form Resid' * GRM * Resid (all subjects).

R_GRM_R_G

Quadratic form for G residuals.

R_GRM_R_GxE

Quadratic form for GxE residuals.

R_GRM_R_G_GxE

Cross-term quadratic form between G and GxE.

R_GRM_R_E

Quadratic form for E residuals.

R_GRM_R_TwoSubjOutlier

Contribution from two-subject outlier families.

R_GRM_R_TwoSubjOutlier_G

Two-subject outlier contribution (G).

R_GRM_R_TwoSubjOutlier_GxE

Two-subject outlier contribution (GxE).

R_GRM_R_TwoSubjOutlier_G_GxE

Two-subject outlier cross-term (G,GxE).

sum_R_nonOutlier

Sum of residuals for non-outlier unrelated subjects.

sum_R_nonOutlier_G

Sum of G residuals for non-outlier unrelated subjects.

sum_R_nonOutlier_GxE

Sum of GxE residuals for non-outlier unrelated subjects.

R_GRM_R_nonOutlier

Quadratic form for non-outlier unrelated subjects.

R_GRM_R_nonOutlier_G

Quadratic form for G (non-outlier unrelated).

R_GRM_R_nonOutlier_GxE

Quadratic form for GxE (non-outlier unrelated).

R_GRM_R_nonOutlier_G_GxE

Cross-term for G/GxE (non-outlier unrelated).

TwoSubj_list

Per-family lists for N=2 outlier families.

ThreeSubj_list

CLT and standardized scores for larger families.

MAF_interval

MAF breakpoints used in CLT construction.

zScoreE_cutoff

Z-score threshold for E used in screening.

Arguments

NullModel

A fitted model from lme4 (class merMod) or glmmTMB with a subject-specific random intercept (e.g., (1|ID)).

UsedMethod

Character; either "SAGELD" (default) or "GALLOP".

PlinkFile

Character. PLINK prefix (without extension) used to sample common markers for estimating the lambda parameter.

SparseGRMFile

Character. Path to sparse GRM file produced by getSparseGRM().

PairwiseIBDFile

Character. Path to pairwise IBD file produced by getPairwiseIBD().

PvalueCutoff

Numeric p-value threshold for screening gene–environment association when estimating \(\lambda\).

control

List of options (forwarded to internal checks; see checkControl.SAGELD.NullModel).