[BioPython] Translation method for Seq object

Peter biopython at maubp.freeserve.co.uk
Mon Oct 13 15:54:32 UTC 2008


Bruce wrote:
> ...
> Therefore, provided 'translate' is a method of Seq then I do not see any
> strong reason to avoid it except that it is long (but shorter than
> translation) :-)

Good - that sounds like another vote for option (a) in my original list.

> Would be too cryptic to have dna(), rna() and protein() methods that provide
> the appropriate conversion based on the Seq type?

Or in a similar vein, to_dna, to_rna, and to_protein? Or toDNA, toRNA,
toProtein?  I'd have to go and consult the current python style guide
for what is the current best practice. Something like that does sounds
reasonable (and they are short), but historically all related
Biopython functions have used the terms (back) transcription and
(back) translation so I would prefer to stick with those.

> Obviously reverse translation of a protein sequence to a DNA sequence is
> complex if there are many solutions.

Yes, back-translation is tricky because there is generally more than
one codon for any amino acid.  Ambiguous nucleotides can be used to
describe several possible codons giving that amino acid, but in
general it is not possible to do this and describe all the possible
codons which could have been used.  This topic is worth of an entire
thread... for the record, I would envisage a back_translate method for
the Seq object (assuming we settle on translate as the name for the
forward translation from nucleotide to protein).

Peter



More information about the Biopython mailing list