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,


In reply to Retrieving Search Results from a Bio::DB::GenBank Query by Tanalis

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.