bcbb icon indicating copy to clipboard operation
bcbb copied to clipboard

Error in GFFParser: UnknownSeq is deprecated in biopython 1.81

Open Kmassau opened this issue 2 years ago • 7 comments

from Bio.Seq import UnknownSeq is deprecated in biopython 1.81 ( https://github.com/biopython/biopython/blob/dcf52bd4546410e1a60d39fbcd4c0041ec1e6fe6/DEPRECATED.rst#biosequnknownseq) and we have the error below:

    from BCBio.GFF.GFFParser import GFFParser, DiscoGFFParser, GFFExaminer, parse, parse_simple
/usr/local/lib/python3.9/site-packages/BCBio/GFF/GFFParser.py:34: in <module>
    from Bio.Seq import UnknownSeq
E   ImportError: cannot import name 'UnknownSeq' from 'Bio.Seq' (/usr/local/lib/python3.9/site-packages/Bio/Seq.py)

I am reporting a problem with bcbio-gff-0.6.9, Biopython version 1.81.

Kmassau avatar Feb 13 '23 13:02 Kmassau

Thanks! This came quite surprising, was there no deprecation warning added in Biopython 1.79? At least that would have allowed us to prepare :/

corneliusroemer avatar Feb 17 '23 15:02 corneliusroemer

no deprecation warning added in Biopython 1.79

I never saw one, but maybe the code is not using it enough to trigger the warning (just an import and isinstance check)

abretaud avatar Feb 20 '23 09:02 abretaud

So how can we correct the code to use?

StickHu avatar Mar 13 '23 01:03 StickHu

Thanks very much for catching this issue and for the fix. There is a new 0.7.0 release on pypi that contains this fix. Apologies again about being slow to get this done and let me know if you run into any issues.

chapmanb avatar Mar 13 '23 13:03 chapmanb

Excellent, thanks for this @chapmanb! The bioconda recipe needs to unpin Biopython for 0.7.0 then!

corneliusroemer avatar Mar 13 '23 18:03 corneliusroemer

was there no deprecation warning added in Biopython 1.79?

There was, but it was suppressed by GFFParser. See #140

victorlin avatar Dec 26 '23 22:12 victorlin

I think this can be closed now as of bcbio-gff 0.7.0

corneliusroemer avatar Feb 01 '24 18:02 corneliusroemer