1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
From: peterjc <p.j.a.cock@googlemail.com>
Date: Tue, 29 May 2018 15:05:22 +0100
Subject: [PATCH] Fix for Biopython 1.71 dual coding support.
Origin: https://github.com/fhcrc/seqmagick/pull/76
This closes issue #73, indirectly triggered by changes
in Biopython to support recent NCBI codon tables with
codons which can be amino acids of stop codons.
Previously the monkey-patched sub-class was breaking here:
dual_coding = [c for c in stop_codons if c in forward_table]
This change adds direct support for __contains__ by
forwarding this to the wrapped forward table.
---
seqmagick/transform.py | 4 ++++
1 file changed, 4 insertions(+)
--- a/seqmagick/transform.py
+++ b/seqmagick/transform.py
@@ -668,6 +668,10 @@ class CodonWarningTable(object):
else:
return self.wrapped.__getitem__(codon)
+ def __contains__(self, value):
+ return value in self.wrapped
+
+
def translate(records, translate):
"""
Perform translation from generic DNA/RNA to proteins. Bio.Seq
|