mat2df: Transform the contacts of a 'dgTMatrix' into a 'data.frame'

Description Usage Arguments Details Value Examples

View source: R/mat2df.R

Description

This function takes a sparse matrix of contacts and transforms it into a data.frame. It works only with matrices of one chromosome.

Usage

1
mat2df(mat, b = NULL, both = FALSE)

Arguments

mat

A dgTMatrix of contacts with genomic bins as row.names.

b

An optional vector of genomic position (otherwhise, it uses the information contained in the row.names.

both

A logical indicating if both (bin index and position) should be returned.

Details

Please note that mat is expected to be a matrix of one chromosome (you could obtain one using subset_matrix).

Value

A data.frame with the two coordinates (i and j) and the number of contacts (x).

Examples

1
plot(0)

qenvio/dryhic documentation built on March 17, 2020, 8:37 p.m.