[Bioperl-l] Translate to 6 ORF's

Heikki Lehvaslaiho heikki@ebi.ac.uk
Thu, 25 Oct 2001 17:05:24 +0100


I decided that translations in 3 forward or in all 6 frames is common enough
request to have them in bioperl. To not change sequence interfaces, I added
the two methods into Bio::SeqUtils.

 #takes the same arguments as translate (frame naturally ignored)
 @seqs = Bio::SeqUtils->translate_6frames($seq);

	-Heikki

"Wiepert, Mathieu" wrote:
> 
> I want to translate a large fasta file with many sequences to proteins in
> all 6 ORF's.  The code is simple, copied from the docs somewhere.  Do I have
> to reverse the sequence and then translate to get the three reverse ORF's?
> 
> use Bio::SeqIO;
> 
> $in  = Bio::SeqIO->new(-file => "file1.fa" , '-format' => 'Fasta');
> $out = Bio::SeqIO->new(-file => ">file1_t1.fa" , '-format' => 'Fasta');
> 
>     while ( my $seq = $in->next_seq() ) {
>         $translation = $seq->translate(undef,undef,0);
>         $out->write_seq($translation);
>     }
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l

-- 
______ _/      _/_____________________________________________________
      _/      _/                      http://www.ebi.ac.uk/mutations/
     _/  _/  _/  Heikki Lehvaslaiho          heikki@ebi.ac.uk
    _/_/_/_/_/  EMBL Outstation, European Bioinformatics Institute
   _/  _/  _/  Wellcome Trust Genome Campus, Hinxton
  _/  _/  _/  Cambs. CB10 1SD, United Kingdom
     _/      Phone: +44 (0)1223 494 644   FAX: +44 (0)1223 494 468
___ _/_/_/_/_/________________________________________________________