fetch_bw_dt: fetch_bw_dt

fetch_bw_dtR Documentation

fetch_bw_dt

Description

fetches a tidy data.table of read pileups from bams, automatically uses cache.

Usage

fetch_bw_dt(
  qdt,
  qgr,
  qwin = 50,
  qmet = "summary",
  agg_FUN = mean,
  bfc = NULL,
  n_cores = getOption("mc.cores", 1),
  rname = NULL,
  force_overwrite = FALSE,
  verbose = TRUE
)

Arguments

qdt

data.table containing, file, tall_var, wide_var, and optionally norm_factor

qgr

GRanges of regions to fetch

qwin

number of datapoints to use to view each region

qmet

strategy to use in each region, summary or sample

agg_FUN

used to aggregate any duplicate tall_var+wide_var mappings in qdt.

bfc

BiocFileCache object to use to cache data

n_cores

number of cores to use. Defaults to value of mc.cores or 1 if mc.cores is not set.

rname

rname to use with cache. Default is a digest of arguments used to fetch data.

force_overwrite

if TRUE, any contents of cache are overwritten.

Value

a tidy data.table of bigwig profiles at qgr views

Examples

data("query_gr")
bw_files = dir(system.file('extdata', package = "chiptsne"),
    pattern = ".bw$", full.names = TRUE)
cfg_dt = data.table(file = bw_files)
cfg_dt[, c("tall_var", "wide_var") := tstrsplit(basename(file), "_", keep = 1:2)]
cfg_dt = cfg_dt[tall_var %in% c("ESH1", "HUES48", "HUES64")]
cfg_dt[, norm_factor := ifelse(wide_var == "H3K4me3", .3, 1)]
profile_dt = fetch_bw_dt(cfg_dt, query_gr)
profile_dt

jrboyd/seqtsne documentation built on Nov. 5, 2022, 6:37 a.m.