#!bin/perl -w use strict; use warnings; use Bio::SeqIO; #script to translate nucleotide sequences to amino acid sequences in first three frames my $in = Bio::SeqIO->new(-file => "sequence.fasta", -format => "fasta"); my $out = Bio::SeqIO->new(-file => ">Frame1.fasta", -format => "fasta"); my $out2 = Bio::SeqIO->new(-file => ">Frame2.fasta", -format => "fasta"); my $out3 = Bio::SeqIO->new(-file => ">Frame3.fasta", -format => "fasta"); while ( my $seq = $in->next_seq() ) { my $prot = $seq->translate(); $out->write_seq($prot); my $prot2 = $seq->translate(-frame => 1); $out2->write_seq($prot2); my $prot3 = $seq->translate(-frame => 2); $out3->write_seq($prot3); }