http://www.perlmonks.org?node_id=368671

Tanalis has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I am currently making use of the Bio::DB::GenBank module from BioPerl to conduct searches for medical terms across a number of databases in turn.

Using the docs as a guide, I have written the following subroutine which should make this possible:

sub search { my ( $db, @keywords ) = @_; my ( $gb, $query, $seqio ); $gb = new Bio::DB::GenBank; $query = Bio::DB::Query::GenBank->new( -query => join(" ", @keywords), -db => $db ); $seqio = $gb->get_Stream_by_query($query); print "Search for [", join(" ", @keywords), "] on $db returned ", +$query->count, " results.\n"; while ( my $seq = $seqio->next_seq() ) { # do something with the data } }

I am encountering problems when trying to extract each sequence object from the stream, however, in that calls to $seqio->next_seq() never seem to return an object. I am certain data is being retrieved from the database (the count of records retrieved and obtained from $query is > 0).

Has anyone made use of this module and had a similar problem? If so, can you suggest a way to correct the issue?

Thanks in advance,