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
223 stars 68 forks source link

chicViewpointBackgroundModel and `np.int` aliases deprecated in NumPy 1.20 #877

Open amv33576 opened 8 months ago

amv33576 commented 8 months ago

Dear all,

I am finding this problem when calculating a background model. Command in:

chicQualityControl -m matrix.nr.h5 --referencePoints RFpoints.bed --sparsity 0.025 --threads 20 --outFileName new_RPs.bed chicViewpointBackgroundModel -m matrix.nr.h5 --fixateRange 500000 --referencePoints new_RPs.bed --outFileName bgm.txt

ERROR:hicexplorer.chicViewpointBackgroundModel:An error occurred caused by one or many faulty reference points. ERROR:hicexplorer.chicViewpointBackgroundModel:Please run chicQualityControl to remove these from your reference point file: new_RPs.bed

ERROR:hicexplorer.chicViewpointBackgroundModel:module 'numpy' has no attribute 'int'. np.int was a deprecated alias for the builtin int. To avoid this error in existing code, use int by itself. Doing this will not modify any behavior and is safe. When replacing np.int, you may wish to use e.g. np.int64 or np.int32 to specify the precision. If you wish to review your current use, check the release note link for additional information. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Name Version Build Channel hicexplorer 3.7.2 pyhdfd78af_1 bioconda numpy 1.24.4 py38h59b608b_0 conda-forge python 3.8.18 hd12c33a_0_cpython conda-forge

Any advice?

Best,

A.

joachimwolff commented 8 months ago

I published today a maintenance update version 3.7.3 which should fix this issue.

robin-sto commented 5 months ago

If someone has to use 3.5.2, how can the numpy problem be addressed?

joachimwolff commented 5 months ago

Go to the 3.5.2 release, and download the requirements.txt file: https://github.com/deeptools/HiCExplorer/blob/3.5.2/requirements.txt

Change now all >= to ==, and install HiCExplorer using the changed requirements.txt file: mamba create -n HiCExplorer3.5.2 --file requirements.txt hicexplorer=3.5.2

robin-sto commented 5 months ago

Yes, I already have a conda env for hicexplorer3.5.2. It shows: numpy 1.24.4
I get the np.int error when trying to use it. Do you know which file in the env needs to be modified or if there is another way around it?

joachimwolff commented 5 months ago

Activate your environment and set the numpy version manually to an older one: conda install numpy=1.19

robin-sto commented 5 months ago

Unfortunately, there were too many conflicts to do this installation - the environment couldn't be resolved.

joachimwolff commented 5 months ago

You can try either mamba instead of conda, or delete your non-working environment and set it up new with the requirements.txt file as explained above.