5 run_primer3.pl - run primer3 and parse its output
9 ./run_primer3.pl -i test.fa
13 ./run_primer3.pl --input=test.fa
17 Example of how to run primer3 and parse its output, essentially taken from an
18 email written by Paul Wiersma to bioperl-l.
22 User feedback is an integral part of the evolution of this and other
23 Bioperl scripts. Send your comments and suggestions to the Bioperl
24 mailing list. Your participation is much appreciated.
26 bioperl-l@bioperl.org - General discussion
27 http://bioperl.org/wiki/Mailing_lists - About the mailing lists
31 Report bugs to the Bioperl bug tracking system to help us keep track
32 of the bugs and their resolution. Bug reports can be submitted via the
35 https://github.com/bioperl/bioperl-live/issues
39 Brian Osborne, bosborne at alum.mit.edu
45 use Bio
::Tools
::Run
::Primer3
;
50 GetOptions
("i|input:s" => \
$in_file );
52 usage
() unless $in_file;
54 my $seqio = Bio
::SeqIO
->new(-file
=> $in_file);
56 while (my $seq = $seqio->next_seq) {
57 my $primer3 = Bio
::Tools
::Run
::Primer3
->new(-seq
=> $seq);
58 $primer3->program_name('primer3_core') unless $primer3->executable;
60 $primer3->add_targets('PRIMER_MIN_TM' => 56, 'PRIMER_MAX_TM' => 90);
62 my $results = $primer3->run;
64 unless ($results->number_of_results) {
65 print "No results for ",$seq->display_id;
69 my @out_keys_part = qw(START
77 print "\n", $seq->display_id, "\n";
79 for (my $i = 0 ; $i < $results->number_of_results ; $i++){
80 my $result = $results->primer_results($i);
83 for my $key qw(PRIMER_LEFT PRIMER_RIGHT){
84 my ($start, $length) = split /,/, $result->{$key};
85 $result->{$key . "_START"} = $start;
86 $result->{$key . "_LENGTH"} = $length;
87 foreach my $partkey (@out_keys_part) {
88 print "\t", $result->{$key . "_" . $partkey};
92 print "\tPRODUCT SIZE: ", $result->{'PRIMER_PRODUCT_SIZE'}, ", PAIR ANY COMPL: ",
93 $result->{'PRIMER_PAIR_COMPL_ANY'};
94 print ", PAIR 3\' COMPL: ", $result->{'PRIMER_PAIR_COMPL_END'}, "\n";