deeptools / HiCExplorer

HiCExplorer is a powerful and easy to use set of tools to process, normalize and visualize Hi-C data.
https://hicexplorer.readthedocs.org
GNU General Public License v3.0
233 stars 70 forks source link

converting matrices into h5 format #291

Closed ahorvath closed 5 years ago

ahorvath commented 6 years ago

I would like to convert matrices in GInteractions format into h5 format. I tried hicExport with an example file:

hicExport --inFile matrix.GInteractions.tsv --outFileName test.h5 --inputFormat GInteractions --outputFormat h5

But I got this error:

matrix format not known.

Can you me help with that?

Thanks in advance.

joachimwolff commented 6 years ago

Hi,

This functionality is not supported, there is only write support but no read support for ginteractions files.

Best,

Joachim

gtrichard commented 6 years ago

It is not officially supported by HiCExplorer currently, but there's a way for it to work, but it is untested so be sure to check that your matrix is fine in the end...

What you need is cooler and the develop branch of HiCExplorer. Let's consider you have a GInteractions file called foo.1000.GInteractions.tsv at the resolution of 1000bp bins in Drosophila melanogaster (dm6 genome assembly).

Run the following:

# in order to relate better to the cooler documentation where bg2.gz files are used
mv foo.1000.GInteractions.tsv foo.1000.bg2
gzip foo.1000.bg2

# performs the GInteractions to cool conversion using cooler
cooler cload pairs --assembly dm6 --tril-action drop --zero-based dmel.chrom.size:1000 foo.1000.bg2.gz foo.1000.cool -c1 1 -p1 2 -c2 4 -p2 5

# performs the cool to h5 conversion using the HiCExplorer develop branch
hicConvertFormat -m foo.1000.cool -o foo.1000 --inputFormat cool --outputFormat h5