How to convert *.hic file to *.mcool file?
2
0
Entering edit mode
19 months ago
NikhilP ▴ 20

I have this *.hic file and I want to convert it into cool/mcool file.

I used this package hic2cool to convert the file, it is getting converted successfully but the resulted file doesn't have the weight column.

Without the weight column we cant do the downstream analysis. So is there any way I can add that externally?

hic mcool hic-data • 1.9k views
ADD COMMENT
1
Entering edit mode
18 months ago
niuzx9581 ▴ 30

You can try HiCLift? The software was designed to convert genomic location between different genome build (ex. hg19 -> hg38), but I think it can solves your problem.

ADD COMMENT
0
Entering edit mode

Thanks I'll check that too. Actually I found a way to add weight column in the converted mcool file by using cooler package.

ADD REPLY
0
Entering edit mode

I am encountering the same problem. I know I can use "cooler.balance_cooler" to calculate the weight, but couldn't figure out how to add it as a column to the mcool file. Could you share the way how you do it? Thank you so much.

ADD REPLY
0
Entering edit mode
13 months ago
rather • 0

Here is the code snippet to add the weight column to the bins

weight = cooler.balance_cooler(clr_name)
with clr.open('r+') as f:
      f["bins"].create_dataset("weight", data=weight[0], compression="gzip", compression_opts=6)'

This code snippet adds the weight column permanently to the bins. you can check this by the following code example

claname.bins()[:]

Alternatively, you can use the command line cooler balance <clr name>for each resolution. This also adds the balancing weight column to the cooler file permanently

ADD COMMENT

Login before adding your answer.

Traffic: 2512 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6