[Bioperl-l] Retrieve results for an RID

Nurcan Mete nymete at yahoo.com
Mon Jul 26 16:15:49 EDT 2004


I get the results properly from NCBI blast using the
same rid.


Though I may be wrong, I guess $rc<0 is not always in
case of error.

What I had realized was: 
Sometimes it takes so long to get the results, and get
$rc = -1.
Then I save the RID and try later. both Blast at NCBI
website and my program
returns no result at that time.


I try again later, after a sufficent time (15-20
minutes) has passed, then I get the results 
properly from NCBI blast.
and my
$factory->retrieve_blast($rid);
function returns Bio::SearchIO, indicating success.


Nurcan Mete.




--- Jason Stajich <jason at cgt.duhs.duke.edu> wrote:
> ohh - so you're not inventing your own blast + RID
> system.  That is what I
> took from your 1st mail.
> 
> What happens when you paste that RID into the box @
> NCBI?
> 
> see below also
> On Mon, 26 Jul 2004, Nurcan Mete wrote:
> 
> > No, I don't think I am trying to add something to
> > standard Blast output.
> >
> > I use standard Bio::Perl 'blast_sequence' function
> to
> > blast my sequences.
> > In the loop section, I have one small
> modification: I
> > insert into database the request ID of the blast
> that
> > has failed to be completed by the time.
> >
> > LOOP :
> >     while( my @rids = $factory->each_rid) {
> > 	foreach my $rid ( @rids ) {
> > 	    my $rc = $factory->retrieve_blast($rid);
> > 	    if( !ref($rc) ) {
> > 		if( $rc < 0 ) {
> >
> >                     # INSERT INTO TEMP_TABLE
> >                     # (request_id) VALUES('$rid')
> 
> These RIDs are removed because they failed.  If $rc
> < 0 there was an
> error.  You should not be inserting these into your
> database.
> 
> If you'd rather just insert all the RIDs into your
> db initially rather
> than doing this loop in the first place if what you
> want to do is then
> retreive them later anyways.
> 
> >
> > 		    $factory->remove_rid($rid);
> > 		}
> > 		if( $verbose ) {
> > 		    print STDERR ".";
> > 		}
> > 		sleep 10;
> > 	    } else {
> > 		$result = $rc->next_result();
> > 		$factory->remove_rid($rid);
> > 		last LOOP;
> > 	    }
> > 	}
> >     }
> >
> >
> > Then, later (ie. at midnight),  I want to retrive
> > blast results giving this stored RID.
> > very simply, I use the same function code to
> achieve
> > so:
> >
> >
> >
>
----------------------------------------------------------
> >  my @params = ( '-prog' => $prog,
> > 		'-expect' => $e_val,
> > 		'-readmethod' => 'SearchIO' );
> >
> >
> >  my $factory =
> > Bio::Tools::Run::RemoteBlast->new(@params);
> >
> >  my $rc = $factory->retrieve_blast($rid);
> >
> >
>
----------------------------------------------------------
> >
> > $rid: request ID stored in the database
> >
> > I omit the following parts of original code:
> >
> > my $r = $factory->submit_blast($seq);
> >
> > while( my @rids = $factory->each_rid) {
> > 	foreach my $rid ( @rids ) {
> >
> >
> >
> >
> > so may the problem be with this omission?
> 
> No that is all fine I guess.  Just get rid of the
> perl part and see what
> the RID value gives you when you post it on the NCBI
> site.
> >
> >
> > I hope these details are more explanative.
> >
> > Thank you.
> >
> >
> >
> >
> >
> > --- Jason Stajich <jason at cgt.duhs.duke.edu> wrote:
> > > Hmm - As I said in the perlmonks post you need
> to
> > > give more information,
> > > i.e. a copy of the report which is failing.  Is
> your
> > > webscript adding
> > > things to the report which are not part of the
> > > standard BLAST output, etc.
> > >
> > > -j
> > > On Fri, 23 Jul 2004, Nurcan Mete wrote:
> > >
> > > >
> > > > 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.
> > > >
> > > >
> > > >
> > > >
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Mail - You care about security. So do
> we.
> > > > http://promotions.yahoo.com/new_mail
> > > >
> _______________________________________________
> > > > Bioperl-l mailing list
> > > > Bioperl-l at portal.open-bio.org
> > > >
> > >
> >
>
http://portal.open-bio.org/mailman/listinfo/bioperl-l
> 
=== message truncated ===



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 


More information about the Bioperl-l mailing list