[Bioperl-l] Remote Blast and Report

Ocar Campos ocarnorsk138 at gmail.com
Thu Feb 26 20:28:57 UTC 2009


Hello,

     I was reading the documentation, and I tried some new code, but when
retrieving I get an error, this is the error: Can't call method "query_name"
on an undefined value at ./aer2.pl line 44, <GEN4> line 185. I'm working
with only one sequence first, but then I am suppose to work with more than
50 sequences. Here is my code, that looks quite much as the one in the
documentation and some examples I found. Any idea or help that you could
give me please?

use Bio::Tools::Run::RemoteBlast;
use Bio::SearchIO;

#Here i set the parameters for blast
$prog = "tblastx";
$db = "nr";
$e_val = "1e-10";
$remoteBlast = Bio::Tools::Run::RemoteBlast->new(-prog => $prog,
                         -data => $db,
                         -expect => $e_val
                         -readmethod => 'txt'
                         );

#Select the file and make the balst.
$infile = infile.fasta';
$r = $remoteBlast->submit_blast($infile);

#Here i was suppose to get the blast report.
while (@reqIDs = $remoteBlast->each_rid )
{
    print STDERR join(" ", "\nINFO RIDs: ", @reqIDs), "\n";

    foreach $reqID (@reqIDs)
    {
    $rc = $remoteBlast->retrieve_blast($reqID); #With this I should get the
report.
    if( !ref($rc) )
     {
          if( $rc < 0 ) { #If  there's no hits.
            $remoteBlast->remove_rid($rid);
                           }
          print STDERR "." if ( $v > 0 );
          sleep 5;
       }
        else
        {
          $result = $rc->next_result();
          $filename = $result->query_name()."\.out";  #this should save the
report, but here i get error.
          $remoteBlast->save_output($filename);
          $remoteBlast->remove_rid($rid);
          print "\nQuery Name: ", $result->query_name(), "\n";
          while (  $hit = $result->next_hit )
           {
              next unless ( $v > 0);
              print "\thit name is ", $hit->name, "\n";
              while(  $hsp = $hit->next_hsp )
              {
                 print "\t\tscore is ", $hsp->score, "\n";
               }
           }
        }


    }

}


2009/2/25 Scott Markel <SMarkel at accelrys.com>

> O'car,
>
> There's a polling mechanism you need to use.  See the example in the
> Bio::Tools::Run::RemoteBlast module.  Start looking around line 60.
>
> Scott
>
> Scott Markel, Ph.D.
> Principal Bioinformatics Architect  email:  smarkel at accelrys.com
> Accelrys (SciTegic R&D)             mobile: +1 858 205 3653
> 10188 Telesis Court, Suite 100      voice:  +1 858 799 5603
> San Diego, CA 92121                 fax:    +1 858 799 5222
> USA                                 web:    http://www.accelrys.com
>
> http://www.linkedin.com/in/smarkel
> Vice President, Board of Directors:
>    International Society for Computational Biology
> Co-chair: ISCB Publications Committee
> Associate Editor: PLoS Computational Biology
> Editorial Board: Briefings in Bioinformatics
>
>
> > -----Original Message-----
> > From: bioperl-l-bounces at lists.open-bio.org [mailto:bioperl-l-
> > bounces at lists.open-bio.org] On Behalf Of Ocar Campos
> > Sent: Wednesday, 25 February 2009 4:04 PM
> > To: Bioperl Mailing List.
> > Subject: [Bioperl-l] Remote Blast and Report
> >
> > Hello:
> >
> >    I'm working in a script to remote blast a file with some sequences, I
> > already got the part of sending the query to blast, but I do not get the
> > idea of how retrieve a txt report, I mean, like the one you get by
> running
> > a
> > blast via web and you can read in a plane text editor.
> >
> > This is what I've done so far:
> >
> >
> > use Bio::Tools::Run::RemoteBlast;
> > use Bio::SearchIO;
> >
> > $prog = "tblastx";
> > $db = "nr";
> > $e_val = "1e-10";
> > $remoteBlast = Bio::Tools::Run::RemoteBlast->new(-prog => $prog,
> >                          -data => $db,
> >                          -expect => $e_val
> >                          -readmethod => 'Blast');
> >
> > #I select the file to make que query and do the blast.
> > $infile = 'file.input.fasta';
> > $r = $remoteBlast->submit_blast($infile);
> >
> > #this should be the report i get.
> > $outfile = 'got.output';
> >
> > further than this I've tried some things but none of them work, anybody
> > who
> > could give an idea of how retrieving the plane text reports please?
> >
> > Cheers.
> >
> > O'car
> > _______________________________________________
> > Bioperl-l mailing list
> > Bioperl-l at lists.open-bio.org
> > http://lists.open-bio.org/mailman/listinfo/bioperl-l
>



-- 
...the pain is momentary, the glory is forever...



More information about the Bioperl-l mailing list