[Bioperl-l] Problem with $seqobj->translate() when supplying parameters

Eric E. Snyder esnyder at vbi.vt.edu
Mon Oct 15 14:50:54 EDT 2007


Hello,

I am having trouble with translate() when supplying parameters such as 
-frame, -codontable_id, etc.  I am working straight out of the tutorial 
with a very simple program-- which has me stumped!

use Bio::SeqIO;
foreach my $file ( @ARGV ){
     my $seqio_obj = Bio::SeqIO->new(-file   =>  "<$file",
                                     -format =>  "fasta" );
     my $seq_obj = $seqio_obj->next_seq;

     print "loaded one sequence:\n\tdisplay_id\t" .
	   $seq_obj->display_id() . "\n" .
     	   "\tdescription\t" . $seq_obj->description() . "\n";

     foreach my $frame ( 0 .. 2){
         $prot_obj = $seq_obj->translate( '-frame' => $frame );
         print "translation = " . $prot_obj->seq . "\n";
     }
}

Everything works as expected until calling translate.  The output I get 
is the translation of my FASTA sequence (in frame zero, repeated three 
times) in which every "stop" is replaced with "-frame" (!!).  However, 
with no parameters, translate works as advertised.

This is getting me down because by using the full complement of 
translate options, including specifying frame, genetic code, alternative 
start codons, etc., BioPerl will save me a huge amount of time... but 
only if I can figure out how to use it properly!

Any assistance would be greatly appreciated!!!

Sincerely,
eesnyder


-- 
Eric E. Snyder, Ph.D.
Virginia Bioinformatics Institute
Virginia Polytechnic Institute and State University
Blacksburg, VA 24061-0447
USA

Office:    (540) 231-5428
Mobile:    (540) 230-5225
Fax:    (540) 231-2606
Email:    eesnyder at vbi.vt.edu
JDAM:    N 37 12'01.6", W 80 24'26.9"



More information about the Bioperl-l mailing list