[Bioperl-l] problem with Primer3: too many files open

Brian Osborne osborne1 at optonline.net
Thu Jan 19 16:06:29 EST 2006


Andy,

I believe this is fixed in 1.5.1. The newer version should look like this
around line 370 (bioperl-run/Bio/Tools/Run/Primer3.pm):

my ($temphandle, $tempfile)=$self->io->tempfile;
print $temphandle join "\n", @{$self->{'primer3_input'}}, "=\n";
$temphandle->close;
open (RESULTS, "$executable < $tempfile|") || $self->throw("Can't open
RESULTS");

Do you see the line with close in your file? If not either add this line or
upgrade to 1.5.1.

Brian O.


On 1/19/06 1:28 PM, "Andy Nunberg" <andyn108 at gmail.com> wrote:

> Hi, I am using bioperl-1.4 running Primer3 to select a bunch of primers.
> While running the script, I get an exception at the same point with
> the following error:
> 
> ------------- EXCEPTION  -------------
> MSG: Can't open RESULTS:Too many open files
> STACK Bio::Tools::Run::Primer3::run
> /compbio/pkg/bio-perl/bioperl-run/Bio/Tools/Run/Primer3.pm:361
> STACK (eval) find_primers_first_pass.pl:183
> STACK main::_primer3 find_primers_first_pass.pl:182
> STACK main::get_primer find_primers_first_pass.pl:141
> STACK toplevel find_primers_first_pass.pl:86
> 
> --------------------------------------
> 
> Now if I take this sequence out of the list and run the script, it
> runs just fine.
> 
> here is the subroutine calling primer3:
> sub _primer3{
>     my($seq,$qual_region)=@_;
>     my 
> $primer3=Bio::Tools::Run::Primer3->new(-seq=>$seq,-verbose=>0,-flush=>1);
>     my @qual = @{$seq->qual};
>     #set the start of the search window for primer3
>     my $primer3_start=1;
>     if($seq->length > ($window+100)){
>     $primer3_start=$qual_region->end-($window+100);
>     }
>     #set up primer3
>     $primer3->add_targets('INCLUDED_REGION'=>"$primer3_start,$window");
>     $primer3->add_targets('PRIMER_FIRST_BASE_INDEX'=>1,
>     'PRIMER_TASK'=>'pick_left_only');
>     $primer3->add_targets('PRIMER_SEQUENCE_QUALITY'=>"@qual");
>     $primer3->add_targets('PRIMER_MIN_QUALITY'=>$minqual,
>     'PRIMER_NUM_RETURN'=>1,
>     'PRIMER_MAX_POLY_X'=>3);
>     $primer3->add_targets('PRIMER_GC_CLAMP'=>1) unless($no_gc_clamp);
> 
>     #run primer3
>     my $prim3_results;
>     eval {
>     $prim3_results=$primer3->run;
>     };
>     die $seq->id." :$@" if ($@);
> 
>     #fetch result for the first primer
>     my $hash_ref=$prim3_results->primer_results(0);
>     return $hash_ref;
> 
> }
> 
> any suggestions? any thoughts on why I am getting the error to begin with?
> thanks
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l




More information about the Bioperl-l mailing list