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

I want to add some functionality to my website, that is similar to "Retrieve results for an RID" of NCBI blast. In other words i am trying to retrieve blast results using a particular rid.


following is the code:
---------------------------------------------------- my @params = ( '-prog' => 'blastn', '-expect' => 1, '-readmethod' => 'SearchIO' ); my $factory = Bio::Tools::Run::RemoteBlast->new(@params); my $rc = $factory->retrieve_blast($rid); ----------------------------------------------------
$rid is a legitimate request ID that is passed as parameter to the function.
retrieve_blast function returns Bio::SearchIO::blast=HASH(0x2c9bf8), that indicates the success.

but $rc->next_result() function fails and I get the following error.

------------- EXCEPTION -------------
MSG: no data for midline genome
STACK Bio::SearchIO::blast::next_result
/usr/perl5/site_perl/5.6.1/Bio/SearchIO/blast.pm:1151
STACK main::test_blast /var/apache/cgi-bin/user/blast.pl:578
STACK toplevel /var/apache/cgi-bin/user/blast.cgi:65

--------------------------------------

How can I do this.

Thanks.

20040725 Edit by ysth: add code tags

Replies are listed 'Best First'.
Re: bioperl - 'Retrieve results for an RID'
by stajich (Chaplain) on Jul 23, 2004 at 21:23 UTC
    If you want Bioperl specific help you should probably post this question to the bioperl list since people who are interested in the toolkit tune in for similar questions.

    To answer the question. It appears that your BLAST output contains something outside of what is expected by SearchIO. Are you reformatting the report after it comes out of the program before it is sent back via the RID process. Presumably you need to set up your cgi so it doesn't print anything that is not part of the BLAST format.

    You can simulate all of this by taking the website out of the equation and just saving the report out to a file on the webserver. Then parsing it directly with Bio::SearchIO. If you run with -verbose => 1 you'll get more reporting of what the unrecognized data is. Presumably you have some sort of comments at the bottom of your report one of which contains 'genome' which is not parsing by the report.