Prepare LD input files for GoShifter. Accepts either a sparse LD matrix RDS file (from echoLD) or a PLINK .ld file. The output is a set of per-chromosome, bgzipped and tabix-indexed LD files.

GOSHIFTER_create_LD(
  locus_dir,
  dat = NULL,
  LD_path = NULL,
  conda_env = "goshifter",
  nThread = 1,
  verbose = TRUE
)

Arguments

locus_dir

Path to the locus-level results directory.

dat

A data.table or data.frame with at least columns SNP, CHR, and POS. If NULL, will attempt to read from the multi-finemap results in locus_dir.

LD_path

Path to the LD file. If NULL, the first .RDS file in <locus_dir>/LD/ is used.

conda_env

Conda environment name in which bgzip and tabix can be found (default "goshifter").

nThread

Number of threads for file I/O (default 1).

verbose

Print messages (default TRUE).

Value

Path to the LD output folder (invisibly).

Examples

if (FALSE) { # \dontrun{
dat <- echodata::BST1
locus_dir <- echodata::locus_dir
LD_folder <- GOSHIFTER_create_LD(
    locus_dir = locus_dir,
    dat = subset(dat, P < 5e-8)
)
} # }