Skip to content

Commit

Permalink
Merge pull request #66 from haizi-zh/master
Browse files Browse the repository at this point in the history
🐛 Fix a critical bug in hic2mat/bed2mat
  • Loading branch information
TaoYang-dev authored Dec 13, 2020
2 parents ce2c3a8 + a42551c commit e485dfa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions R/bed2mat.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
bed2mat <- function(bed, resol = "NONE"){
# n the max number of bin
if (resol == "NONE") {
N = max(bed[,c(1:2)])
N = max(bed[,c(1:2)]) + 1
} else {
N = max(bed[,c(1:2)])/resol
bed[,1] = bed[,1]/resol
bed[,2] = bed[,2]/resol
N = max(bed[,c(1:2)])/resol + 1
bed[,1] = bed[,1]/resol + 1
bed[,2] = bed[,2]/resol + 1
}

mat = matrix(0, N, N)
Expand Down

0 comments on commit e485dfa

Please sign in to comment.