restore_unmappable_mtx: Restores unmappable regions (all zeros columns and rows) in...

Description Usage Arguments Value Examples

Description

Restores unmappable regions (all zeros columns and rows) in dense matrix.

Usage

1
2
3
4
5
6
restore_unmappable_mtx(
  dense.mtx.mappable,
  idx.rows,
  idx.cols = NULL,
  empty.elem = NA
)

Arguments

dense.mtx.mappable

numeric matrix

idx.rows

integer vector, row indices of 0's elements in initial matrix (before rows removal) - the one which is to be restored

idx.cols

integer vector, column indices of 0's elements in initial matrix (before columns removal) - the one which is to be restored, by default it is equal to idx.rows

empty.elem

numeric or NA how to fill missing (restored) cells

Value

numeric matrix in dense format

Examples

1
2
3
4
5
# construct matrix with 0's row 5,7,8 and 0's columns 2,4
m <- matrix(1:32, ncol = 4); m[c(5,7,8),] <- 0; m[,c(2,4)] <- 0
l <- remove_unmappable(mtx)
restore_unmappable_mtx(l[["matrix"]], l[["indices.rows"]], idx.cols = l[["indices.cols"]])
restore_unmappable_mtx(l[["matrix"]], l[["indices.rows"]], idx.cols = l[["indices.cols"]], empty.elem = 0)

rz6/CopulaHiC documentation built on Dec. 31, 2019, 9:19 a.m.