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
227 stars 70 forks source link

`hicDifferentialTAD` doesn't work with example cool input #817

Open PanZiwei opened 2 years ago

PanZiwei commented 2 years ago

Hi, I encountered an error OSError: 'GSM2644945_Untreated-R1.100000_chr1.cool' is not an HDF5 file. when running the hicDifferentialTAD function with the test dataset in .cool format you showed in the readme file.

Can you help me solve the problem? Do I need to use h5 instead?

Thank you so much for your help!

HiCExplorer ==3.7.2, python=3.9.3

The command I am using:

hicDifferentialTAD -tm GSM2644945_Untreated-R1.100000_chr1.cool -cm GSM2644947_Auxin2days-R1.100000_chr1.cool -td untreated_R1_domains.bed -o differential -p 0.01 -t 4 -mr all

The full error I got:

ERROR:hicexplorer.hicDifferentialTAD:'GSM2644945_Untreated-R1.100000_chr1.cool' is not an HDF5 file.Traceback (most recent call last):
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/lib/cool.py", line 55, in load
    cooler_file = cooler.Cooler(self.matrixFileName)
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/cooler/api.py", line 89, in __init__
    self._refresh()
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/cooler/api.py", line 93, in _refresh
    with open_hdf5(self.store, **self.open_kws) as h5:
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/contextlib.py", line 119, in __enter__
    return next(self.gen)
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/cooler/util.py", line 528, in open_hdf5
    fh = h5py.File(fp, mode, *args, **kwargs)
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/h5py/_hl/files.py", line 533, in __init__
    fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/h5py/_hl/files.py", line 226, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 106, in h5py.h5f.open
OSError: Unable to open file (file signature not found)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/hicexplorer/hicDifferentialTAD.py", line 124, in computeDifferentialTADs
    hic_matrix_target = hm.hiCMatrix(
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/HiCMatrix.py", line 56, in __init__
    matrixFileHandler_load = self.matrixFileHandler.load()
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/lib/matrixFileHandler.py", line 51, in load
    return self.matrixFile.load()
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/lib/cool.py", line 65, in load
    log.warning("The following nodes are available: {}".format(cooler.fileops.list_coolers(self.matrixFileName.split("::")[0])))
  File "/pod/2/li-lab/Ziwei/Anaconda3/envs/hicexplorer/lib/python3.9/site-packages/cooler/fileops.py", line 189, in list_coolers
    raise OSError("'{}' is not an HDF5 file.".format(filepath))
OSError: 'GSM2644945_Untreated-R1.100000_chr1.cool' is not an HDF5 file.