2
# $Id: run_primer3.pl,v 1.3.4.1 2006/10/02 23:10:38 sendu Exp $
6
run_primer3.pl - run primer3 and parse its output
10
./run_primer3.pl -i test.fa
14
./run_primer3.pl --input=test.fa
18
Example of how to run primer3 and parse its output, essentially taken from an
19
email written by Paul Wiersma to bioperl-l.
23
User feedback is an integral part of the evolution of this and other
24
Bioperl scripts. Send your comments and suggestions to the Bioperl
25
mailing list. Your participation is much appreciated.
27
bioperl-l@bioperl.org - General discussion
28
http://bioperl.org/wiki/Mailing_lists - About the mailing lists
32
Report bugs to the Bioperl bug tracking system to help us keep track
33
of the bugs and their resolution. Bug reports can be submitted via the
36
http://bugzilla.open-bio.org/
40
Brian Osborne, bosborne at alum.mit.edu
46
use Bio::Tools::Run::Primer3;
51
GetOptions("i|input:s" => \$in_file );
53
usage() unless $in_file;
55
my $seqio = Bio::SeqIO->new(-file => $in_file);
57
while (my $seq = $seqio->next_seq) {
58
my $primer3 = Bio::Tools::Run::Primer3->new(-seq => $seq);
59
$primer3->program_name('primer3_core') unless $primer3->executable;
61
$primer3->add_targets('PRIMER_MIN_TM' => 56, 'PRIMER_MAX_TM' => 90);
63
my $results = $primer3->run;
65
unless ($results->number_of_results) {
66
print "No results for ",$seq->display_id;
70
my @out_keys_part = qw(START
78
print "\n", $seq->display_id, "\n";
80
for (my $i = 0 ; $i < $results->number_of_results ; $i++){
81
my $result = $results->primer_results($i);
84
for my $key qw(PRIMER_LEFT PRIMER_RIGHT){
85
my ($start, $length) = split /,/, $result->{$key};
86
$result->{$key . "_START"} = $start;
87
$result->{$key . "_LENGTH"} = $length;
88
foreach my $partkey (@out_keys_part) {
89
print "\t", $result->{$key . "_" . $partkey};
93
print "\tPRODUCT SIZE: ", $result->{'PRIMER_PRODUCT_SIZE'}, ", PAIR ANY COMPL: ",
94
$result->{'PRIMER_PAIR_COMPL_ANY'};
95
print ", PAIR 3\' COMPL: ", $result->{'PRIMER_PAIR_COMPL_END'}, "\n";