2
# $Id: reverse-translate.pl 15087 2008-12-04 02:48:00Z bosborne $
10
Reverse-translates a nucleotide sequence using the most frequent codons.
11
Requires an input sequence file and a nucleotide sequence file containing
12
one sequence comprised of one or more ORFs. This file supplies the codon
13
frequency data and will be parsed starting at the first triplet in the sequence.
17
-i Input sequence, amino acid
18
-c Input sequence, nucleotide ORFs
22
reverse-translate.pl -i ~/bioperl-live/t/data/cysprot.fa -c ~/bioperl-live/t/data/HUMBETGLOA.fa
28
use Bio::Tools::CodonTable;
29
use Bio::Tools::SeqStats;
30
use Bio::CodonUsage::Table;
33
my ($codonFile,$seqFile);
35
GetOptions( "c=s" => \$codonFile,
38
die "Need input sequence and file containing coding regions"
39
if ( !$codonFile || !$seqFile );
41
my $codonIn = Bio::SeqIO->new(-file => $codonFile,
44
my $codonSeq = $codonIn->next_seq;
46
my $codonStats = Bio::Tools::SeqStats->count_codons($codonSeq);
48
my $codonUsage = Bio::CodonUsage::Table->new(-data => $codonStats );
50
my $codonTable = Bio::Tools::CodonTable->new;
52
my $seqIn = Bio::SeqIO->new(-file => $seqFile);
54
my $seq = $seqIn->next_seq;
56
my $rvSeq = $codonTable->reverse_translate_best($seq,$codonUsage);