[BioPython] one function, two behaivors

Peter biopython at maubp.freeserve.co.uk
Sat Jun 28 15:16:13 UTC 2008


Hi Senastian,

As to why there are two ways, well, frankly the Bio.Transcribe and
Bio.Translate code isn't very nice to use!   The Bio.Seq functions are
much simpler.

We've talked about deprecating the Bio.Transcribe and Bio.Translate
modules in favour of just Bio.Seq -- we could deprecate Bio.Transcribe
now, but there is functionality in Bio.Translate that has not been
duplicated.  See also bug 2381.
http://bugzilla.open-bio.org/show_bug.cgi?id=2381

On Sat, Jun 28, 2008 at 3:46 PM, Sebastian Bassi <sbassi at gmail.com> wrote:
> If I invoke "transcribe" with a RNA sequence like this:
>
>>>> from Bio.Seq import transcribe
>>>> from Bio.Seq import Seq
>>>> import Bio.Alphabet
>>>> rna_seq = Seq('CCGGGUU',Bio.Alphabet.IUPAC.unambiguous_rna)
>>>> transcribe(rna_seq)  # Look!, I am "transcribing a RNA"
> Seq('CCGGGUU', RNAAlphabet())

When Michiel added this code for Biopython 1.41, originally there was
no error checking on the alphabet.  For Biopython 1.44, I added a
check to prevent protein transcibing (which is clearly meaningless),
and made a note to consider also banning transcribing RNA.

Here there is at least one reason to want to do this - suppose you
have a mixed set of nucleotide sequences and want to ensure they are
all RNA.

Do you think the Bio.Seq.transcibe() method should reject RNA sequences?

Peter



More information about the Biopython mailing list