[Biopython-dev] [Bug 2530] New: Bio.Seq.translate() treats invalid codons as stops

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Sat Jun 28 16:09:44 EDT 2008


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

           Summary: Bio.Seq.translate() treats invalid codons as stops
           Product: Biopython
           Version: Not Applicable
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: biopython-bugzilla at maubp.freeserve.co.uk


The following results are with CVS.  Biopython 1.45 may be different, I have
recently tweaked the translate function for some less dramatic issues.

I would like Bio.Seq.translate() to raise exceptions on untranslatable codons,
rather than inserting a stop character.  e.g. for "N at N" or "TA-".

Currently:

>>> from Bio.Seq import translate
>>> translate("TAA")
'*'
>>> translate("TAG")
'*'
>>> translate("TAA")
'*'
>>> translate("TAC")
'Y'
>>> translate("TAN")
...
Bio.Data.CodonTable.TranslationError: 'TAN'
>>> translate("NNN")
...
Bio.Data.CodonTable.TranslationError: 'TAN'
>>> translate("AAA")
'K'
>>> translate("ANA")
'X'
>>> translate("AXA")
'X'

That is all fine.  However,

>>> translate("A at A")
'*'
>>> translate("A-A")
'*'

These should also raise a TranslationError.  Suggested non-trivial patch to
follow.


-- 
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