Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address Bio.Alphabet removal in Biopython 1.78 #42

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

emollier
Copy link

Greetings,

In version 1.78, Biopython removed the deprecated Bio.Alphabet module. This patch follows recommendations published on https://biopython.org/wiki/Alphabet to allow Kleborate to run with this Biopython version.

The test suite would otherwise fail with the following backtraces:

======================================================================
ERROR: test.test_genomes (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test.test_genomes
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/test/test_genomes.py", line 18, in <module>
    from kleborate.kleborate import get_data_path, get_output_headers, gunzip_contigs_if_necessary, \
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/kleborate/kleborate.py", line 28, in <module>
    from .resBLAST import read_class_file, get_res_headers, resblast_one_assembly
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/kleborate/resBLAST.py", line 25, in <module>
    from .truncation import truncation_check
  File "/<<PKGBUILDDIR>>/.pybuild/cpython3_3.8/build/kleborate/truncation.py", line 16, in <module>
    from Bio.Alphabet import IUPAC
  File "/usr/lib/python3/dist-packages/Bio/Alphabet/__init__.py", line 20, in <module>
    raise ImportError(
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.

In hope it helps,
Kind Regards,
Étienne.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant