Learn R Programming

GRAB (version 0.2.4)

GRAB.WtCoxG: Instruction of WtCoxG method

Description

WtCoxG is a Cox-based association test method for time-to-event traits. It effectively addresses case ascertainment and rare variant analysis. By leveraging external minor allele frequencies from public resources, WtCoxG can further boost statistical power.

Usage

GRAB.WtCoxG()

Arguments

Details

Additional Parameters for GRAB.NullModel():

  • RefAfFile (character, required): Reference allele frequency file path. File must contain columns: CHROM, POS, ID, REF, ALT, AF_ref, AN_ref

  • RefPrevalence (numeric, required): Population-level disease prevalence for weighting. Must be in range (0, 0.5)

Additional Control Parameters for GRAB.NullModel():

  • OutlierRatio (numeric, default: 1.5): IQR multiplier for outlier detection

Method-specific elements in the WtCoxG_NULL_Model object returned by GRAB.NullModel()::

  • mresid: Martingale residuals from weighted Cox model (numeric).

  • Cova: Design matrix of covariates (matrix).

  • yVec: Event indicator (numeric).

  • weight: Observation weights based on reference prevalence (numeric).

  • RefPrevalence: Reference population prevalence used for weighting (numeric).

  • outLierList: List identifying outlier subjects for SPA adjustment.

  • mergeGenoInfo: Data frame with batch effect QC results and external reference data.

Additional Control Parameters for GRAB.Marker():

  • cutoff (numeric, default: 0.1): Cutoff of batch effect test p-value for association testing. Variants with batch effect p-value below this cutoff will be excluded from association testing.

Output file columns:

Pheno

Phenotype identifier (for multi-trait analysis).

Marker

Marker identifier (rsID or CHR:POS:REF:ALT).

Info

Marker information in format CHR:POS:REF:ALT.

AltFreq

Alternative allele frequency in the sample.

AltCounts

Total count of alternative alleles.

MissingRate

Proportion of missing genotypes.

Pvalue

P-value from the score test.

zScore

Z-score from the score test.

References

Li et al. (2025). Applying weighted Cox regression to genome-wide association studies of time-to-event phenotypes. tools:::Rd_expr_doi("10.1038/s43588-025-00864-z")

Examples

Run this code
# Step 1: fit null model and test batch effect
PhenoFile <- system.file("extdata", "simuPHENO.txt", package = "GRAB")
PhenoData <- data.table::fread(PhenoFile, header = TRUE)
SparseGRMFile <- system.file("extdata", "SparseGRM.txt", package = "GRAB")
GenoFile <- system.file("extdata", "simuPLINK.bed", package = "GRAB")
RefAfFile <- system.file("extdata", "simuRefAf.txt", package = "GRAB")
OutputFile <- file.path(tempdir(), "resultWtCoxG.txt")

obj.WtCoxG <- GRAB.NullModel(
  survival::Surv(SurvTime, SurvEvent) ~ AGE + GENDER,
  data = PhenoData,
  subjIDcol = "IID",
  method = "WtCoxG",
  traitType = "time-to-event",
  GenoFile = GenoFile,
  SparseGRMFile = SparseGRMFile,
  RefAfFile = RefAfFile,
  RefPrevalence = 0.1
)

# Step2
GRAB.Marker(obj.WtCoxG, GenoFile, OutputFile)

head(data.table::fread(OutputFile))

Run the code above in your browser using DataLab