sparse2interactions: Convert sparse contact map to atomic interactions.

Description Usage Arguments Value See Also Examples

Description

Converts contact map in sparse data frame format into data frame with interaction, where one row is single interaction. This is usefull for bootstraping Hi-C interactions.

Usage

1
sparse2interactions(sparse.mtx)

Arguments

sparse.mtx

data.frame Hi-C contact map in sparse format with mandatory columns i, j, val

Value

data.frame with 2 columns, which are i-th (x) and j-th (y) coordinates of every interaction.

See Also

dense2sparse

Examples

1
2
3
4
5
# create data frame with artificial interactions, where val
# indicates total number of interactions between bins i and j
sparse.mtx <- data.frame(i = c(1,3,5,7,8,9,11), j = c(7,2,1,1,3,10,9), val = c(10,8,3,1,1,2,20))
print(sparse.mtx)
sparse2interactions(sparse.mtx)

rz6/DIADEM documentation built on Dec. 31, 2019, 3:51 a.m.