[Bioperl-l] DB_File and assembly IO

Joshua Udall jaudall at gmail.com
Fri Aug 29 02:46:20 EDT 2008

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
STACK Bio::Assembly::Contig::new
STACK Bio::Assembly::IO::ace::next_assembly
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)

Joshua Udall
Assistant Professor
295 WIDB
Plant and Wildlife Science Dept.
Brigham Young University
Provo, UT 84602
Fax: 801-422-0008

More information about the Bioperl-l mailing list