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

Warning in GFFParser: BiopythonDeprecationWarning: UnknownSeq(length) is deprecated; please use Seq(None, length) instead. #143

Open
victorlin opened this issue Jan 29, 2024 · 0 comments

Comments

@victorlin
Copy link

Scope

bcbio-gff 0.7.1 and Biopython 1.79 or 1.80.

Description

The feature in question was deprecated in Biopython 1.79 and removed in 1.81. While GFFParser has been written to handle the removal, it had silently ignored the deprecation warning until 03e96ca was released in bcbio-gff v0.7.1.

This was by a test in one of my repos after the recent release of 0.7.1. Error message snippet:

+  /home/runner/micromamba/envs/augur/lib/python3.8/site-packages/Bio/Seq.py:2220: BiopythonDeprecationWarning: UnknownSeq(length) is deprecated; please use Seq(None, length) instead.

Workarounds

  1. Silence deprecation warnings (similar to reverting 03e96ca).
  2. Install biopython>=1.81 which uses a code path that avoids UnknownSeq:
    unknown_seq_avail = False
    try:
    from Bio.Seq import UnknownSeq
    unknown_seq_avail = True
    except ImportError:
    # Starting with biopython 1.81, has been removed
    from Bio.Seq import _UndefinedSequenceData
    from Bio.Seq import Seq

Potential solution

Remove references to UnknownSeq and solely use the Seq approach. It should be available with 1.79, maybe even earlier.

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

1 participant