smoothMat: smooth the Hi-C matrix with mean filter

Description Usage Arguments Details Value References Examples

View source: R/smoothMat.R

Description

smooth the Hi-C matrix with mean filter

Usage

1
smoothMat(dat, h)

Arguments

dat

A N*N Hi-C intra-chromosome matrix.

h

The neighborhood size parameter. It is the distance of smoothing target bin to the boundary of the neighborhood in the unit of resolution.

Details

Given a Hi-C N*N matrix, the algorithm scans through each data points (i, j), idnetifies points within its neighborhood of size h (max distance to (i, j) is h*resolution), and calculates the mean. The mean is subsequently used as the smoothed value of the point (i, j).

Value

a smoothed (or not when resol = 0), zero-filtered and vectorized Hi-C data.

References

HiCRep: assessing the reproducibility of Hi-C data using a stratum-adjusted correlation coefficient. Tao Yang, Feipeng Zhang, Galip Gurkan Yardimci, Ross C Hardison, William Stafford Noble, Feng Yue, Qunhua Li. bioRxiv 101386; doi: https://doi.org/10.1101/101386.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(HiCR1)

#re-format the row and column names
resol <- 1000000 
ref_Rep1 <- HiCR1[,-c(1,2,3)]
rownames(ref_Rep1) = colnames(ref_Rep1) = HiCR1[,3]-resol/2

smt_HiC_R1 <- smoothMat(ref_Rep1, 1)
dim(smt_HiC_R1)
smt_HiC_R1[1:5,1:5]

Example output

[1] 52 52
        5e+05 1500000 2500000 3500000 4500000
5e+05       0       0       0       0       0
1500000     0       0       0       0       0
2500000     0       0       0       0       0
3500000     0       0       0       0       0
4500000     0       0       0       0       0

hicrep documentation built on April 28, 2020, 7:51 p.m.