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

Error when running hicDetectLoops: AttributeError: module 'numpy' has no attribute 'object' #834

Closed hero-outman closed 1 year ago

hero-outman commented 1 year ago

Dear fellows, when running hicDetectLoops with the command: hicDetectLoops -m my_bs10kb.corrected.cool -o loops.bedgraph --maxLoopDistance 2000000 --windowSize 10 --peakWidth 6 --pValuePreselection 0.05 --pValue 0.05, I got the error:

Traceback (most recent call last):
  File "/myHome/.conda/envs/hicexplorer_mamba/bin/hicDetectLoops", line 4, in <module>
    from hicexplorer.hicDetectLoops import main
  File "/myHome/.conda/envs/hicexplorer_mamba/lib/python3.9/site-packages/hicexplorer/hicDetectLoops.py", line 9, in <module>
    import cooler
  File "/myHome/.conda/envs/hicexplorer_mamba/lib/python3.9/site-packages/cooler/__init__.py", line 14, in <module>
    from .api import Cooler, annotate
  File "/myHome/.conda/envs/hicexplorer_mamba/lib/python3.9/site-packages/cooler/api.py", line 22, in <module>
    from .util import parse_cooler_uri, parse_region, open_hdf5, closing_hdf5
  File "/myHome/.conda/envs/hicexplorer_mamba/lib/python3.9/site-packages/cooler/util.py", line 690, in <module>
    columns, dtype=None, index_columns=None, index_names=None, default_dtype=np.object
  File "/myHome/.conda/envs/hicexplorer_mamba/lib/python3.9/site-packages/numpy/__init__.py", line 284, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'object'

I installed HiCexplorer bymamba install hicexplorer=3.7.2 -c bioconda -c conda-forge

$ hicexplorer --version
hicexplorer 3.7.2
$ python --version
Python 3.9.15

cleanlab 2.2.0

My failed solution was to install another version of numpy, but I got another error on cleanlab like: ImportError: cannot import name 'LearningWithNoisyLabels' from 'cleanlab.classification'

What are some hints on making hicDetectLoops run?

hero-outman commented 1 year ago

OK, I make hicDetectLoops running by those steps:

  1. change numpy version from 1.24.1 to 1.20.3;
  2. about cleanlab API issue, with the help of this solution: https://github.com/deeptools/HiCExplorer/issues/810 , re-install cleanlab=1.0.1;
  3. And, I found the requirement of numpy is numpy>=1.20.3, it is NOT numpy >= 1.19.* described in hicexplorer's document.

Hope this would help!

lldelisle commented 1 year ago

In fact the issue was: https://github.com/open2c/cooler/issues/303