sparse2full: Transform a sparse upper triangular matrix to a full Hi-C...

View source: R/matrix_transformations.R

sparse2fullR Documentation

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

Description

sparse2full will transform a sparse upper triangular Hi-C matrix to a full Hi-C chromatin contact matrix. If you are entering a simple sparse matrix, i.e. there are only 3 columns leave hic.table = FALSE and column.name = NA. If you wish to transform a Hi-C matrix in hic.table object format into a full matrix then set hic.table = TRUE. You will then need to specify the column name that you wish to be entered as the values for the cells in the full matrix using the column.name option.

Usage

sparse2full(sparse.mat, hic.table = FALSE, column.name = NA)

Arguments

sparse.mat

A matrix in sparse upper triangular format.

hic.table

Logical, is your sparse.mat a hic.table?

column.name

Character, Required if hic.table set to TRUE; The column name of the hic.table that you want placed into the cells of the full matrix. i.e. IF1, or p.value.

Value

A full Hi-C contact Matrix.

Examples

data('NHEK.chr22')
full.mat <- sparse2full(NHEK.chr22)


dozmorovlab/HiCcompare documentation built on June 30, 2023, 3:09 a.m.