Ewan Birney


Bio::DB::Flat - Interface for indexed flat files


  $db = Bio::DB::Flat->new(-directory  => '/usr/share/embl',
                           -format     => 'embl',
                           -write_flag => 1);
  $seq       = $db->get_Seq_by_id('BUM');
  @sequences = $db->get_Seq_by_acc('DIV' => 'primate');
  $raw       = $db->fetch_raw('BUM');


This object provides the basic mechanism to associate positions in files with primary and secondary name spaces. Unlike Bio::Index::Abstract (see Bio::Index::Abstract), this is specialized to work with the "flat index" and BerkeleyDB indexed flat file formats worked out at the 2002 BioHackathon.

This object is a general front end to the underlying databases.


Mailing Lists

User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated.

  bioperl-l@bioperl.org             - General discussion
  http://bioperl.org/MailList.shtml - About the mailing lists

Reporting Bugs

Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via email or the web:


AUTHOR - Lincoln Stein

Email - lstein@cshl.org


The rest of the documentation details each of the object methods. Internal methods are usually preceded with an "_" (underscore).


 Title   : new
 Usage   : my $db = new Bio::Flat->new(
                     -directory  => $root_directory,
                     -write_flag => 0,
                     -index      => 'bdb'|'flat',
                     -verbose    => 0,
                     -out        => 'outputfile',
                     -format     => 'genbank');
 Function: create a new Bio::Index::BDB object
 Returns : new Bio::Index::BDB object
 Args    : -directory    Root directory containing "config.dat"
           -write_flag   If true, allows reindexing.
           -verbose      Verbose messages
           -out          File to write to when write_seq invoked
 Status  : Public

The root -directory indicates where the flat file indexes will be stored. The build_index() and write_seq() methods will automatically create a human-readable configuration file named "config.dat" in this file.

The -write_flag enables writing new entries into the database as well as the creation of the indexes. By default the indexes will be opened read only.

-index is one of "bdb" or "flat" and indicates the type of index to generate. "bdb" corresponds to Berkeley DB. You *must* be using BerkeleyDB version 2 or higher, and have the Perl BerkeleyDB extension installed (DB_File will *not* work).

The -out argument species the output file for writing objects created with write_seq().


  Title   : fetch
  Usage   : $index->fetch( $id )
  Function: Returns a Bio::Seq object from the index
  Example : $seq = $index->fetch( 'dJ67B12' )
  Returns : Bio::Seq object
  Args    : ID

Deprecated. Use get_Seq_by_id instead.

To Be Implemented in Subclasses

The following methods MUST be implemented by subclasses.

May Be Overridden in Subclasses

The following methods MAY be overridden by subclasses.