[Bioperl-l] results problem with StandAloneBlast

Sendu Bala sb at mrc-dunn.cam.ac.uk
Tue May 30 07:59:28 UTC 2006


Genevieve DeClerck wrote:
> Hi,
[snip]
> 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.
[snip]
> Here's an abbreviated version of my code:
[snip]
> #######
> ### 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()){
[snip]

You didn't give us your sort_results subroutine, but is it as simple as
they both use $report->next_result (and/or $result->next_hit), but you
don't reset the internal counter back to the start, so the second
subroutine tries to get the next_result and finds the first subroutine
has already looked at the last result and so next_result returns false?

 From a quick look it wasn't obvious how to reset the counter. Hopefully
this can be done and someone else knows how.




More information about the Bioperl-l mailing list