getCoverage: Calculate regions coverage

View source: R/utils.R

getCoverageR Documentation

Calculate regions coverage

Description

getCoverage calculates coverage of regions (rows in interaction matrix) by features (columns). It is possible to specify features grouping variable gr then coverage tells how many distinct groups the region overlap with.

Usage

getCoverage(mat, gr)

Arguments

mat

dgCMatrix interaction matrix such as produced by getInteractionMatrix.

gr

factor specifying features groups. Must have length equal to number of columns in mat.

Value

Numeric vector.

Examples

data("remap_mini")
y <- colnames(remap_mini)

# simple coverage
gr <- seq_along(y) %>% as.factor()
getCoverage(remap_mini, gr)

# per cell type coverage
gr <- sub(".*\\.", "", y) %>% as.factor()
getCoverage(remap_mini, gr)


bkaczkowski/xcore documentation built on Jan. 26, 2024, 6:24 p.m.