[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 12:04:54 UTC 2008


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





------- Comment #28 from dalloliogm at gmail.com  2008-11-04 07:04 EST -------
(In reply to comment #27)
> Created an attachment (id=1032)
 --> (http://bugzilla.open-bio.org/attachment.cgi?id=1032&action=view) [details]
> 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.

I don't like the name 'init' :( it would be better to use an argument with the
word 'force' in it. E.g.: force_has_coding, force_first_position, etc..

If you didn't have read this discussion in this bug report, it is not very
clear what happens when init=True and why.
You should add a description of why there is this options in the docstring.

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

Without having read the discussion in this bug report, I was expecting an
exception here.. why does it forces a Methionine to be in the first position? 
It loses the information of a Leu in the first position.

> >>> translate("TTGAAACCCTAG", init=True)
> 'MKP*'
> >>> translate("TTGAAACCCTAG", to_stop=True)
> 'LKP'
> 

You could add a check for non coding aminoacids:
>>> translate("UAACAGTGCAT")
ExceptionError: Non coding aminoacid in the first position


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