[Bioperl-l] RemoteBlast: can't get a TaxBlast report
Cannon, William R
William.Cannon at pnl.gov
Thu Oct 16 18:28:50 EDT 2003
Hi,
I tried running RemoteBlast using the synopsis script found on at http://doc.bioperl.org/releases/bioperl-1.2/Bio/Tools/Run/RemoteBlast.html. Everything worked fine, as is. However, when I try to get a Taxonomy report by adding the line:
$Bio::Tools::Run::RemoteBlast::HEADER{'FORMAT_OBJECT'} = 'TaxBlast';
I still get the alignment report back. Anybody know what else I should be doing?
Thanks.
Bill
(Using :
perl 5.6
bioperl 1.2.3 on redhat linux 7.2.
Here is the full script:
#! /msrc/apps/perl-5.6/bin/perl
#Remote-blast "factory object" creation and blast-parameter initialization
use Bio::Tools::Run::RemoteBlast;
use strict;
my $prog = 'blastp';
my $db = 'nr';
my $e_val= '1.0';
my @params = ( '-prog' => $prog,
'-data' => $db,
'-expect' => $e_val,
'-readmethod' => 'SearchIO' );
my $factory = Bio::Tools::Run::RemoteBlast->new(@params);
#change a paramter
$Bio::Tools::Run::RemoteBlast::HEADER{'ENTREZ_QUERY'} = 'Homo sapiens [ORGN]';
$Bio::Tools::Run::RemoteBlast::HEADER{'FORMAT_OBJECT'} = 'TaxBlast';
#remove a parameter
delete $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENT_VIEW'};
delete $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'DESCRIPTIONS'};
delete $Bio::Tools::Run::RemoteBlast::RETRIEVALHEADER{'ALIGNMENTS'};
my $v = 1;
#$v is just to turn on and off the messages
# my $str = Bio::SeqIO->new(-file=>'amino.fa' , '-format' => 'fasta' );
my $str = Bio::SeqIO->new(-file=>'roa1.fasta' , '-format' => 'fasta' );
while (my $input = $str->next_seq()){
#Blast a sequence against a database:
#Alternatively, you could pass in a file with many
#sequences rather than loop through sequence one at a time
#Remove the loop starting 'while (my $input = $str->next_seq())'
#and swap the two lines below for an example of that.
print STDERR "%s\n", $Bio::Tools::Run::RemoteBlast::HEADER{'FORMAT_OBJECT'};
my $r = $factory->submit_blast($input);
#my $r = $factory->submit_blast('amino.fa');
print STDERR "waiting..." if( $v > 0 );
while ( my @rids = $factory->each_rid ) {
foreach my $rid ( @rids ) {
my $rc = $factory->retrieve_blast($rid);
if( !ref($rc) ) {
if( $rc < 0 ) {
$factory->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";
$factory->save_output($filename);
$factory->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";
}
}
}
}
}
}
More information about the Bioperl-l
mailing list