[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 Oct 14 10:16:17 UTC 2008


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





------- Comment #18 from biopython-bugzilla at maubp.freeserve.co.uk  2008-10-14 06:16 EST -------
We seem to have reached a consensus on the mailing list to use "translate" for
the Seq object method (even though this clashes with the python string method
of the same name).  See:
http://lists.open-bio.org/pipermail/biopython/2008-October/004575.html

I've checked some code based on that in comment 17 into CVS, and updated the
test_seq.py unit test to cover this:

Bio/Seq.py revision 1.44
Tests/test_seq.py revision 1.26

I'm leaving this bug open to discuss possible further optional arguments for
the translate method (and perhaps for the Bio.Seq.translate function too).

e.g. As I wrote in comment 17,
> I'm thinking we could also support "start" and "end" optional arguments (named
> after those used in the python string methods, and behaving in the same way)
> for specifying a sub-sequence to be translated.  Using start=0, 1 or 2 would
> give the three forward reading frames.

This would give an alternative to:

my_seq[i:j].translate(table)

as:

my_seq.translate(table, start=i, end=j)

As with the python string methods, potentially the implementation could be
slightly faster as a new Seq object doesn't need to be created for the slice. 
On the other hand, it does then offer two ways of doing the same thing.

> An optional boolean argument could enable treating the sequence as a CDS -
> verifying it starts with a start codon (which would always be translated as M)
> and verifying it ends with a stop codon (with no other stop codons in frame),
> which would not be translated.  Following BioPerl, this argument could be
> called "complete".

Related to this, it would be useful to have a boolean option to stop
translation at the first in frame stop codon (possible argument names for this
include "stop" if not used as above, "to_stop", "auto_stop", "terminate" etc).

For comparison, see the translate_to_stop method in the semi-obsolete
Bio.Translate.Translator object.

We will also need to support back_translate before we can deprecate the old
Bio.Translate module (see comment 6 and comment 7).


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