fetch_bam_stranded_dt: fetch_bam_stranded_dt

fetch_bam_stranded_dtR Documentation

fetch_bam_stranded_dt

Description

fetches a tidy data.table of scores from bigwigs, automatically uses cache. In contrast to fetch_bam_dt, fragment size is not calculated and fragments are not extended and pileup per strand is stored.

Usage

fetch_bam_stranded_dt(
  qdt,
  qgr,
  qwin = 50,
  qmet = "summary",
  agg_FUN = sum,
  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

function used to aggregate any duplicate tall_var+wide_var mappings in qdt. Should accept a numeric vector and return a single value.

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 profile data.

Examples

data("query_gr")
bam_files = dir(system.file('extdata', package = "chiptsne"),
    pattern = ".bam$", full.names = TRUE)
cfg_dt = data.table(file = bam_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_bam_stranded_dt(cfg_dt, query_gr)
profile_dt

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