Skip to content

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

@victorlin

Description

@victorlin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions