sanger-pathogens / ariba

Antimicrobial Resistance Identification By Assembly
http://sanger-pathogens.github.io/ariba/
Other
167 stars 53 forks source link

Biopython 1.78 not compatible because of Alphabet missing #307

Open besnarda opened 4 years ago

besnarda commented 4 years ago

Using ARIBA for gene detection, I tried to download the ncbi database with the following line

ariba getref ncbi out.ncbi

E-fetching 5795 genbank records from BioProject PRJNA313047 and writing to.  This may take a while.
Traceback (most recent call last):
  File "/appli/conda-env/bioinfo/ariba-2.14.6/bin/ariba", line 312, in <module>
    args.func(args)
  File "/appli/conda-env/bioinfo/ariba-2.14.6/lib/python3.6/site-packages/ariba/tasks/getref.py", line 11, in run
    getter.run(options.outprefix)
  File "/appli/conda-env/bioinfo/ariba-2.14.6/lib/python3.6/site-packages/ariba/ref_genes_getter.py", line 664, in run
    exec('self._get_from_' + self.ref_db + '(outprefix)')
  File "<string>", line 1, in <module>
  File "/appli/conda-env/bioinfo/ariba-2.14.6/lib/python3.6/site-packages/ariba/ref_genes_getter.py", line 620, in _get_from_ncbi
    from Bio.Alphabet import generic_dna
  File "/appli/conda-env/bioinfo/ariba-2.14.6/lib/python3.6/site-packages/Bio/Alphabet/__init__.py", line 21, in <module>
    "Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the ``molecule_type`` as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information."
ImportError: Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the ``molecule_type`` as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information.

As reported there it seems to be because of Biopython 1.78. I will try downgrading to Biopython 1.77 to see if it solves the issue.

Jonathan-Abrahams commented 3 years ago

Did this work for you? If possible, could you provide a few lines on how to downgrade biopython?

besnarda commented 3 years ago

Sorry for the late response! In case you are still stuck: It did work for the Alphabet issue, but i encountered other issues that I wasn't able to solve so I didn't explore this tool further. I didn't made the downgrade myself so I can't point you how to do it for sure. If you are using conda, I believe you can try (I have not try it though). conda install Biopython=1.77

shenwei356 commented 3 months ago

It's still not fixed. @martinghunt .

Just install an old biopython before installing ariba.

pip install biopython==1.77
pip install ariba

Maybe you can just specify the maximum biopython version in pip.