[Bioperl-l] use primer3 to design primers with multiple sequences

chen li chen_li3 at yahoo.com
Tue May 9 00:21:42 UTC 2006


Dear all,

The following is the script I use to design primers
for one sequence:

#!/cygdrive/c/Perl/bin/perl.exe

use warnings;
use strict;

use Bio::Tools::Run::Primer3;
use Bio::SeqIO;

my $file_in='piwil2.fa';
my $file_out='temp.out';
my $seqio=Bio::SeqIO->new(-file=>$file_in)
                    
my $seq=$seqio->next_seq;      
my $primer3=Bio::Tools::Run::Primer3->new(
                                            
-seq=>$seq,
-outfile=>$file_out,
- path=>"c:/Perl/local/primer3_1.0.0/src/primer3.exe" 
                                           
 );
                                                    
  unless ($primer3->executable){                	print
"primer3 can not be found. 
             Is it installed?\n"; 
  		exit(-1);
   }

$primer3->add_targets(
# set your own parameters for the primers or product
				
'PRIMER_OPT_GC_PERCENT'=>' 50   ',		
'PRIMER_OPT_SIZE'=>  '24    ',		
'PRIMER_OPT_TM'=>  ' 60   ');
                      	
  my $result=$primer3->run;    

   exit;

I try to modify it for multiple sequences by using a
while loop as following:

while ($seq=$seqio->next_seq){

my $primer3=Bio::Tools::Run::Primer3->new()
# design the primer}
....}

I get primers only for the last sequence. It seems the
earlier ones are overwritten.

Any idea will be highly aprreciated.

Li




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Bioperl-l mailing list