[Bioperl-l] results problem with StandAloneBlast

Sendu Bala sb at mrc-dunn.cam.ac.uk
Mon Jun 5 09:19:12 EDT 2006


Jason Stajich wrote:
> 
> On Jun 5, 2006, at 5:57 AM, Sendu Bala wrote:
> 
>> Didn't you already explain why seeking a SearchIO wouldn't work? And
>> indeed, didn't Genevieve already try to do this after I suggested it and
>> found that it didn't work?
>>
>> Confused...
>>
> There is an internal _rewind if you are using the next_XX methods that 
> resets the internal iterator (all the data has already been parsed).
> 
> You >>can<< reseek the internal filehandle (accessible by calling 
> $object->_fh ), but you can't call seek on the searchio object itsself.

... poor choice of words on my part. Or maybe I'm not understanding 
you... I already suggested to Genevieve that she try:

# in the following, $blast_report is a SearchIO
> my $blast_report = $factory->blastall($ref_seq_objs);
> my $blast_fh = $blast_report->fh();
> while (<$blast_fh>) {
>      # $_ is a ResultI object, use as normal
> }
> seek($blast_fh, 0, 0); # this would be great, but does it work?
> while <$blast_fh>) {
>      # go through the results again in your second subroutine
> }
> 
> An alternative hacky way of doing it, which may also not work, would be 
> to go through your $blast_report as normal, but then before going 
> through it a second time, say
> my $fh = $blast_report->_fh;
> seek($fh, 0, 0);

She reported that neither way of doing it worked. You seem to be saying 
that at least the second way should have. Is that right?
rewind() would of course be preferable, I just wanted to know if my 
assumption about seek working was correct or not.


More information about the Bioperl-l mailing list