[Biopython-dev] [Bug 2547] Translation of ambiguous codons like NNN and TAN

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon Jul 21 15:41:47 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2547





------- Comment #5 from biopython-bugzilla at maubp.freeserve.co.uk  2008-07-21 11:41 EST -------
For reference, using the older Bio.Translate approach suffers the same
limitation (which is not surprising if you consider they both use the same
CodonTable objects internally):

>>> from Bio.Seq import Seq
>>> from Bio.Alphabet import IUPAC
>>> from Bio import Translate
>>> standard_translator = Translate.ambiguous_dna_by_id[1]

The clear cut cases are fine,

>>> standard_translator.translate(Seq("TAR", IUPAC.ambiguous_dna))
Seq('*', HasStopCodon(ExtendedIUPACProtein(), '*'))
>>> standard_translator.translate(Seq("TAY", IUPAC.ambiguous_dna))
Seq('Y', HasStopCodon(ExtendedIUPACProtein(), '*'))

When the codon could be an amino acid or a stop, we raise an exception:

>>> standard_translator.translate(Seq("NNN", IUPAC.ambiguous_dna))
Traceback (most recent call last):
...
Bio.Data.CodonTable.TranslationError: NNN
>>> standard_translator.translate(Seq("TAN", IUPAC.ambiguous_dna))
Traceback (most recent call last):
...
Bio.Data.CodonTable.TranslationError: TAN


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list