Bio::DB::QueryI(3pm)

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

πŸ’– Bio::DB::QueryI πŸ’–

okay bestie, welcome to Bio::DB::QueryI β€” Object Interface to queryable sequence databases β€” straight outta the User Contributed Perl Documentation collection. pull up a chair, we're querying sequence databases and we're gonna slay it ✨


✨ NAME ✨

Bio::DB::QueryI β€” an Object Interface to queryable sequence databases. that's the whole vibe. it's an interface, it's an object, and it wants to talk to databases that you can ask questions to πŸ¦‹


🌸 SYNOPSIS 🌸

here's the tea, and we're using Bio::DB::Query::GenBank as our little example bestie:

# using Bio::DB::Query::GenBank as an example
my $query_string = 'Oryza[Organism] AND EST[Keyword]';
my $query = Bio::DB::Query::GenBank->new(-db=>'nucleotide',
                                         -query=>$query_string);
my $count = $query->count;
my @ids   = $query->ids;

# get a genbank database handle
$gb = Bio::DB::GenBank->new();
my $stream = $db->get_Stream_by_query($query);
while (my $seq = $stream->next_seq) {
   ...
}

# initialize the list yourself
my $query = Bio::DB::Query::GenBank->new(-ids=>['X1012','CA12345']);

see how easy that was? no cap. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

so basically, this interface hands you the facilities for managing sequence queries β€” think the kind of queries Entrez is serving up. it's giving very much "ask the database nicely, get sequences back" energy.

you make a query object by calling new() with a database-specific argument list. from that query object you've got options, and bestie you're gonna use both:

  • grab the list of IDs the query returned, or
  • get a count of how many entries the query would return.

and then β€” this is the part that ate β€” you can pass the query object to a Bio::DB::RandomAccessI object and get the entries themselves back, either as a list or as a stream. iconic. πŸŽ€


🫢 FEEDBACK 🫢

πŸ’Œ Mailing Lists

user feedback is an integral part of the evolution of this and other Bioperl modules β€” fr fr, your voice matters here. 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/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. because there are many experienced and reponsive experts who 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 deets, the faster the fix, iykyk πŸ’…

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

do it for the culture πŸ¦‹


πŸ‘‘ AUTHOR - Lincoln Stein

Email lstein@cshl.org

shoutout to Lincoln, the main character of this file 🫑


🧚 APPENDIX 🧚

the rest of the documentation details each of the object methods. internal methods are usually preceded with a _ (yes, the underscore is the secret handshake, don't touch those unless you know what you're doing πŸ™ˆ).

⭐ new

Title   : new
Usage   : $db = Bio::DB::QueryI->new(@args);
Function: constructor
Returns : QueryI object
Args    : -query       a query string
          -ids         a list of ids as an arrayref

create new QueryI object. you may initialize with either a query string or with a list of ids. if both ids and a query are provided, the former takes precedence β€” so -ids wins the argument, periodt. πŸ’€

subclasses may recognize additional arguments, so don't be shocked if your subclass is doing the most.

⭐ count

Title   : count
Usage   : $count = $db->count;
Function: return count of number of entries retrieved by query
Returns : integer
Args    : none

returns the number of entries that are matched by the query. just a lil integer. a number. a whole snack. πŸ”₯

⭐ ids

Title   : ids
Usage   : @ids = $db->ids([@ids])
Function: get/set matching ids
Returns : array of sequence ids
Args    : (optional) array ref with new set of ids

it gets, it sets, it's the matching ids. hand it an optional array ref of new ids and it'll set them; hand it nothing and it'll give you the ids back. versatile queen πŸ‘‘

⭐ query

Title   : query
Usage   : $query = $db->query([$query])
Function: get/set query string
Returns : string
Args    : (optional) new query string

same deal, but for the query string itself. get it, set it, live your truth. 🌸


and that's the whole page, bestie β€” written by perl v5.32.1, dated 2021-08-15, and filed under Bio::DB::QueryI(3pm). go query something iconic πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from