[BioPython] BLAST XML parser trouble
Michiel De Hoon
mdehoon at c2b2.columbia.edu
Tue Oct 9 02:55:21 UTC 2007
How did you produce the XML file? In particular, which Blast version did you
use?
The Blast XML parser trips over the following line in your XML file:
<BlastOutput_version>unspecified</BlastOutput_version>
This is supposed to be:
<BlastOutput_version>BLASTP 2.2.12 [Aug-07-2005]</BlastOutput_version>
, of course depending on which Blast version you are using.
--Michiel
Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1150 St Nicholas Avenue
New York, NY 10032
-----Original Message-----
From: biopython-bounces at lists.open-bio.org on behalf of B. Brazelton
Sent: Mon 10/8/2007 8:33 PM
To: biopython at biopython.org
Subject: [BioPython] BLAST XML parser trouble
I tried to follow the BLAST XML parser example in the tutorial, but I
always get the following error when attempting to iterate through the
records:
Traceback (most recent call last):
File "BlastXML_Parser.py", line 10, in ?
for blast_record in blast_records:
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-
packages/Bio/Blast/NCBIXML.py",
line 572, in parse
expat_parser.Parse(text, False)
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-
packages/Bio/Blast/NCBIXML.py",
line 98, in endElement
eval("self.%s()" % method)
File "<string>", line 0, in ?
File
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-
packages/Bio/Blast/NCBIXML.py",
line 215, in _end_BlastOutput_version
self._header.version = self._value.split()[1]
IndexError: list index out of range
All I did was:
result_handle = open('NifH_Blast.xml')
from Bio.Blast import NCBIXML
blast_records = NCBIXML.parse(result_handle)
for blast_record in blast_records:
... etc
I put my script and xml file here:
http://www.staff.washington.edu/braz/files
I'm using biopython 1.43, and I get the same error on both Python
2.3.5 and Python 5.
It seems like my commands are exactly what is in the tutorial, so I'm
confused. My best guess is that there is a difference in the XML
format, but it's NCBI XML. Thanks for any help,
Bill Brazelton
_______________________________________________
BioPython mailing list - BioPython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython
More information about the Biopython
mailing list