[Bioperl-l] How to get Remote BLAST results in a single out

Fields, Christopher J cjfields at illinois.edu
Mon Nov 14 12:02:22 EST 2011


Re: a BLAST+ equivalent for blastcl3, I believe there is an option for the various 'blast*' indicating the search is to use a remote database.  I haven't used it, though...

chris

On Nov 14, 2011, at 8:07 AM, Jason Stajich wrote:

> Please keep this on list discussions 
> 
> Sent from my iPhone-please excuse typos
> 
> --
> Jason Stajich
> 
> Begin forwarded message:
> 
>> From: José Luis Lavín <jluis.lavin at unavarra.es>
>> Date: November 14, 2011 8:04:25 AM EST
>> To: Jason Stajich <jason.stajich at gmail.com>
>> Subject: Re: [Bioperl-l] Fwd: How to get Remote BLAST results in a single out
>> 
>> Hello Jason,
>> 
>> As answering your question:
>> 
>> " If you want to do this within this code I guess the question is what format you want the data in - a BLAST report or something more like a table?"
>> 
>> A concatenation of BLAST (default format) reports should be OK, since I have a script to parse that kind of results. Anyway formats 1 or 2 will also do the trick. 
>> I'll be happy to get assistance  on how to change the OUTFILE from "a query a report" to "all queries in the same report", because I don't seem to be able to do it myself after reading the module documentation.
>> 
>> Thanks in advance
>> 
>> El 14 de noviembre de 2011 12:59, Jason Stajich <jason.stajich at gmail.com> escribió:
>> if you want to do a bunch of BLASTs remotely on the cmdline you should also just use the NCBI's blastcl3 tool (not sure if there is a BLAST+ equivalent). This might be faster to do and easier since you need to learn the programming part too.
>> 
>> If you want to do this within this code I guess the question is what format you want the data in - a BLAST report or something more like a table?
>> 
>> On Nov 14, 2011, at 6:14 AM, José Luis Lavín wrote:
>> 
>>> Hello everybody,
>>> 
>>> I've been using  "Bio::Tools::Run::RemoteBlast" for a time and it has
>>> worked fine for me. Now I need to perform a multiple BLAST search, but this
>>> time I'd just like to get all the BLAST results in a single out file
>>> instead of having each sequence's report written individually. I've read
>>> the documentation of the module, but due to my short
>>> experience/understanding on complex modules as this one seems to be I can't
>>> figure out where to change the script to achieve my previously mentioned
>>> aim.
>>> Here I post the script I've been using (it's basically the one posted on
>>> the module cookbook).
>>> 
>>> #!/c:/Perl -w
>>> use Bio::Tools::Run::RemoteBlast;
>>> use Bio::SearchIO;
>>> use Data::Dumper;
>>> 
>>> #Here i set the parameters for blast
>>> print "Enter your BLAST choice (blastn, blastp, blastx, tblastn,
>>> tblastx):\n";
>>> my $blst = <STDIN>;
>>> my $prog = "$blst";
>>> print "Enter a database to search (nr, refseq_protein, swissprot, pat, pdb,
>>> env_nr):\n";
>>> my $dtb = <STDIN>;
>>> $db = "$dtb";
>>> print "Enter your cutt off score (1e-n):\n";
>>> my $cut = <STDIN>;
>>> my $e_val = "$cut";
>>> 
>>> my @params = ( '-prog' => $prog,
>>>        '-data' => $db,
>>>        '-expect' => $e_val,
>>>        '-readmethod' => 'SearchIO' );
>>> 
>>> my $remoteBlast = Bio::Tools::Run::RemoteBlast->new(@params);
>>> 
>>> 
>>> #Select the file and make the blast.
>>> print "Enter your FASTA file:\n";
>>> chomp(my $infile = <STDIN>);
>>> my $r = $remoteBlast->submit_blast($infile);
>>> my $v = 1;
>>> 
>>>   print STDERR "waiting..." 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);
>>>       if( !ref($rc) ) {
>>>         if( $rc < 0 ) {
>>>           $remoteBlast->remove_rid($rid);
>>>         }
>>>         print STDERR "." if ( $v > 0 );
>>>         sleep 5;
>>>       } else {
>>>         my $result = $rc->next_result();
>>>         #save the output
>>>         my $filename =
>>> $result->query_name()."\.out";##################open SALIDA,
>>> '>>'."$^T"."Report"."\.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";
>>>           }
>>>         }
>>>       }
>>>     }
>>>   }
>>> 
>>> 
>>> May any of you please explain me how to solve my question?
>>> 
>>> Thanks in advence
>>> 
>>> With best wishes
>>> 
>>> --
>>> --
>>> Dr. José Luis Lavín Trueba
>>> 
>>> Dpto. de Producción Agraria
>>> Grupo de Genética y Microbiología
>>> Universidad Pública de Navarra
>>> 31006 Pamplona
>>> Navarra
>>> SPAIN
>>> 
>>> 
>>> 
>>> --
>>> --
>>> Dr. José Luis Lavín Trueba
>>> 
>>> Dpto. de Producción Agraria
>>> Grupo de Genética y Microbiología
>>> Universidad Pública de Navarra
>>> 31006 Pamplona
>>> Navarra
>>> SPAIN
>>> 
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>> 
>> 
>> _______________________________________________
>> Bioperl-l mailing list
>> Bioperl-l at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>> 
>> 
>> 
>> -- 
>> -- 
>> Dr. José Luis Lavín Trueba
>> 
>> Dpto. de Producción Agraria
>> Grupo de Genética y Microbiología
>> Universidad Pública de Navarra
>> 31006 Pamplona
>> Navarra
>> SPAIN
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l





More information about the Bioperl-l mailing list