[BioPython] Anybody have an idea why
Andrew Dalke
dalke@acm.org
Fri, 20 Apr 2001 04:10:25 -0600
Gary Greyling asked why he gets
> the following output from using NCBIStandalone.blastall ??
>
> Code Sniped:
>
> BLASTBIN = "/usr/local/bin/blast"
> BLASTDB = "/usr/local/db/genome/chr19/hs_chr19.fa"
>
> blastOutput, errorInfo = NCBIStandalone.blastall(BLASTBIN + "/blastall",
> 'blastn', BLASTDB, "temp/%s.fasta"% fasta.Accession)
>
> Result:
>
> <Bio.File.UndoHandle instance at 81121f8>
Internally the parser uses a "UndoHandle" to make it easier to figure
out what's going on in the file. What you are seeing is the Python
representation of one of those objects.
There are two ways to get that sort of output:
1) there is a statement somewhere in the code like
print uhandle
-or-
sys.stdout.write(repr(uhandle))
2) you are in interactive mode and the result of an expression
was an UndoHandle, so the interactive mode of Python automatically
prints the repr() of the object.
I scanned through the Blast parser code and couldn't find anywhere
there or in related files (like ParserSupport) which could do the
first case, so I'm going to conjecture the second.
However, you example code does not allow that case. The call to
'blastall' returns two UndoHandle objects, blastOutput and errorInfo.
Because these are assigned to values, there is no expression (assignment
in Python is not an expression) so it isn't printed to the screen.
Perhaps you are omitting something in your snip?
And of course if you really, REALLY wanted to know what was
going on, you could use the standard debugger, or get one of the
available IDEs with integrated debuggers, like archaeopteryx.com's,
which I've been meaning to evaluate.
Andrew
dalke@acm.org