The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

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

SYNOPSIS

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

DESCRIPTION

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.

FEEDBACK

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:

  bioperl-bugs@bio.perl.org
  http://bugzilla.bioperl.org/

AUTHOR - Lincoln Stein

Email - lstein@cshl.org

APPENDIX

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

new

 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().

fetch

  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.