Skip to content

Bio/Alphabet deprecation warnings generated by BioPython / Our use of IUPAC data #2312

Closed

Description

@ChrisMoth

Setup

In Biopython 1.74, Python version 3.7.4 (Anaconda Oct 2019), and Centos 7, the Issue 2046, coming deprecation of Bio.Alphabet, is emitted by the BioPython library itself.

>>> import warnings
>>> warnings.simplefilter("always")  # Just to make sure you see this 
>>> from Bio.PDB.Structure import Structure   # This emits the deprecation warning.

Expected behaviour

  1. Before a deprecation error was emitted like the one in Bio/Alphabet/init.py, the surrounding package would have first been updated to no longer use it.

  2. Also, It is not possible to add comments to issue Seqio igio python3 #2606 as perhaps requested by the deprecation messsage. 2606 is marked closed. So, I will remark that in other parts of my application your excellent IUPAC tables are used to validate that strings of letters for amino acids are indeed "valid" as far as being IUPAC standards. I would appreciate your keeping these clear-cut IUPAC strings/lists/etc resources, even if other "Alphabet" calls are undesirable due to their ambiguity or runtime performance. I also use your library to convert 1->3letter and back. I hope that is not going away.

Actual behaviour

You get the deprecation message, even when you do not directly include the file that emits the warnings.

Steps to reproduce

It is above, and just that simple.

Activity

  1. peterjc commented on Oct 30, 2019

    @peterjc
    Member

    I don't see a deprecation warning, I see the silent by default PendingDeprecationWarning which is probably what you meant. I agree that once this moves to a full DeprecationWarning we wouldn't want other Biopython code to trigger it. But right now avoiding this would be a lot of effort (wrapping over 150 import lines with a warning silencing context manager) for a tiny benefit.

    The is no plan to remove the IUPAC tables, Bio.Data.IUPACData will remain:
    https://github.com/biopython/biopython/blob/master/Bio/Data/IUPACData.py

    There is no plan to remove the seq1 and seq3 functions or Bio.SeqUtils:
    https://github.com/biopython/biopython/blob/master/Bio/SeqUtils/__init__.py

    Unless I've missed something, none of your usage concerns do explicitly use Bio.Alphabet. That you are worried suggests we need to clarify the wording of the message?:

    PendingDeprecationWarning: We intend to remove or replace Bio.Alphabet in 2020, ideally avoid using it explicitly in your code. Please get in touch if you will be adversely affected by this. #2046

    Note that I assume 2606 in the above was a typo, and that you meant #2046, and yes, the warning might imply commenting there, but it is locked.

    Could you suggest a different wording? What I want to convey is that any end-user code with from Bio import Alphabet or from Bio.Alphabet import .... is best avoided.

  2. peterjc commented on Dec 6, 2019

    @peterjc
    Member

    With no further feedback on the wording of the warning, I'm going to close this. Thank you for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions