Skip to contents

Quantile TWAS Weight Pipeline

Usage

quantile_twas_weight_pipeline(
  X,
  Y,
  Z = NULL,
  maf = NULL,
  region_id = "",
  ld_reference_meta_file = NULL,
  twas_maf_cutoff = 0.01,
  ld_clumping = FALSE,
  ld_pruning = FALSE,
  screen_significant = FALSE,
  quantile_qtl_tau_list = seq(0.05, 0.95, by = 0.05),
  quantile_twas_tau_list = seq(0.01, 0.99, by = 0.01),
  screen_threshold = 0.05,
  xi_tau_range = seq(0.1, 0.9, by = 0.05),
  keep_variants = NULL
)

Arguments

X

Matrix of genotypes

Y

Matrix or vector of phenotypes

Z

Matrix of covariates (optional)

maf

Vector of minor allele frequencies (optional)

region_id

Name of the region being analyzed

quantile_qtl_tau_list

Vector of quantiles for QTL analysis

quantile_twas_tau_list

Vector of quantiles for TWAS analysis

Value

A list containing various results from the TWAS weight pipeline:

  • qr_screen_pvalue_df: Data frame with QR screening results: pavlue, qvalue and zscore.

  • message: Any informational or warning messages.

  • twas_variant_names: Names of variants used in TWAS weight calculation.

  • rq_coef_df: Data frame with quantile regression coefficients.

  • twas_weight: Matrix of TWAS weights.

  • pseudo_R2: Vector of pseudo R-squared values.

  • quantile_twas_prediction: Matrix of TWAS predictions.

Details

The function performs the following steps: 1. QR screening to identify significant SNPs. 2. Filtering of highly correlated SNPs. 3. LD clumping and pruning(use filtered SNPs from step 1). 4. Calculation of QR coefficients for selected SNPs(use filtered SNPs from step 3). 5. Calculation of TWAS weights and pseudo R-squared values(use filtered SNPs from step 2).

Examples

# Example usage:
# X <- matrix of genotypes
# Y <- vector of phenotypes
# Z <- matrix of covariates
# results <- quantile_twas_weight_pipeline(X, Y, Z, region_id = "GeneA")