full2sparse: Transfrom a full Hi-C contact matrix to a sparse upper...

Description Usage Arguments Value Examples

View source: R/matrix_transformations.R

Description

Transfrom a full Hi-C contact matrix to a sparse upper triangular matrix

Usage

1

Arguments

mat

A matrix. Must have column names equal to the start location for each bin. i.e. for a 6x6 Hi-C matrix where the first region starts at 0 kb and the final region starts at 500KB and the resolution is 100kb, the column names of the matrix should be as follows: colnames(mat) = c(0, 100000, 200000, 300000, 400000, 500000)

Value

A sparse upper triangular matrix.

Examples

1
2
3
4
m <- matrix(1:100, 10, 10)
colnames(m) <- 1:10
sparse <- full2sparse(m)
sparse

HiCcompare documentation built on Nov. 8, 2020, 8:26 p.m.