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

pharokka failure due to missing BioPython function #320

Closed
leahfa opened this issue Jan 8, 2024 · 6 comments
Closed

pharokka failure due to missing BioPython function #320

leahfa opened this issue Jan 8, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@leahfa
Copy link

leahfa commented Jan 8, 2024

  • pharokka version: 1.5.1
  • Python version: 3.10.13
  • Operating System: Linux OpenSuse

Description

conda install of pharokka (through bioconda) ends with no errors, but any pharokka script (including pharokka.py -h) fails due to a python error:
ImportError: cannot import name 'GC' from 'Bio.SeqUtils'
As far as I can tell from Biopython Docs, function GC has been deprecated way back, starting from BioPython release 1.79

What I Did

Tried downgrading BioPython within pharokka environment to 1.78, the latest release which seems to have BioSeq.Utils.GC.
This resolves the above issue but also downgrades pharokka to 1.2.1, which seems a pity....
Commands below:
conda install -c bioconda pharokka
(phrokka) leah@green234:~/miniconda3/envs/phrokka> pharokka.py --help
Traceback (most recent call last):
File "/home/leah/miniconda3/envs/phrokka/bin/pharokka.py", line 10, in
from databases import check_db_installation
File "/home/leah/miniconda3/envs/phrokka/bin/databases.py", line 32, in
from post_processing import remove_directory
File "/home/leah/miniconda3/envs/phrokka/bin/post_processing.py", line 12, in
from Bio.SeqUtils import GC
ImportError: cannot import name 'GC' from 'Bio.SeqUtils' (/home/leah/miniconda3/envs/phrokka/lib/python3.10/site-packages/Bio/SeqUtils/init.py)
Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

@gbouras13 gbouras13 added the bug Something isn't working label Jan 9, 2024
@gbouras13
Copy link
Owner

Hi @leahfa ,

This is well timed as I am fixing some bugs this week. Thanks for reporting this.

Looks like it is an easy fix with gc_fraction being the correct function

https://biopython.org/docs/dev/api/Bio.SeqUtils.html

An update will be available as part of v1.6.

George

@leahfa
Copy link
Author

leahfa commented Jan 10, 2024

That was fast ! Thanks for all your work, this is a great tool :-)
Just as an FYI, I think there's another issue with a deprecated function from Bio, but this one comes from a function defined in GFFParser.py. Its not too bad since its at the end of the pipe, converting gff to genbank - GFFParser.py defines function get_feature with a call to Bio.SeqFeature.Seqfeature, using a 'strand' option which has been deprecated.
Best
Leah

@gbouras13
Copy link
Owner

Hi @leahfa ,

Thanks for reporting this too - to be clear, is this a warning (not a bug)?

If it's a warning I might wait on putting in a fix, it might take a while to replace that (or make a PR to GFFParser.py)

George

@gbouras13
Copy link
Owner

Ok looks like an error

chapmanb/bcbb#138

@gbouras13
Copy link
Owner

There is a PR to fix it - chapmanb/bcbb#141

Therefore, what I will do is to enforce biopython <1.82 for now in the dependencies and hope the PR gets merged, after which time I will relax the version restriction.

@leahfa
Copy link
Author

leahfa commented Jan 11, 2024

Its a bug alright, but didnt want to be too picky :-)
especially as it originates in a different repo...
downgrading to BioPython 1.81 worked perfectly
Thanks for all!
Leah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants