[Bioperl-l] Fwd: How to get Remote BLAST results in a single out
Jason Stajich
jason.stajich at gmail.com
Mon Nov 14 06:59:56 EST 2011
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
More information about the Bioperl-l
mailing list