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.
SAGELD.NullModel(
NullModel,
UsedMethod = "SAGELD",
PlinkFile,
SparseGRMFile,
PairwiseIBDFile,
PvalueCutoff = 0.001,
control = list()
)A list of class "SAGELD_NULL_Model" with elements:
Character vector of subject IDs.
Number of subjects.
Method label: "SAGELD" or "GALLOP".
Per-subject sums for crossprod(X, G) terms.
Per-subject Rot %*% Si matrices for random effects.
Per-subject cross-products used in variance assembly.
Fixed-effect precision matrix (p x p).
Block matrix linking random and fixed effects.
Per-subject sums for crossprod(G).
Per-subject sums for crossprod(G, y).
Fixed-effects solution vector.
Random-effects BLUPs per subject.
Scale parameter extracted from VarCorr.
Residuals used in SAGELD testing.
Genetic component residuals.
GxE component residuals.
Environmental component residuals.
Residuals for unrelated outlier subjects.
G residuals for unrelated outliers.
GxE residuals for unrelated outliers.
Quadratic form Resid' * GRM * Resid (all subjects).
Quadratic form for G residuals.
Quadratic form for GxE residuals.
Cross-term quadratic form between G and GxE.
Quadratic form for E residuals.
Contribution from two-subject outlier families.
Two-subject outlier contribution (G).
Two-subject outlier contribution (GxE).
Two-subject outlier cross-term (G,GxE).
Sum of residuals for non-outlier unrelated subjects.
Sum of G residuals for non-outlier unrelated subjects.
Sum of GxE residuals for non-outlier unrelated subjects.
Quadratic form for non-outlier unrelated subjects.
Quadratic form for G (non-outlier unrelated).
Quadratic form for GxE (non-outlier unrelated).
Cross-term for G/GxE (non-outlier unrelated).
Per-family lists for N=2 outlier families.
CLT and standardized scores for larger families.
MAF breakpoints used in CLT construction.
Z-score threshold for E used in screening.
A fitted model from lme4 (class merMod) or
glmmTMB with a subject-specific random intercept (e.g., (1|ID)).
Character; either "SAGELD" (default) or "GALLOP".
Character. PLINK prefix (without extension) used to sample common markers for estimating the lambda parameter.
Character. Path to sparse GRM file produced by
getSparseGRM().
Character. Path to pairwise IBD file produced by
getPairwiseIBD().
Numeric p-value threshold for screening gene–environment association when estimating \(\lambda\).
List of options (forwarded to internal checks; see
checkControl.SAGELD.NullModel).