HiCExplorer icon indicating copy to clipboard operation
HiCExplorer copied to clipboard

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

Open amv33576 opened this issue 2 years ago • 7 comments

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.

amv33576 avatar Nov 16 '23 22:11 amv33576

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

joachimwolff avatar Nov 17 '23 19:11 joachimwolff

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

robin-sto avatar Jan 29 '24 13:01 robin-sto

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

joachimwolff avatar Jan 29 '24 14:01 joachimwolff

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?

robin-sto avatar Jan 29 '24 14:01 robin-sto

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

joachimwolff avatar Jan 29 '24 14:01 joachimwolff

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

robin-sto avatar Jan 29 '24 16:01 robin-sto

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.

joachimwolff avatar Jan 29 '24 18:01 joachimwolff