[Bioperl-l] results problem with StandAloneBlast

Genevieve DeClerck gad14 at cornell.edu
Fri May 26 20:02:33 UTC 2006


Hi,

I'm running local blast with Bio::Tools::Run::StandAloneBlast. 
Everything seems to work ok up to the point of accessing the results. I 
am able to print the results but when I try to do more than one thing 
with the result, nothing is returned for the second activity..

I'd like to first sort the results into groups of results that hit the 
db seq once, twice, three times, etc - where the results are stored as 
SeqFeature objects in temporary arrays whose contents are printed 
sequentially to stdout when the whole sort is complete.

Secondly, I need to print the results in Hit Table (i.e. -m 8) format to 
stdout.

If I've sorted the results the sorted-results will print to screen, 
however when I try to print the Hit Table results nothing is returned, 
as if the blast results have evaporated.... and visa versa, if i comment 
out the part where i point my sorting subroutine to the blast results 
reference,  my hit table results suddenly prints to screen. It's almost 
like the reference to the SearchIO obj that holds the StandAloneBlast 
results is lost after one use?? (I'm beginning to think there is 
something naive about the way I'm using references?..)


Here's an abbreviated version of my code:


my $ref_seq_objs; # ref to array of Sequence obj's
my $genome_seq; # fasta containing 1 genomic sequence

my @params = ('program' => 'blastn',
	       'database' => $genome_seq,
                 );
my $factory = Bio::Tools::Run::StandAloneBlast->new(@params);

my $blast_report = $factory->blastall($ref_seq_objs); #OK

#######
### the following 2 actions seem to be mutually exclusive.
# 1) sort results into 1-hitter, 2-hitter, etc. groups of
# SeqFeature objs stored in arrays. arrays are then printed
# to stdout
&sort_results($blast_report);

# 2) print blast results
&print_blast_results($blast_report);
#######


sub print_blast_results{
   my $report = shift;
   while(my $result = $report->next_result()){
     while(my $hit = $result->next_hit()){
       while(my $hsp = $hit->next_hsp()){
	my $q_name = $hsp_q_seq_obj->display_id;
         print join(", ",$q_name,$hit->name,$hsp->bits)."\n";
       }
     }
   }
}


I'm about to lose my mind on this... any assistance appreciated!

Thanks,
Genevieve




More information about the Bioperl-l mailing list