RasmussenLab / phamb

Downstream processing of VAMB binning for Viral Elucidation
MIT License
46 stars 8 forks source link

Suggesting changes to dvf.yaml #22

Closed bhimbbiswa closed 3 years ago

bhimbbiswa commented 3 years ago

I hope this might help someone.

I ran phamb with the following command but encountered an error in DeepVirFinder.

snakemake -s /lustre7/home/bhimbiswa/MAGs/phamb/mag_annotation/Snakefile --use-conda -j 20

The first error was

Traceback (most recent call last):
  File "/lustre7/home/bhimbiswa/MAGs/phamb/DeepVirFinder/dvf.py", line 49, in <module>
    import h5py, multiprocessing
ModuleNotFoundError: No module named 'h5py'

So I removed the DeepVirFinder conda environment and added 'h5py' to dvf.yaml. But got the following error.

Traceback (most recent call last):
  File "/lustre7/home/bhimbiswa/MAGs/phamb/DeepVirFinder/dvf.py", line 53, in <module>
    import keras
  File "/lustre7/home/bhimbiswa/MAGs/phamb/.snakemake/conda/ea387140a96735e61bfb5c0b2ea20190/lib/python3.6/site-packages/keras/__init__.py", line 21, in <module>
    from tensorflow.python import tf2
ModuleNotFoundError: No module named 'tensorflow'

I found this suggestion from https://github.com/jessieren/DeepVirFinder/issues/18#issue-797849276. So I again removed the DeepVirFinder conda environment and added 'h5py=2.10.0' to dvf.yaml, but got a new error.

Using Theano backend.
WARNING (theano.configdefaults): install mkl with `conda install mkl-service`: No module named 'mkl'
Traceback (most recent call last):
  File "/lustre7/home/bhimbiswa/MAGs/phamb/DeepVirFinder/dvf.py", line 131, in <module>
    modDict[contigLengthk] = load_model(os.path.join(modDir, modName))
  File "/lustre7/home/bhimbiswa/MAGs/phamb/.snakemake/conda/c23317aff605e94c122c50b24af4b0a2/lib/python3.6/site-packages/keras/engine/saving.py", line 419, in load_model
    model = _deserialize_model(f, custom_objects, compile)
  File "/lustre7/home/bhimbiswa/MAGs/phamb/.snakemake/conda/c23317aff605e94c122c50b24af4b0a2/lib/python3.6/site-packages/keras/engine/saving.py", line 224, in _deserialize_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

Finally, when I changed the dvf.yaml to the following and reinstalled the DeepVirFinder conda environment I was able to run phamb without an error.

name: dvf
channels:
  - bioconda
  - conda-forge
dependencies:
  - python=3.6
  - numpy
  - theano=1.0.3
  - keras=2.2.4
  - scikit-learn
  - Biopython
  - h5py=2.10.0
  - mkl-service=2.3.0