[Bioperl-l] Remote Blast and Report

Jason Stajich jason at bioperl.org
Sun Mar 1 20:19:50 EST 2009


I think $rc is already a Bio::SearchIO object - you shouldn't have to  
instantiate a Bio::SearchIO object that is what the -readmethod in the  
@params at the top is for.

Try printing ref($ref) to see what it is.

-js
On Mar 1, 2009, at 4:51 PM, Ocar Campos wrote:

> Hello, I tried your script Russel, but I still got the same error in  
> the
> console, "Can't call method "query_name" on an undefined value at ./ 
> aer2.pl
> line 39, <GEN4> line 185.", I didn't do anything to it, just copy/ 
> paste and
> ran it. So what I assumed is that the object for the SearchIO module  
> was not
> initialized, so I created it, but now I get an Exeption while  
> parsing the
> report:
>
>
> ------------- EXCEPTION  -------------
> MSG: Could not open Bio::SearchIO::blast=HASH(0x8bb79bc): Doesn't  
> exist the
> file or directory.
> STACK Bio::Root::IO::_initialize_io
> /usr/lib/perl5/site_perl/5.8.8/Bio/Root/IO.pm:273
> STACK Bio::Root::IO::new /usr/lib/perl5/site_perl/5.8.8/Bio/Root/ 
> IO.pm:213
> STACK Bio::SearchIO::new /usr/lib/perl5/site_perl/5.8.8/Bio/ 
> SearchIO.pm:135
> STACK Bio::SearchIO::new /usr/lib/perl5/site_perl/5.8.8/Bio/ 
> SearchIO.pm:167
> STACK toplevel ./aer2.pl:45
>
> --------------------------------------
>
> aer2.pl is my script, Any Idea what it could be?
>
> The script:
>
> #!/usr/bin/perl
>
> use Bio::Tools::Run::RemoteBlast;
> use Bio::SearchIO;
> use Data::Dumper;
>
> ########HERE I SET THE PARAMETERS
> $prog = "tblastx";
> $db = "nr";
> $e_val = "1e-10";
>
> my @params = ( '-prog' => $prog,
>        '-data' => $db,
>        '-expect' => $e_val,
>        '-readmethod' => 'SearchIO' );
>
> my $remoteBlast = Bio::Tools::Run::RemoteBlast->new(@params);
>
>
> ########SELECT FILE AND RUN THE BLAST.
> $infile = 'secuencia.fasta';
> $r = $remoteBlast->submit_blast($infile);
>
> my $v = 1;
>
>   print STDERR "waiting...\n" if( $v > 0 );  ########  WAIT FOR THE  
> RESULTS
> TO RETURN!!!!!
>   while ( my @rids = $remoteBlast->each_rid )
>   {
>     foreach my $rid ( @rids )
>     {
>       my $rc = $remoteBlast->retrieve_blast($rid);  ###I RETRIEVE THE
> REPORT.
>       print $rc, "\n";                  ########ONLY FOR CHECKING
>       if( !ref($rc) )
>       {
>         if( $rc < 0 )
>         {
>           $remoteBlast->remove_rid($rid);
>         }
>         print STDERR "." if ( $v > 0 );
>         sleep 5;
>       }
>       else
>       {
>        ##########HERE I CREATE THE SEARCHIO OBJECT FOR WORKING WITH  
> THE
> REPORT
>        $report = new Bio::SearchIO (-format => 'blast',
>                                     -file   => $rc      #########$rc  
> SHOULD
> CONTAIN THE REPORT
>                      );
>        my $result = $report->next_result();
>        #########SAVE THE OUTPUT
>        my $filename = $result->query_name()."\.out";
>        $remoteBlast->save_output($filename);
>        $remoteBlast->remove_rid($rid);
>        print "\nQuery Name: ", $result->query_name(), "\n";
>        while ( my $hit = $result->next_hit )
>        {
>          next unless ( $v > 0);
>          print "\thit name is ", $hit->name, "\n";
>          while( my $hsp = $hit->next_hsp )
>          {
>            print "\t\tscore is ", $hsp->score, "\n";
>          }
>        }
>       }
>      }
>    }
>
>
> Thanks in advance.
> Cheers.
> O'car.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

Jason Stajich
jason at bioperl.org





More information about the Bioperl-l mailing list