chapmanb / bcbb

Incubator for useful bioinformatics code, primarily in Python and R
http://bcbio.wordpress.com
603 stars 243 forks source link

Error in GFFParser: UnknownSeq is deprecated in biopython 1.81 #136

Open Kmassau opened 1 year ago

Kmassau commented 1 year ago

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.

corneliusroemer commented 1 year ago

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

abretaud commented 1 year ago

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)

StickHu commented 1 year ago

So how can we correct the code to use?

chapmanb commented 1 year ago

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.

corneliusroemer commented 1 year ago

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

victorlin commented 7 months ago

was there no deprecation warning added in Biopython 1.79?

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

corneliusroemer commented 5 months ago

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