Bio::D...keleydb(3pm)
π Bio::DB::GFF::Adaptor::berkeleydb β the berkeleydb adaptor, bestie edition π
okay so this page is Bio::D...keleydb(3pm) from the User Contributed Perl Documentation collection, and we're about to make an in-memory database adaptor make sense together. grab a snack. π
β¨ NAME β¨
Bio::DB::GFF::Adaptor::berkeleydb β it's a Bio::DB::GFF database adaptor for in-memory databases. yes, the vibes are immaculate and the features are indexed. π
π¦ SYNOPSIS π¦
here's the whole vibe, verbatim, no edits, we do not touch the code:
use Bio::DB::GFF;
my $db = Bio::DB::GFF->new(-adaptor=> 'berkeleydb',
-create => 1, # on initial build you need this
-dsn => '/usr/local/share/gff/dmel');
# initialize an empty database, then load GFF and FASTA files
$db->initialize(1);
$db->load_gff('/home/drosophila_R3.2.gff');
$db->load_fasta('/home/drosophila_R3.2.fa');
# do queries
my $segment = $db->segment(Chromosome => '1R');
my $subseg = $segment->subseq(5000,6000);
my @features = $subseg->features('gene');
See Bio::DB::GFF for other methods. (yes bestie, there's a whole other page, this one's just the berkeleydb girlie.) πΈ
π DESCRIPTION π
So. This adaptor implements a berkeleydb-indexed version of Bio::DB::GFF. It needs the DB_File and Storable modules β those are the non-negotiables, no cap. And what's it for? storing and retrieving short to medium-length GFF files of several million features in length. several MILLION. ate. π
π CONSTRUCTOR π
Use Bio::DB::GFF->new() to construct new instances of this class. Three named arguments are recommended (the original says three, we're listing them all anyway because we keep EVERY detail in this house π).
here's the arg lineup, one bullet each, exactly as the original lays them out:
-adaptorβ Set to"berkeleydb"to create an instance of this class.-dsnβ Path to directory where the database index files will be stored (alias-db)-autoindexβ Monitor the indicated directory path for FASTA and GFF files, and update the indexes automatically if they change (alias-dir)-writeβ Set to a true value in order to update the database.-createβ Set to a true value to create the database the first time (implies-write)-tmpβ Location of temporary directory for storing intermediate files during certain queries.-preferred_groupsβ Specify the grouping tag. SeeBio::DB::GFF
now the tea on each of them β:
The -dsn argument selects the directory in which to store the database index files. If the directory does not exist it will be created automatically, provided that the current process has sufficient privileges. If no -dsn argument is specified, a database named "test" will be created in your system's temporary files directory. lowkey chaotic but okay.
The -tmp argument specifies the temporary directory to use for storing intermediate search results. If not specified, your system's temporary files directory will be used. On Unix systems, the TMPDIR environment variable is honored. Note that some queries can require a lot of space. like, a LOT. be aware bestie. π
The -autoindex argument, if present, selects a directory to be monitored for GFF and FASTA files (which can be compressed with the gzip program if desired). Whenever any file in this directory is changed, the index files will be updated. Note that the indexing can take a long time to run: anywhere from 5 to 10 minutes for a million features. An alias for this argument is -dir, which gives this adaptor a similar flavor to the "memory" adaptor. β¨
-dsn and -dir can point to the same directory. If -dir is given but -dsn is absent the index files will be stored into the directory containing the source files. For autoindexing to work, you must specify the same -dir path each time you open the database. same path, every time, no switching up on it. π«Ά
If you do not choose autoindexing, then you will want to load the database using the bp_load_gff.pl command-line tool. For example:
bp_load_gff.pl -a berkeleydb -c -d /usr/local/share/gff/dmel dna1.fa dna2.fa features.gff
π METHODS π
See Bio::DB::GFF for inherited methods. that's it, that's the section, the inherited methods live over there. π«
π BUGS π
okay so the not-so-fun parts, but we tell the truth here:
- The various
get_Stream_*methods and thefeatures()method with the-iteratorargument only return an iterator after the query runs completely and the module has been able to generate a temporary results file on disk. This means that iteration is not as big a win as it is for the relational-database adaptors. π - Like the
dbi::mysqloptadaptor, this module uses a binning scheme to speed up range-based searches. The binning scheme used here imposes a hard-coded 1 gigabase (1000 Mbase) limit on the size of the largest chromosome or other reference sequence. hard limit, no negotiating, periodt.
π₯ SEE ALSO π₯
Bio::DB::GFF, bioperl
π AUTHORS π
Vsevolod (Simon) Ilyushchenko >simonf@cshl.edu< Lincoln Stein >lstein@cshl.edu<
Copyright (c) 2005 Cold Spring Harbor Laboratory.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π§ _feature_by_name π§
- Title :
_feature_by_name - Usage :
$db->get_features_by_name($class,$name,$callback) - Function: get a list of features by name and class
- Returns : count of number of features retrieved
- Args : name of feature, class of feature, and a callback
- Status : protected
This method is used internally. The callback arguments are those used by make_feature(). iykyk, it's the behind-the-scenes girlie. π
and that's the whole page bestie!! this one's from perl v5.30.0, dated 2020-01-13, and it lives under the Bio::D...keleydb(3pm) name β go index something gorgeous πβ¨π¦
π¦ where this page comes from
- debian bookworm: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbio-db-gff-perl 1.7.4-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms