Learn R Programming

GRAB (version 0.2.4)

SPAGRM.NullModel: Fit SPAGRM null model from residuals and relatedness inputs

Description

Builds the SPAGRM null model object using subject residuals, sparse GRM, and pairwise IBD estimates, detecting residual outliers and constructing family-level graph structures for downstream saddlepoint marker tests.

Usage

SPAGRM.NullModel(
  ResidMatFile,
  SparseGRMFile,
  PairwiseIBDFile,
  control = list(MaxQuantile = 0.75, MinQuantile = 0.25, OutlierRatio = 1.5,
    ControlOutlier = TRUE, MaxNuminFam = 5, MAF_interval = c(1e-04, 5e-04, 0.001, 0.005,
    0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5))
)

Value

A list of class "SPAGRM_NULL_Model" with elements:

Resid

Numeric vector of residuals used in analysis.

subjData

Character vector of subject IDs (length = N).

N

Number of subjects.

Resid.unrelated.outliers

Residuals of unrelated outlier subjects.

R_GRM_R

Sum of quadratic form Resid' * GRM * Resid for all subjects.

R_GRM_R_TwoSubjOutlier

Aggregate contribution from two-subject outlier families.

sum_R_nonOutlier

Sum of residuals for non-outlier unrelated subjects.

R_GRM_R_nonOutlier

Quadratic form contribution for non-outlier unrelated subjects.

TwoSubj_list

List with per two-member family residual/Rho info.

ThreeSubj_list

List with Chow–Liu tree structures and standardized scores for larger families.

MAF_interval

Vector of MAF breakpoints used in tree construction.

Arguments

ResidMatFile

Data frame or file path with columns SubjID, Resid.

SparseGRMFile

File path to sparse GRM (tab-delimited: ID1, ID2, Value).

PairwiseIBDFile

File path to pairwise IBD table (ID1, ID2, pa, pb, pc).

control

List of options controlling outlier handling and family decomposition (see checkControl.SPAGRM.NullModel).