[Bioperl-l] results problem with StandAloneBlast

Jason Stajich jason at bioperl.org
Mon Jun 5 09:45:40 EDT 2006


It depends on how you have run StandAloneBlast -- if the stream you  
are dealing with is not a file, but a datastream as in the STDOUT  
from BLAST, then the seek won't work (as it wouldn't work for a zcat  
on gzipped file).  I think the default StandAloneBlast behavior is to  
operate on a STDOUT stream so seeking won't work no matter what.


On Jun 5, 2006, at 9:19 AM, Sendu Bala wrote:

> 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.
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l

--
Jason Stajich
Duke University
http://www.duke.edu/~jes12




More information about the Bioperl-l mailing list