Execute the GoShifter Python tool on a set of SNPs against one or more annotation BED files. Iterates over each element of GRlist, checks for overlap with the SNP data, prepares annotation BED files, and calls the goshifter.py script.

GOSHIFTER_run(
  dat,
  locus_dir,
  GRlist,
  permutations = 1000,
  goshifter_path = NULL,
  chromatin_state = "TssA",
  R2_filter = 0.8,
  overlap_threshold = 1,
  remove_tmps = TRUE,
  verbose = TRUE
)

Arguments

dat

A data.table or data.frame with at least columns SNP, CHR, POS, and P.

locus_dir

Path to the locus-level results directory.

GRlist

A named GRangesList of annotation regions to test for enrichment (e.g. from ROADMAP_query).

permutations

Number of permutations (default 1000).

goshifter_path

Path to the directory containing goshifter.py. If NULL, uses the bundled copy (see GOSHIFTER_find_folder).

chromatin_state

Chromatin state label to record in the results (default "TssA").

R2_filter

LD r-squared threshold (default 0.8).

overlap_threshold

Minimum number of overlapping SNPs required to run GoShifter for a given annotation (default 1).

remove_tmps

Remove intermediate BED files after processing (default TRUE).

verbose

Print messages (default TRUE).

Value

A data.table with GoShifter results for all tested annotations.

Examples

if (FALSE) { # \dontrun{
dat <- echodata::BST1
locus_dir <- echodata::locus_dir
peaks <- echoannot::NOTT2019_get_epigenomic_peaks()
grl_peaks <- GenomicRanges::makeGRangesListFromDataFrame(
    peaks, split.field = "Cell_type"
)
GS_results <- GOSHIFTER_run(
    dat = subset(dat, P < 5e-8),
    locus_dir = locus_dir,
    GRlist = grl_peaks
)
} # }