Re: [BioPython] blastall does not flush buffers due to biopython buffering?
Michiel de Hoon <mjldehoon <at> yahoo.com>
2008-05-12 02:11:39 GMT
Can you show an example script that causes the UndoHandle to block? Just to understand better what is going on.
On a related note, the UndoHandle works by saving all lines that were read. Particularly for large Blast
files, that is not what one would like to do. So if there is no strong reason for returning a UndoHandle, I'd
be in favor of simply returning the handle directly.
Martin MOKREJÅ <mmokrejs <at> ribosome.natur.cuni.cz> wrote: Hi,
when I try to use Bio/Blast/NCBIStandalone blast sometimes the process hangs
and sometimes it works (tested from Unix shell and via Apache mod_python).
I see blastall process in the list of system processes, attaching strace(1)
to it shows that it did print some line from the result output, but somewhat
does not continue to write out the buffers (you know that at the end of blast
output is the summary stats ...;). I believe that is because the consuming
process did not read yet the output already written. Effectively, blastall
gets blocked due to biopython.
I see in the stacktrace of a killed process:
File "/usr/lib/python2.5/site-packages/Bio/File.py", line 37, in readlines
lines = self._saved + self._handle.readlines(*args,**keywds)
Currently, there is in CVS:
def blastall(blastcmd, program, database, infile, align_view='7', **keywds):
"""blastall(blastcmd, program, database, infile, align_view='7', **keywds)
-> read, error Undohandles