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

ImportError: Bio.Alphabet has been removed from Biopython. #2

Open
neelam19051 opened this issue Mar 23, 2023 · 2 comments
Open

ImportError: Bio.Alphabet has been removed from Biopython. #2

neelam19051 opened this issue Mar 23, 2023 · 2 comments

Comments

@neelam19051
Copy link

.Hi, I am facing this error and i followed below instruction also but still unable to solve it.
/TnComp_finder.py
./TnComp_finder.py:247: SyntaxWarning: "is" with a literal. Did you mean "=="?
if character is 'T':
./TnComp_finder.py:249: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif character is 'A':
./TnComp_finder.py:251: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif character is 'C':
./TnComp_finder.py:253: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif character is 'G':
./TnComp_finder.py:255: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif character is 'N':
./TnComp_finder.py:275: SyntaxWarning: "is" with a literal. Did you mean "=="?
if item[3] is '+':
./TnComp_finder.py:278: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif item[3] is '-':
Traceback (most recent call last):
File "./TnComp_finder.py", line 31, in
from Bio.Alphabet import IUPAC
File "/home/bvs/.local/lib/python3.8/site-packages/Bio/Alphabet/init.py", line 20, in
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.

Thank you!

@Holert
Copy link

Holert commented May 11, 2023

From https://biopython.org/wiki/Alphabet

Try removing the references to Alphabet from the script:

Line 31: remove "from Bio.Alphabet import IUPAC"
Line 438: change "gbk_record = SeqRecord(Seq(sequence, IUPAC.unambiguous_dna)" to "gbk_record = SeqRecord(Seq(sequence)"

@pengxyii
Copy link

Hello,
I use tncomp_finder on a archaeal genome,and facing this error:
Traceback (most recent call last):
File "/home/pengxy/mambaforge/envs/tncomp_finder/lib/python3.12/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
^^^^^^^^^^^^^^^^^^^
File "/home/pengxy/mambaforge/envs/tncomp_finder/lib/python3.12/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
^^^^^^^^^^^^^^^^
File "/home/pengxy/data/software/tncomp_finder/TnComp_finder.py", line 170, in parse_blastn
write_report(candidates, outdir)
File "/home/pengxy/data/software/tncomp_finder/TnComp_finder.py", line 326, in write_report
seq_info.update({key:[transposon, extended_seq]})
^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'extended_seq' where it is not associated with a value
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/pengxy/data/software/tncomp_finder/TnComp_finder.py", line 609, in
main()
File "/home/pengxy/data/software/tncomp_finder/TnComp_finder.py", line 598, in main
Pool(args.processors).map(partial(parse_blastn, outdir=args.out), args.files)
File "/home/pengxy/mambaforge/envs/tncomp_finder/lib/python3.12/multiprocessing/pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pengxy/mambaforge/envs/tncomp_finder/lib/python3.12/multiprocessing/pool.py", line 774, in get
raise self._value
UnboundLocalError: cannot access local variable 'extended_seq' where it is not associated with a value

Do you know why that is?
Thank you

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

No branches or pull requests

3 participants