[Bioperl-l] results problem with StandAloneBlast

Chris Fields cjfields at uiuc.edu
Sun Jun 4 11:51:53 EDT 2006

On Jun 4, 2006, at 9:08 AM, Jason Stajich wrote:

> right - you don't need rewind if you aren't going to use the  
> iterator (next_XXX) -- we provide two different ways to get access  
> to the data.
> you can do
> for my $hit ( $result->hits ) {
> }
> or
> while( my $hit = $result->next_hit ) {
> }
> If you want to rewind the parser then (assuming you are using a  
> filestream and not a data stream from the web or zcat or something)  
> just reset the filehandle
> seek($searchio->_fh, 0);
> but then you'll have to re-parse everything and pay that cost twice  
> - it makes more sense to me to just save the results and put them  
> in list if you are going to deliberately make two passes over all  
> the results.    You either pay the cost of memory (keeping all the  
> objects) or time (reparse the results).

I agree there isn't any really good reason to rewind the parser; I  
was mainly just curious how this was accomlished.  Your point about a  
memory or time hit might be a point we want to make in the HOWTO.  I  
already added some example code about rewinding the iterator and  
hits, so I'll add a bit about this.

I think a good deal of confusion here comes from not knowing how  
SearchIO works (i.e. that parsing a report can return several  
results, in turn which can return hits, in tur returning HSP's).  Of  
course that doesn't include iterations in the case of PSI-BLAST.    
The HOWTO, I think, explains this all well so it may be a matter of  
just RTM (I left the 'F' out to be a bit more polite).


> -jason
> On Jun 4, 2006, at 1:17 AM, Chris Fields wrote:

Christopher Fields
Postdoctoral Researcher
Lab of Dr. Robert Switzer
Dept of Biochemistry
University of Illinois Urbana-Champaign

More information about the Bioperl-l mailing list