[Bioperl-l] rev translating stop codons with Bio::Tools::CodonTable

David Messina dmessina@humgen.wustl.edu
Wed, 30 Oct 2002 17:03:52 -0600


Hi all,

I looked in the email archive, and I couldn't find any mention of a 
similar problem. Would you please take a moment to examine the 
following?

I can't get Bio::Tools::CodonTable to reverse translate stop symbols (* 
or Ter) to codons (TAA, TAG, TGA). It works fine in the other 
direction, translating TAA, TAG, and TGA to *.

Please see the sample code and its output:

#!/usr/local/bin/perl -w

use Bio::Tools::CodonTable;
$myCodonTable = Bio::Tools::CodonTable->new();

# This loop tests rev translation of stops.
# I've put just A and C for this example, but I've tested all 20 
standard amino acids.
foreach my $aa ('A', 'C', 'Ter', '*')
{
     my @codons = $myCodonTable->revtranslate($aa);
     if (! @codons) { print "WARNING: no codons for $aa!\n"; }

         foreach my $codon (@codons)
         {
             print $aa, " ", $codon, "\n";
         }
}

# This loop tests regular forward translation of stops.
foreach my $codon ('TAA', 'TAG', 'TGA')
{
     print $codon, " ", $myCodonTable->translate($codon), "\n";
}

PROGRAM OUTPUT
----------------------------
A gct
A gcc
A gca
A gcg
C tgt
C tgc
WARNING: no codons for Ter!
WARNING: no codons for *!
TAA *
TAG *
TGA *

I am running BioPerl 1.0.2 with Perl 5.8.0 under Mac OS X 10.1.2. Your 
help is greatly appreciated.


David Messina
   Division of Human Genetics
   Washington Univ. in St. Louis
   dmessina@genetics.wustl.edu
   314/747-1063 fx 314/747-2489