Aggregate signal counts across a set of regions

# S4 method for DsATAC
regionAggregation(
  .object,
  regGr,
  type,
  signal = NULL,
  aggrFun = "median",
  dropEmpty = TRUE,
  bySample = TRUE,
  chunkSize = 5000L
)

Arguments

.object

DsATAC object

regGr

GRanges object containing regions to summarize

type

character string specifying a name for the region type

signal

character string specifying a name for the region type for the signal to be aggregated If it is NULL (default), the new region type will be initialized with NA values. If it is "insertions" count data will be initialized from insertion sites (if fragment data is present in the object).

aggrFun

aggregation function for signal counts. Will only be used if signal!="insertions" Currently sum, mean and median (default) are supported.

dropEmpty

discard all regions with no observed signal counts

bySample

[only relevant if signal=="insertions"]. Process data sample-by-sample to save memory.

chunkSize

[only relevant if signal=="insertions" & !bySample] number of samples to process per chunk (saves memory). If NULL or larger than the number of samples, only one chunk will be processed.

Value

a new DsATAC object with aggregated signal counts per regions

Author

Fabian Mueller