Fix for either a bug or undocumented feature in ElementTree that broke megablast and blast+ XML parsing in Python 2.7.

This commit is contained in:
Nate Coraor
2011-06-09 11:22:23 -04:00
parent 478470e8b0
commit b77ec95d0b
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ def __main__():
query = elem.findtext( "Iteration_query-def" )
qLen = elem.findtext( "Iteration_query-len" )
# for every <Hit> within <Iteration>
for hit in elem.findall( "Iteration_hits/Hit/" ):
for hit in elem.findall( "Iteration_hits/Hit" ):
subject = hit.findtext( "Hit_id" )
if re.search( '^gi', subject ):
subject = subject.split('|')[1]
+1 -1
View File
@@ -138,7 +138,7 @@ for event, elem in context:
qlen = int(elem.findtext("Iteration_query-len"))
# for every <Hit> within <Iteration>
for hit in elem.findall("Iteration_hits/Hit/"):
for hit in elem.findall("Iteration_hits/Hit"):
#Expecting either this,
# <Hit_id>gi|3024260|sp|P56514.1|OPSD_BUFBU</Hit_id>
# <Hit_def>RecName: Full=Rhodopsin</Hit_def>