Bio::DB::Flat(3pm)
π 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
- debian bookworm: libbio-perl-perl 1.7.8-1 Β· Perl
- debian trixie: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu jammy: libbio-perl-perl 1.7.8-1 Β· Perl
- ubuntu noble: libbio-perl-perl 1.7.8-1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms