Skip to contents

This function processes GWAS and xQTL finemapped data files and then computes QTL enrichment. For details on the parameters `pi_gwas`, `pi_qtl`, `lambda`, `ImpN`, and `num_threads`, refer to the documentation of the `compute_qtl_enrichment` function.

Usage

xqtl_enrichment_wrapper(
  xqtl_files,
  gwas_files,
  xqtl_finemapping_obj = NULL,
  gwas_finemapping_obj = NULL,
  xqtl_varname_obj = NULL,
  gwas_varname_obj = NULL,
  num_gwas = NULL,
  pi_qtl = NULL,
  lambda = 1,
  ImpN = 25,
  double_shrinkage = FALSE,
  bessel_correction = TRUE,
  num_threads = 1
)

Arguments

xqtl_files

Vector of xQTL RDS file paths.

gwas_files

Vector of GWAS RDS file paths.

xqtl_finemapping_obj

Optional table name in xQTL RDS files (default 'susie_fit').

gwas_finemapping_obj

Optional table name in GWAS RDS files (default 'susie_fit').

xqtl_varname_obj

Optional table name in xQTL RDS files (default 'susie_fit').

gwas_varname_obj

Optional table name in GWAS RDS files (default 'susie_fit').

pi_qtl

Optional parameter for xQTL enrichment estimation (see `compute_qtl_enrichment`).

lambda

Shrinkage parameter for enrichment computation (see `compute_qtl_enrichment`).

ImpN

Importance parameter for enrichment computation (see `compute_qtl_enrichment`).

num_threads

Number of threads for parallel processing (see `compute_qtl_enrichment`).

pi_gwas

Optional parameter for GWAS enrichment estimation (see `compute_qtl_enrichment`).

Value

The output from the compute_qtl_enrichment function.

Examples

gwas_files <- c("gwas_file1.rds", "gwas_file2.rds")
xqtl_files <- c("xqtl_file1.rds", "xqtl_file2.rds")
result <- xqtl_enrichment_wrapper(gwas_files, xqtl_files)
#> Warning: cannot open compressed file 'xqtl_file1.rds', probable reason 'No such file or directory'
#> Error in map(gwas_files, function(file) {    raw_data <- readRDS(file)[[1]]    gwas_data <- if (!is.null(gwas_finemapping_obj))         get_nested_element(raw_data, gwas_finemapping_obj)    else raw_data    pip <- gwas_data$pip    if (!is.null(gwas_varname_obj))         names(pip) <- get_nested_element(raw_data, gwas_varname_obj)    pip}):  In index: 1.
#> Caused by error in `gzfile()`:
#> ! cannot open the connection