cytham / nanovar

Structural variant caller for low-depth long-read sequencing data
GNU General Public License v3.0
45 stars 10 forks source link

AttributeError: module 'numpy' has no attribute 'typeDict' (deprecation expired in numpy version 1.24) #61

Closed jamesdalg closed 10 months ago

jamesdalg commented 1 year ago

Just reporting this for the benefit of others: The current version of nanovar doesn't work with the current version of numpy. Versions 1.24 and 1.25 don't support the old "typeDict". See https://numpy.org/news/ See this stackoverflow post: https://stackoverflow.com/questions/74852225/attributeerror-module-numpy-has-no-attribute-typedict Essentially, the current workaround is to downgrade numpy.

rule nanovar:
    input: /ceph/project/Wellcome_Discovery/jdalglei/data/pacbio/bam/HG00733.hifi_reads.chm13.pb_aligned_sorted.bam, /ceph/project/davieslab/jdalglei/reference/chm13v2.0.fa
    output: /ceph/project/davieslab/jdalglei/results/sm_pacbio/HG00733.hifi_reads/nanovar/chm13/HG00733.hifi_reads.chm13.mm2ax_aligned_sorted.nanovar.pass.vcf
    jobid: 5
    reason: Missing output files: /ceph/project/davieslab/jdalglei/results/sm_pacbio/HG00733.hifi_reads/nanovar/chm13/HG00733.hifi_reads.chm13.mm2ax_aligned_sorted.nanovar.pass.vcf
    wildcards: sample=HG00733.hifi_reads
    resources: tmpdir=/var/scratch/jdalglei/83772

        nanovar  -t 32  /ceph/project/Wellcome_Discovery/jdalglei/data/pacbio/bam/HG00733.hifi_reads.chm13.pb_aligned_sorted.bam  /ceph/project/davieslab/jdalglei/reference/chm13v2.0.fa /ceph/project/davieslab/jdalglei/results/sm_pacbio/HG00733.hifi_reads/nanovar/chm13/ --data_type pacbio-ccs --force;
        bcftools view -f "PASS" /ceph/project/davieslab/jdalglei/results/sm_pacbio/HG00733.hifi_reads/nanovar/chm13/HG00733.hifi_reads.chm13.mm2ax_aligned_sorted.nanovar.total.vcf > /ceph/project/davieslab/jdalglei/results/sm_pacbio/HG00733.hifi_reads/nanovar/chm13/HG00733.hifi_reads.chm13.mm2ax_aligned_sorted.nanovar.pass.vcf;

[26/07/2023 09:30:46] - NanoVar started
Checking integrity of input files - |
Indexing genome and aligning reads - \
Analyzing read alignments and detecting SVs - -Traceback (most recent call last):
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/bin/nanovar", line 557, in <module>
    main()
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/bin/nanovar", line 335, in main
    from nanovar.nv_characterize import VariantDetect
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/nanovar/nv_characterize.py", line 30, in <module>
    from nanovar.nv_nn import inference, svread_ovl
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/nanovar/nv_nn.py", line 26, in <module>
    from tensorflow.keras.models import load_model
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/__init__.py", line 38, in <module>
    from tensorflow.python.tools import module_util as _module_util
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/__init__.py", line 45, in <module>
    from tensorflow.python.feature_column import feature_column_lib as feature_column
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/feature_column/feature_column_lib.py", line 18, in <module>
    from tensorflow.python.feature_column.feature_column import *
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/feature_column/feature_column.py", line 143, in <module>
    from tensorflow.python.layers import base
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/layers/base.py", line 16, in <module>
    from tensorflow.python.keras.legacy_tf_layers import base
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/keras/__init__.py", line 25, in <module>
    from tensorflow.python.keras import models
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/keras/models.py", line 22, in <module>
    from tensorflow.python.keras.engine import functional
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/keras/engine/functional.py", line 32, in <module>
    from tensorflow.python.keras.engine import training as training_lib
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/keras/engine/training.py", line 53, in <module>
    from tensorflow.python.keras.saving import hdf5_format
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/tensorflow/python/keras/saving/hdf5_format.py", line 37, in <module>
    import h5py
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/h5py/__init__.py", line 46, in <module>
    from ._conv import register_converters as _register_converters
  File "h5py/_conv.pyx", line 1, in init h5py._conv
  File "h5py/h5t.pyx", line 293, in init h5py.h5t
  File "/ceph/project/davieslab/jdalglei/micromamba/envs/nanovar/lib/python3.9/site-packages/numpy/__init__.py", line 320, in __getattr__
    raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'typeDict'
[Wed Jul 26 09:31:03 2023]
cytham commented 1 year ago

@jamesdalg Thanks a lot, I will look into this

cytham commented 1 year ago

@jamesdalg May I ask what version of tensorflow-cpu are you using?

cytham commented 10 months ago

Please try the following if you are still encountering the error:

python3 -m pip install --upgrade h5py

I'll close this for now.