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

hicAggregateContacts key error "data" #812

Closed dgoekbuget closed 2 years ago

dgoekbuget commented 2 years ago

Hi, I have a merged replicate .h5 matrix generated out of .bam files using diffhic. I would like to use hicAggregate to look at the aggregate hiC signal at selected TAD-like domains. How can I troubleshoot this best? Thanks.

hicexplorer 3.7.2 (conda)
Python 3.9.13

(hicexplorer) [gdeniz@c4-dev3 aggregateMaps]$ hicAggregateContacts --matrix merged.h5 --outFileName merged.pdf --BED regions.bed --range 100000:1000000  --numberOfBins 30 --operationType mean --transform obs/exp --mode intra-chr --vMin 0.8 --vMax 2.2
Traceback (most recent call last):
  File "/c4/home/gdeniz/miniconda3/envs/hicexplorer/bin/hicAggregateContacts", line 7, in <module>
    main()
  File "/c4/home/gdeniz/miniconda3/envs/hicexplorer/lib/python3.9/site-packages/hicexplorer/hicAggregateContacts.py", line 821, in main
    ma = hm.hiCMatrix(args.matrix)
  File "/c4/home/gdeniz/miniconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/HiCMatrix.py", line 56, in __init__
    matrixFileHandler_load = self.matrixFileHandler.load()
  File "/c4/home/gdeniz/miniconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/lib/matrixFileHandler.py", line 51, in load
    return self.matrixFile.load()
  File "/c4/home/gdeniz/miniconda3/envs/hicexplorer/lib/python3.9/site-packages/hicmatrix/lib/h5.py", line 35, in load
    matrix = csr_matrix(tuple([parts['data'], parts['indices'], parts['indptr']]),
KeyError: 'data'
dgoekbuget commented 2 years ago

Using hicConvertFormat to generate .h5 files fixed the issue. Not sure how to explain it.