Performs KR (Knight-Ruiz) normalization on a Hi-C matrix
KRnorm(A)
A | the matrix to be normalized - any columns/rows of 0's will be removed before being normalized. |
---|
A KR normalized matrix
Performs KR normalization. The function is a translation of the `Matlab` code provided in the 2012 manuscript. Knight PA, Ruiz D. A fast algorithm for matrix balancing. IMA Journal of Numerical Analysis. Oxford University Press; 2012; drs019.
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] #> [1,] 0.031717 0.159124 0.088584 0.018704 0.107713 0.091780 0.126376 0.076765 #> [2,] 0.139233 0.074842 0.166658 0.070376 0.112580 0.092090 0.090574 0.077024 #> [3,] 0.110731 0.027776 0.185557 0.104476 0.150417 0.076900 0.126057 0.021440 #> [4,] 0.056111 0.093835 0.078357 0.132353 0.127035 0.108244 0.085170 0.090536 #> [5,] 0.017952 0.090064 0.250694 0.105863 0.040644 0.103895 0.102184 0.069518 #> [6,] 0.091780 0.069068 0.153800 0.086595 0.145452 0.148724 0.062690 0.017770 #> [7,] 0.090269 0.090574 0.050423 0.127754 0.143058 0.062690 0.184973 0.069912 #> [8,] 0.061412 0.038512 0.107199 0.162964 0.191175 0.106623 0.087390 0.074317 #> [9,] 0.105620 0.088314 0.147494 0.062283 0.199270 0.040750 0.100199 0.119293 #> [10,] 0.123212 0.220766 0.147481 0.062278 0.079701 0.081493 0.080152 0.068161 #> [,9] [,10] #> [1,] 0.088017 0.211220 #> [2,] 0.110393 0.066230 #> [3,] 0.073747 0.122900 #> [4,] 0.083045 0.145315 #> [5,] 0.099635 0.119551 #> [6,] 0.163001 0.061120 #> [7,] 0.080159 0.100190 #> [8,] 0.051126 0.119282 #> [9,] 0.117239 0.019538 #> [10,] 0.039076 0.097681