[Bioperl-l] About reverse translation using CodonUsage table ?

Richard Adams Richard.Adams at ed.ac.uk
Tue Sep 28 08:26:42 EDT 2004

Hi Jian
I've changed the reverse_translate_all() method in 
Bio::Tools::CodonTable in CVS  so that you can pass it a codon usage
table and a threshold.

## a default codon table
my $myCodonTable2  = Bio::Tools::CodonTable -> new ( -id => 1 );

## a codon usage table
my $db      =  Bio::DB::CUTG->new();
my $cdtable =  $db->get_request(-sp =>'Pan troglodytes');

## get a protein sequence
my $seq     = Bio::PrimarySeq->new(-seq=> 'LSRTA');

# reverse translates and generates a IUPAC nucleotide string
my $str = $myCodonTable2->reverse_translate_all($seq);
print "str = $str\n";

## when passed with a CUT and a threshold returns a IUPAC string made 
only from codons
with a relative frequency higher than the threshold
my $str2 = $myCodonTable2->reverse_translate_all($seq, $cdtable, 15);
print "st2 = $str2\n";

In this case, for the peptide sequence above, $str  = YTNWSNMGNACNGCN
whereas                                                           $st2 = 

Hope this is of some use.
If you want to get hold of the codons above a threshold you can call a 
method probable_codons() in Bio::CodonUsage::Table
which returns a hash reference where keys are single letter amino acids 
code and values are references to a list of
codons above the threshold.
e.g., my $ref = $cut->probable_codons(15);

Best wishes

Dr Richard Adams
Psychiatric Genetics Group,
Medical Genetics,
Molecular Medicine Centre,
Western General Hospital,
Crewe Rd West,
Edinburgh UK

Tel: 44 131 651 1084
richard.adams at ed.ac.uk

More information about the Bioperl-l mailing list