[Bioperl-l] proposed query interface to Web-based sequence entry databases

Ewan Birney birney@ebi.ac.uk
Tue, 19 Nov 2002 02:17:12 +0000 (GMT)


On Mon, 18 Nov 2002, Lincoln Stein wrote:

> Hi,
>
> I'm doing the search interface to Entrez's eutils now.  This facility
> will allow people to create a query using Entrez query language and
> either get the count of entries returned, get the list of returned IDs
> (not accessions, unfortunately), or get the entries themselves.
>
> How does this API look?  I'm trying to keep it very basic.
>
> Lincoln
>
> PS: implementing this will require some surgery to WebDBSeqI, but I
> promise not to break anything.
>
> # $Id$
> #
> # BioPerl module for Bio::DB::QueryI.pm
> #
> # Cared for by Lincoln Stein <lstein@cshl.org>
> #
> # Copyright Lincoln Stein
> #
> # You may distribute this module under the same terms as perl itself
> #
> # POD documentation - main docs before the code
> #
>
> =head1 NAME
>
> Bio::DB::QueryI - Object Interface to queryable sequence databases
>
> =head1 SYNOPSIS
>
>    # 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->get_Ids;

This looks good. Is the idea that a Bio::DB::QueryI isa Bio::DB::WebDBSeqI
or something...

>
>    # get a genbank database handle
>    $gb = new Bio::DB::GenBank;
>    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']);
>
> =head1 DESCRIPTION
>
> This interface provides facilities for managing sequence queries such
> as those offered by Entrez.  A query object is created by calling
> new() with a database-specific argument list. From the query object
> you can either obtain the list of IDs returned by the query, or a
> count of entries that would be returned.  You can pass the query
> object to a Bio::DB::RandomAccessI object to return the entries
> themselves as a list or a stream.
>



> =head1 FEEDBACK
>
> =head2 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
>
> =head2 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/
>
> =head1 AUTHOR - Lincoln Stein
>
> Email lstein@cshl.org
>
> =head1 APPENDIX
>
> The rest of the documentation details each of the
> object methods. Internal methods are usually
> preceded with a _
>
> =cut
>
> # Let the code begin...
>
> package Bio::DB::QueryI;
> use strict;
> use vars qw(@ISA $VERSION);
>
> @ISA = (Bio::Root::RootI);
> $VERSION = '0.1';
>
> sub new {
>   my ($class, @args) = @_;
>   my $self = $class->SUPER::new(@args);
> }
>
> sub count   { }
> sub ids { }
> sub query { }
>
> 1;
>
>
> --
> ========================================================================
> Lincoln D. Stein                           Cold Spring Harbor Laboratory
> lstein@cshl.org			                  Cold Spring Harbor, NY
> Positions available at my lab: see http://stein.cshl.org/#hire
> ========================================================================
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l
>