[Bioperl-l] DB_File and assembly IO

Florent Angly florent.angly at gmail.com
Fri Aug 29 04:40:25 EDT 2008


Hi Joshua,

I don't know the specifics of DB_File, but the 'Cannot open file tree: 
Too many open files' is pretty explicit.
If you're on Unix/Linux you can check the files that are open by your 
program by typing:
    lsof | grep name_of_program
There is probably a filehandle that in not closed somewhere in your code 
or the BioPerl code.
Best,

Florent



Joshua Udall wrote:
> Bioperl -
>
> I'm trying to read/parse a single cap3 ace file with several thousand
> contigs.  I get a DB_File error at Contig247.  Here's the error:
>
> ------------- EXCEPTION -------------
> MSG: Unable to tie DB_File handle
> STACK Bio::SeqFeature::Collection::new
> /Users/jaudall/bin/src/bioperl-live/Bio/SeqFeature/Collection.pm:195
> STACK Bio::Assembly::Contig::new
> /Users/jaudall/bin/bioperl-live/Bio/Assembly/Contig.pm:256
> STACK Bio::Assembly::IO::ace::next_assembly
> /Users/jaudall/bin/src/bioperl-live/Bio/Assembly/IO/ace.pm:148
> STACK toplevel /Users/jaudall/bin/read_ace.pl:214
> -------------------------------------
>
> Looking at the Collection::new, the error is on the middle line:
>
>   $self->{'_btree'} = tie %{$self->{'_btreehash'}}, 'DB_File',
> $self->indexfile, O_RDWR|O_CREAT, 0640, $DB_BTREE;  # or die "Cannot open
> file: $!\n" ;
>   $self->{'_btree'} || $self->throw("Unable to tie DB_File handle");
>   return $self;
>
> If I uncomment out the $! die statement that I inserted, I get this:
>
> 'Cannot open file tree: Too many open files'
>
> Apparently the Collection constructor is creating a new index file for each
> one and the handles for each are sticking around?  That confuses me because
> reading more about the Collection.pm and DB_File, it appeared to me that no
> files were written by default (as I'm doing), rather the Collection objects
> are all stored in memory.  I'm pretty sure the error is not a permission
> error, and if it is not the open file-handles, what else should I look for?
>
>
> If I 'warn' the error instead of throwing it, I get:
>
> Can't call method "get_dup" on an undefined value at
> /Users/jaudall/bin/src/bioperl-live/Bio/SeqFeature/Collection.pm line 360
>
> This kind of makes sense because the index appears not be be created and it
> can't look stuff up in an undefined tied hash.  I'm stuck.
>
> Thanks for any help and suggestions.
>
> OSX, perl 5.8.8, bioperl-live (svn last week)
>
>   



More information about the Bioperl-l mailing list