Bio::DB::Flat(3pm)

πŸ“¦
version 1.7.8 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Bio::DB::Flat πŸ’–

okay bestie, so this is the manual page for Bio::DB::Flat β€” it lives in the User Contributed Perl Documentation section of the manual (that's the 3pm part, iykyk). It's literally the interface for indexed flat files. no cap. let's get into it 🫢


✨ NAME ✨

Bio::DB::Flat β€” Interface for indexed flat files. that's it, that's the whole name, slay.


🌸 SYNOPSIS 🌸

look at her go:

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

you make the db, you build the index, you pull sequences out by id and by acc, and if you want the raw goods you fetch_raw. main character energy fr fr πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this object gives you the basic mechanism to associate positions in files with primary and secondary name spaces. it's giving very organized, very put-together.

unlike Bio::Index::Abstract (go look at Bio::Index::Abstract if you're curious), this one is specialized to work with the "flat index" and the BerkeleyDB indexed flat file formats that got worked out at the 2002 BioHackathon. iconic era honestly.

and this object is a general front end to the underlying databases. she's the face, the others are the machinery πŸ’–


πŸŽ€ 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. we love a participatory queen ✨

  bioperl-l@bioperl.org                  - General discussion
  http://bioperl.org/wiki/Mailing_lists  - About the mailing lists

🫢 Support

please direct usage questions or support issues to the mailing list:

bioperl-l@bioperl.org

rather than to the module maintainer directly. (not me being protective of the maintainer's inbox πŸ’€) many experienced and reponsive experts will be able look at the problem and quickly address it. please include a thorough description of the problem with code and data examples if at all possible β€” the more receipts the better, bestie.

πŸ› 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 the web:

  https://github.com/bioperl/bioperl-live/issues

πŸ‘‘ AUTHOR - Lincoln Stein πŸ‘‘

Email β€” lstein@cshl.org

(the legend himself, no notes)


πŸ“– APPENDIX πŸ“–

the rest of the documentation details each of the object methods. internal methods are usually preceded with an _ (underscore) β€” that's the secret handshake, iykyk 🀫

🌟 new

 Title   : new
 Usage   : my $db = Bio::DB::Flat->new(
                     -directory  => $root_directory,
                     -dbname     => 'mydb',
                     -write_flag => 1,
                     -index      => 'bdb',
                     -verbose    => 0,
                     -out        => 'outputfile',
                     -format     => 'genbank');
 Function: create a new Bio::DB::Flat object
 Returns : new Bio::DB::Flat object
 Args    : -directory    Root directory containing "config.dat"
           -write_flag   If true, allows creation/updating.
           -verbose      Verbose messages
           -out          File to write to when write_seq invoked
           -index        'bdb' or 'binarysearch'
 Status  : Public

the required -directory argument indicates where the flat file indexes will be stored. the build_index() and write_seq() methods will automatically create subdirectories of this root directory. each subdirectory will contain a human-readable configuration file named config.dat that specifies where the individual indexes are stored. cute and documented, we stan πŸ’…

the required -dbname argument gives a name to the database index. the index files will actually be stored in a like-named subdirectory underneath the root directory. so it's giving nesting doll realness.

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 "binarysearch" and indicates the type of index to generate. "bdb" corresponds to Berkeley DB.

⚠️ bestie listen to me. you must be using BerkeleyDB version 2 or higher, and have the Perl BerkeleyDB extension installed (DB_File will not work). i said what i said. πŸ’€

"binarysearch" corresponds to the OBDA "flat" indexed file.

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

the -format argument specifies the format of the input file or files. if the file suffix is one that Bioperl can already associate with a format then this is optional. (so you can lowkey skip it sometimes, but only sometimes 🫢)

🧚 new_from_registry

 Title   : new_from_registry
 Usage   : $db = Bio::DB::Flat->new_from_registry(%config)
 Function: creates a new Bio::DB::Flat object in a Bio::DB::Registry-
           compatible fashion
 Returns : new Bio::DB::Flat
 Args    : provided by the registry, see below
 Status  : Public

the following registry-configuration tags are recognized:

  location     Root of the indexed flat file; corresponds to the new() method's
               -directory argument.

πŸ“ 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. she's retired, let her rest.

⭐ To Be Implemented in Subclasses

the following methods MUST be implemented by subclasses. non-negotiable, bestie, it's in the contract πŸ“œ

🌈 May Be Overridden in Subclasses

the following methods MAY be overridden by subclasses. optional, do your thing, no pressure πŸ’–


and that's the whole page babes ✨ this was Bio::DB::Flat(3pm) from perl v5.32.1, dated 2021-08-15 β€” go build an index, you absolute icon πŸ‘‘πŸ’…πŸ¦‹

πŸ“¦ where this page comes from