.mcool to .hic
2
1
Entering edit mode
2.3 years ago
dimitrischat ▴ 140

Hi. I am trying to work out a pipeline for hi-c data analysis. https://hms-dbmi.github.io/hic-data-analysis-bootcamp/#1

Though i would prefer to use Juicebox for visualization. I am at the point where i have .mcool file (cooler) and i need .hic file so i can load it in Juicebox. Anyone knows how?

I tried using the Higlass web based app but it need .json files.. i have no idea

RNA-Seq • 2.7k views
ADD COMMENT
1
Entering edit mode

I am one of the main developers of HiGlass, and I agree that our setup could and should be easier. Where specifically do you get stuck? Also, feel free to join our slack channel (http://bit.ly/higlass-slack) if you need quick help.

ADD REPLY
3
Entering edit mode
2.3 years ago

You can load your mcool files in your own HiGlass server that you can launch on your local machine using higlass-manage as explained in their documentation:

http://higlass.io/docs

https://github.com/higlass/higlass-manage

I agree that it is not easy to setup but it is worth the troubles.

For .mcool to .hic, the other way around is supported by hic2cool. I don't think there is an official way of converting .cool or .mcool to .hic right now... which is very unfortunate. So, sadly enough you have to start everything from scratch using Juicer if you want to use their visualisation tools. Maybe you can come up with using your mapped reads and their Pre tool:

https://github.com/aidenlab/juicer/wiki/Pre#file-format

People are switching to HiGlass to visualize Hi-C data currently anyway it seems... the setup is more complicated than Juicebox but the outcome seems better in certain ways.

As an alternative you can use HiCBrowser to directly visualise cool files, you can have an example here:

http://chorogenome.ie-freiburg.mpg.de/

For further visualisation and data integration to make figures ready to publish you can use pyGenomeTracks (although the views are static):

https://github.com/deeptools/pyGenomeTracks

For long range interactions, pyGenomeTracks and HiCBrowser are not the best to use, HiGlass and Juicer are better for that. If you don't mind static views you can also use hicPlotMatrix from HiCExplorer, which is similar to cooler show:

https://hicexplorer.readthedocs.io/en/latest/content/tools/hicPlotMatrix.html#hicplotmatrix

ADD COMMENT
3
Entering edit mode
10 weeks ago

I've put together a slightly hacky and long winded way to go from .cool to .hic

Firstly, use the hicConvertFormat tool from the HiCExplorer package (which I installed using conda) to convert your .cool file into a ginteractions file:

hicConvertFormat -m /path/to/file.cool -o /path/to/file.ginteractions --inputFormat cool --outputFormat ginteractions

This will create the file file.ginteractions.tsv. Next, we will do some format preparation on this file to make it compatible with juicer pre. Documentation on the input formats accepted can be found here: https://github.com/aidenlab/juicer/wiki/Pre . I opted to make the file into short format with score, which has columns like:

<str1> <chr1> <pos1> <frag1> <str2> <chr2> <pos2> <frag2> <score>

The ginteractions file does not contain fragment or strand information, so I put dummy variables for those (since they are not used for the conversion to .hic anyway) and made sure that the dummy variables for frag1 and frag2 were different, using the following awk command:

awk -F "\t" '{print 0, $1, $2, 0, 0, $4, $5, 1, $7}' file.ginteractions.tsv > file.ginteractions.tsv.short

I downloaded juicer tools from here: https://github.com/aidenlab/juicer/wiki/Download and set the following alias: alias juicer='java -Xms512m -Xmx2048m -jar path/to/juicer_tools_1.22.01.jar'

So that converting the short format with score file is done with the following:

juicer pre -r 10000,20000,50000,100000,250000,500000,1000000 /path/to/file.ginteractions.tsv.short /path/to/file.ginteractions.tsv.short.hic /path/to/chrom.sizes

Where the chrom.sizes file contains two columns: <chrom> <chrom size>. The -r flag here specifies the resolutions you would like your .hic file to include.

ADD COMMENT
0
Entering edit mode

Hi, it reports the error: """ ..Error: the chromosome combination 1_2 appears in multiple blocks """

ADD REPLY

Login before adding your answer.

Traffic: 2194 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