[Bioperl-l] Bio::Tools::Run::Primer3 question

Sean Davis sdavis2 at mail.nih.gov
Tue Jun 22 06:34:03 EDT 2004


I am using Bio::Tools::Run::Primer3 to find internal oligos.  I feed in
sequences and get results (code below), but the code reliably dies at the
same place (after the same number (about 247) of primer3 runs) regardless of
the sequence passed as input.  Can anyone shed some light on this behavior?

Thanks,
Sean

------------- EXCEPTION  -------------
MSG: Can't open RESULTS
STACK Bio::Tools::Run::Primer3::run
/Library/Perl/5.8.1/Bio/Tools/Run/Primer3.pm:359
STACK toplevel junk.pl:56

--------------------------------------
        
Bio::Root::Root::throw('Bio::Tools::Run::Primer3=HASH(0xc4e01c)','Can\'t
open RESULTS') called at /Library/Perl/5.8.1/Bio/Tools/Run/Primer3.pm line
359
        
Bio::Tools::Run::Primer3::run('Bio::Tools::Run::Primer3=HASH(0xc4e01c)')
called at junk.pl line 56
Debugged program terminated.  Use q to quit or R to restart,
  use O inhibit_exit to avoid stopping after program termination,
  h q, h R or h O to get additional info.

##########TEST CODE HERE#########
#!/usr/bin/perl
use strict;
use warnings;
use Bio::SeqIO;
use Bio::Seq;
use Bio::DB::GFF;
use Bio::Tools::Run::Primer3;

my $seq1=new Bio::Seq;


my $db   = Bio::DB::GFF->new( -adaptor => 'dbi::mysql',
                  -dsn     => 'host=localhost;database=gff_hg16');

print "What chromosomes to extract?";
my $chrom=<>;
$chrom="chr" . chomp($chrom);
print "What start position?";
my $start=<>;
chomp($start);
print "What end position  ?";
my $end=<>;
chomp($end);
print "How large a segment?";
my $length=<>;
chomp($length);
print "How far to skip?    ";
my $skip=<>;
chomp($skip);

for (my $i=$start;$i<=$end+$length;$i+=($length+$skip)) {
  my $segment=$db->segment(-name=>$chrom,
               -start=>$i,
               -end  =>$i+$length);
  print "> $chrom | Start=$i;End=" . ($i+$length) . "\n";
  my $dna=$segment->dna;
  $seq1->seq($dna);
  $seq1->primary_id("$chrom | Start=$i;End=" . ($i+$length));
  $seq1->accession_number("$chrom | Start=$i;End=" . ($i+$length));
  $seq1->id("$chrom | Start=$i;End=" . ($i+$length));
  my $primer3 = Bio::Tools::Run::Primer3->new();
  $primer3->add_targets(PRIMER_INTERNAL_OLIGO_MIN_SIZE     => 65,
              PRIMER_INTERNAL_OLIGO_MAX_SIZE     => 75,
              PRIMER_INTERNAL_OLIGO_MIN_TM       => 73,
              PRIMER_INTERNAL_OLIGO_MAX_TM       => 83,
              PRIMER_INTERNAL_OLIGO_OPT_TM       => 78,
              PRIMER_INTERNAL_OLIGO_OPT_SIZE     => 70,
              SEQUENCE                           => $dna,
              PRIMER_TASK => 'pick_hyb_probe_only'
              );
  my $results;
  $results=$primer3->run();
  if ($results->number_of_results>0) {
    foreach my $key (keys %{$results->primer_results(0)}) {
      print "$key\t${$results->all_results}{$key}\n";
    }
  }
}







More information about the Bioperl-l mailing list