4dn-dcic / hic2cool

Lightweight converter between hic and cool contact matrices.
MIT License
66 stars 7 forks source link

juicer hic (fragment level matrix) convert into cooler #40

Closed Linhua-Sun closed 4 years ago

Linhua-Sun commented 4 years ago

Hi: I am wondering whether there is a way to convert fragment level contact matrix into cooler format file. The fragment level contact matrix is from juicer .hic format file (https://github.com/aidenlab/juicer/wiki/Pre) including 8 fragment-delimited resolutions are added: 500f, 250f, 100f, 50f, 20f, 5f, 2f, 1f. Thanks

nvictus commented 4 years ago

Variable length bins are supported in cooler. If it is not yet available in hic2cool, you can ingest the same kind of "Pre" input data (i.e. pairs) to cooler cload pairs, or binned data to cooler load.

In the case of fragments, the bins argument will be a BED file of the restriction fragment segmentation of the genome. You can use cooler digest to make one if you can't get it from the hic file.

That will give you the 1f resolution. Then use cooler zoomify to create an mcool including whatever coarser resolutions you like.

Linhua-Sun commented 4 years ago

Wow. Thanks! Great idea.