ssvFetchGRanges {seqsetvis}R Documentation

Fetch coverage values for a list of GRanges.

Description

ssvFetchGRanges Gets coverage values for each region of the query GRanges (qgr). Values correspond to the center of each window of size win_size. A tidy formatted data.table object is returned suitable for plotting using ggplots.

Usage

ssvFetchGRanges(grs, qgr, file_attribs = data.frame(matrix(0, nrow =
  length(grs), ncol = 0)), unique_names = names(grs),
  names_variable = "sample", win_size = 50, win_method = c("sample",
  "summary")[1], summary_FUN = function(x, w) max(x),
  target_strand = c("*", "+", "-", "both")[1], anchor = c("left",
  "left_unstranded", "center", "center_unstranded")[3],
  return_data.table = FALSE, n_cores = getOption("mc.cores", 1))

Arguments

grs

a list of GRanges for which to calculate coverage.

qgr

Set of GRanges to query. For valid results the width of each interval should be identical and evenly divisible by win_size.

file_attribs

data.frame (1 row per item in grs) containing attributes to append to results.

unique_names

The column name where unique_names are stored. Default is 'sample'

names_variable

The column name where unique_names are stored. Default is 'sample'

win_size

The window size that evenly divides widths in qgr.

win_method

character. one of c("sample", "summary"). Determines if viewGRangesWinSample_dt or viewGRangesWinSummary_dt is used to represent each region in qgr.

summary_FUN

function. only relevant if win_method is "summary". passed to viewGRangesWinSummary_dt.

target_strand

character. if one of "+" or "-", reads are filtered to match. ignored if any other value.

anchor

character, one of c("center", "center_unstranded", "left", "left_unstranded")

return_data.table

logical. If TRUE the internal data.table is returned instead of GRanges. Default is FALSE.

n_cores

integer number of cores to use. Uses mc.cores option if not supplied.

Value

A tidy formatted GRanges (or data.table if specified) containing fetched values.

Examples

ssvFetchGRanges(CTCF_in_10a_narrowPeak_grs, CTCF_in_10a_overlaps_gr, win_size = 200)

[Package seqsetvis version 1.4.0 Index]