[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
Sat Nov 1 22:11:47 UTC 2008


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





------- Comment #26 from biopython-bugzilla at maubp.freeserve.co.uk  2008-11-01 18:11 EST -------
Here is an example of how the updated Seq object might be used (taken from the
new edition of the tutorial in CVS):

>>> from Bio.Seq import Seq
>>> from Bio.Alphabet import IUPAC
>>> coding_dna = Seq("ATGGCCATTGTAATGGGCCGCTGAAAGGGTGCCCGATAG", IUPAC.unambiguous_dna)
>>> coding_dna.translate()
Seq('MAIVMGR*KGAR*', HasStopCodon(IUPACProtein(), '*'))
>>> coding_dna.translate(to_stop=True)
Seq('MAIVMGR', IUPACProtein())

Using the Vertebrate Mitochondrial table instead:

>>> coding_dna.translate(table="Vertebrate Mitochondrial")
Seq('MAIVMGRWKGAR*', HasStopCodon(IUPACProtein(), '*'))
>>> coding_dna.translate(table=2)
Seq('MAIVMGRWKGAR*', HasStopCodon(IUPACProtein(), '*'))
>>> coding_dna.translate(table=2, to_stop=True)
Seq('MAIVMGRWKGAR', IUPACProtein())

As I said in comment 24, the name "to_stop" and its behaviour are taken from
the old (now obsolete) Bio.Translate module.

-------------------------------------------------------------

I'm also considering adding an additional boolean argument too (see comment
22):

> Validate the first codon is a valid start codon, and translate
> it as M (even if going on the genetic code it would normally be
> say L).  This should be a boolean argument defaulting to False,
> possible names "start", "check_start", "from_start", ...

I would prefer to avoid calling this argument "start" given the existing
meaning associated with "start" and "end" used in python strings (for
specifying a sub-sequence to be translated - discussed earlier on this bug).

This would be especially useful for translating a gene/CDS sequence into
protein where making sure a non-standard start codon is translated as "M" is
non-trivial.


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