paulsengroup / hictk

Blazing fast toolkit to work with .hic and .cool files
MIT License
23 stars 1 forks source link

How to load the converted .hic file into Juicerbox #191

Closed Nuturetree closed 4 months ago

Nuturetree commented 4 months ago

The hic file regenerated by the order: hictk load genome.sizes A1.hic -f validpairs -b 40000 < A1.allValidPairs

However the .hic file can not load into the juicerbox, how to resolved the err. A1.zip

robomics commented 4 months ago

Hi!

I can open the file just fine on my laptop: image

The .hic files generated by hictk are in .hic v9 format (the latest revision). Older versions of juicebox cannot open these files, and I suspect this may be the problem in your case.

Can you try to open the files using juiceboxGUI (instead of normal Juicebox): https://github.com/aidenlab/JuiceboxGUI/releases/tag/v3.1.4

According to Juicebox's README newer versions of Juicebox will be published in the JuiceboxGUI repository.

Nuturetree commented 4 months ago

thanks I have a other question, how to convert the validpairs to the matrix (Bin1 bin2 reads).

robomics commented 4 months ago

Did the above suggestion solve your issue?

hictk cannot directly convert validpairs to the COO format you are referring to. However, once you have the validpairs loaded into a .hic or .cool file, then you can use hictk dump to view interactions in COO format.

See the docs for an example of how this can be done (you probably need to run something like hictk dump mymatrix.hic --resolution 10000).

Nuturetree commented 4 months ago

Could this feature be added, as the matrix format generated by HiC-Pro is also important for downstream analysis?

robomics commented 4 months ago

Can you paste here the head of the matrix file you are talking about?

If I remember correctly HiC-Pro matrix files are in one-based COO format already. If this is the case (and I understand your question correctly), then you can load the pre-binned interactions using hictk load -f coo --one-based ... < file.matrix

Nuturetree commented 4 months ago

thanks