[Biopython-dev] [Bug 2381] translate and transcibe methods for the Seq object (in Bio.Seq)

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Tue Nov 4 11:23:12 UTC 2008


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





------- Comment #27 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-04 06:23 EST -------
Created an attachment (id=1032)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=1032&action=view)
Patch to Bio/Seq.py to add start codon handling to translation

Patch adds a new boolean argument to the translate method and function, called
"init" (rather than my earlier suggestions like "from_start" or "check_start"
which could be considered misleading).

Docstring:

        init - Boolean, defaults to False.  Should translation check the
               first codon is a valid initiation (start) codon and translate
               it as methionine (M)?  If False, nothing special is done with
               the first codon.


Example usage of the translate function,

>>> from Bio.Seq import translate
>>> translate("TTGAAACCCTAG")
'LKP*'
>>> translate("TTGAAACCCTAG", init=True, to_stop=True)
'MKP'
>>> translate("TTGAAACCCTAG", init=True)
'MKP*'
>>> translate("TTGAAACCCTAG", to_stop=True)
'LKP'

Using the Seq method,

>>> from Bio.Seq import Seq
>>> my_seq = Seq("TTGAAACCCTAG")
>>> my_seq.translate()
Seq('LKP*', HasStopCodon(ExtendedIUPACProtein(), '*'))
>>> my_seq.translate(init=True, to_stop=True)
Seq('MKP', ExtendedIUPACProtein())
>>> my_seq.translate(init=True)
Seq('MKP*', HasStopCodon(ExtendedIUPACProtein(), '*'))
>>> my_seq.translate(to_stop=True)
Seq('LKP', ExtendedIUPACProtein())

Comments please.


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