Thanks I'll check that too. Actually I found a way to add weight column in the converted mcool file by using cooler package.
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?
2 answers
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.
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.
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
Log in to answer this question.