deeptools / HiCExplorer

HiCExplorer is a powerful and easy to use set of tools to process, normalize and visualize Hi-C data.
https://hicexplorer.readthedocs.org
GNU General Public License v3.0
231 stars 70 forks source link

hicMergeMatrixBins is not working properly with cool format #796

Open DonQwerty opened 2 years ago

DonQwerty commented 2 years ago

It looks like the matrix is displaced when you use hicMergeMatrixBins from high resolution instead of building the matrix at that resolution. First, with hicBuildMatrix, I did a 5kb resolution matrix using cool format and then, using hicMergeMatrixBins with -nb 8, I created a 40kb matrix . However, when I did some metanalysis centered on CTCF peaks, the 40kb matrix gave me weird results, but not with the 5kb. When I compare it, I saw that the 40kb matrix was displaced to the left, maybe because some columns were removed when merging the 5kb resolution (everything was uncorrected matrices). Also, the verified this, I created directly the matrix with hicBuildMatrix with 40kb resolution and the metaplot results were the same as with 5kb (but totally diferent from the merged matrix)

For example, If you plot 1Mb around chr2:20293400-20293821 in hg19 you obtain:

And also the shape of the matrix is reduced:

Finally, because in cool format a column with all zeros is consider as NaN, if you sum two uncorrected matrices but one having this zero column, you are going to lose the information even although the other matrix has data on it,and that would be a bug, no?

Thank you for all, I like a lot your program Daniel

DonQwerty commented 2 years ago

Ok I have seen that in the documentation says the format must be h5; maybe would be useful a disclaimer saying that it doesn't work with cool format