[Biopython] Problems parsing with PSIBlastParser

Peter biopython at maubp.freeserve.co.uk
Tue Oct 13 07:10:06 EDT 2009


On Mon, Oct 12, 2009 at 9:11 AM, Miguel Ortiz Lombardia
<ibdeno at gmail.com> wrote:
> Dear list members,
>
> I have a problem with NCBIStandalone.PSIBlastParser, which I need to use
> instead of NCBIXML since the latter one lacks some record properties that I
> need.
>
> My code used to work until recently (say three months) and now it seems
> something has changed in the latest biopython (1.52-1, I install it on an
> intel OSX 10.5.8 via fink). I get the same problem irrespectively of whether
> I use python 2.5 or 2.6.

Thanks for filing the bug, and supplying the example output files.
http://bugzilla.open-bio.org/show_bug.cgi?id=2927

Do you remember what version of Biopython you used to be running
before updating to 1.52? This would help to narrow down the change
triggering this problem.

In the mean time, I have tried parsing your sample output, and it seems fine:

from Bio.Blast.NCBIStandalone import PSIBlastParser
b_parser = PSIBlastParser()
handle = open("Q3V4Q0.psiblast.txt")
b_record = b_parser.parse(handle)
handle.close()
for b_round in b_record.rounds :
    print "Round %i has %i alignments" \
          % (b_round.number, len(b_round.alignments))


Gives:

Round 1 has 385 alignments
Round 2 has 1000 alignments
Round 3 has 1000 alignments
Round 4 has 1000 alignments
Round 5 has 1000 alignments

So, if the file parser is fine, then my guess is this is something to do with
how we are running PSI-BLAST via NCBIStandalone.blastpgp - and this
code has changed in recent releases. It used to use the python function
os.popen3 but this was deprecated in Python 2.6 and we now use the
subprocess library.

It is also possible that the command line options you used when running
BLAST by hand to supply me the example output differed from what
was used in your Python script.

What exactly did you type at the command line to make the example
output you sent me? I'd like to double check the Python code is using
the same thing...

Peter


More information about the Biopython mailing list