[Bioperl-l] Modifying BPlite
Peter Schattner
schattner@alum.mit.edu
Fri, 02 Mar 2001 17:41:10 -0800
"Mark, Terry" wrote:
> I figured I would have to do something like this because of the way BPlite
> works, i.e. it only reads in hits on calls to nextSbjct, instead of reading
> all the hits into memory at once a la Blast.pm (presumably this is one of
> the things that makes it 'lite' ?). I also wanted to be able to get the db
> length statistics without having to always invoke nextSbjct to completion.
>
> However, I realized that calling 'tell' would NOT work if a script was
> called in a pipe, since these obviously provide no file position and no way
> to seek backwards.
>
> So I guess I am not sure what the best approach is, and wondered what the
> group thought of the problem.
>
> Any suggestions ?
You may want to look at the code for "BPpsilite" which parses psiblast
reports.
Since parsing psiblast reports requires looking at the end of the file
before you read in the "NextSbjct", BPpsiblast basically performs a
two-pass parse. It reads in the entire report line-by-line and writes
each line to a temporary file. Then with the information gathered from
the end of the file, it can reparse the file by reading it from the
temporary file.
I think this approach might meet your needs, in which case copying &
modifying some code from BPpsilite should be pretty easy.
Just a thought...
Peter Schattner