fftab: Tabulate data in an 'ffTrack'

View source: R/ffTrack.R

fftabR Documentation

Tabulate data in an ffTrack

Description

Tabulates data in ffTrack file across a set of intervals (GRanges) by counting the number of positions matching a given "signature" or applying FUN to aggregate data. Returns the input GRanges populated with one or more meta data columns of counts or averages.

Similar to gr.val in gUtils

ff can be an ffTrack but also an RleList from same genome as intervals.

returns a GRanges with additional columns for metadata counts

Usage

fftab(ff, intervals, signatures = NULL, FUN = sum, grep = FALSE,
  mc.cores = 1, chunksize = 1e+06, verbose = TRUE, na.rm = TRUE)

Arguments

ff

ffTrack or RleList to pull data from

intervals

intervals

signatures

Signatures is a named list that specify what is to be tallied. Each signature (ie list element) consist of an arbitrary length character vector specifying strings to or length 1 character vector to grepl (if grep = TRUE) or a length 1 or 2 numeric vector specifying exact value or interval to match (for numeric data)

Every list element of signature will become a metadata column in the output GRanges specifying how many positions in the given interval match the given query

FUN

function to aggregate with (default is sum)

grep

logical flag (default FALSE), if TRUE will treat the strings in signature as inputs to grep (instead of exact matches if FALSE)

mc.cores

how many cores (default 1)

chunksize

chunk of FF to bring into memory (i.e. the width of interval), decrease if memory becomes an issue

verbose

logical flag

na.rm

logical flag whether to remove na during aggregation.


mskilab/ffTrack documentation built on Feb. 6, 2023, 2:47 a.m.