views2Matrix: views2Matrix

View source: R/misc.R

views2MatrixR Documentation

views2Matrix

Description

converts a RleViews or RleViewsList with views of the same width to a matrix, setting out-of-bounds regions to NA (or 'padVal').

Usage

views2Matrix(v, padVal = NA_integer_)

Arguments

v

A 'RleViews' or 'RleViewsList' object with views of the same width.

padVal

The value to assign to out-of-bound regions.

Value

A numeric matrix.

Examples

# we create an example RleViews with out-of-bound regions:
library(IRanges)
co <- Rle(values=c(0,1,0), lengths=c(100,50,20))
v <- Views(co, c(25,150),c(50,175))
# convert to matrix
views2Matrix(v)

ETHZ-INS/epiwraps documentation built on Dec. 22, 2024, 4:05 a.m.