You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bio/Alphabet deprecation warnings generated by BioPython / Our use of IUPAC data #2312
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.
>>>importwarnings>>>warnings.simplefilter("always") # Just to make sure you see this >>>fromBio.PDB.StructureimportStructure# This emits the deprecation warning.
Expected behaviour
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.
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.
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.
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.
Activity
peterjc commentedon Oct 30, 2019
I don't see a deprecation warning, I see the silent by default
PendingDeprecationWarningwhich is probably what you meant. I agree that once this moves to a fullDeprecationWarningwe 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.IUPACDatawill remain:https://github.com/biopython/biopython/blob/master/Bio/Data/IUPACData.py
There is no plan to remove the
seq1andseq3functions orBio.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?: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 Alphabetorfrom Bio.Alphabet import ....is best avoided.peterjc commentedon Dec 6, 2019
With no further feedback on the wording of the warning, I'm going to close this. Thank you for the feedback.