[Biopython-dev] [Bug 2499] New: Bio.Blast.NCBIXML cannot handle XML without date in BlastOutput_version

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Mon May 12 18:40:34 UTC 2008


http://bugzilla.open-bio.org/show_bug.cgi?id=2499

           Summary: Bio.Blast.NCBIXML cannot handle XML without date in
                    BlastOutput_version
           Product: Biopython
           Version: 1.44
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: n.j.loman at bham.ac.uk


I got the following XML file directly from the NCBI website.

<BlastOutput>
  <BlastOutput_program>blastp</BlastOutput_program>
  <BlastOutput_version>BLASTP 2.2.18+</BlastOutput_version>
  <BlastOutput_reference>Altschul, Stephen F., Thomas L. Madden, Alejandro A.
Schäffer, Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman
(1997), &quot;Gapped BLAST and PSI-BLAST: a new generation of protein database
search programs&quot;, Nucleic Acids Res. 25:3389-3402.</BlastOutput_reference>
  <BlastOutput_db>env_nr</BlastOutput_db>
...

This output raises an exception when put through NCBIXML.parse() due to the
absence of a date after the string BLASTP 2.2.18+

The following diff sorts it out:

--- /home/nick/biopython/biopython-1.44/Bio/Blast/NCBIXML.py    2007-07-27
21:34:07.000000000 +0100
+++ NCBIXML.py  2008-05-12 18:01:36.000000000 +0100
@@ -212,8 +212,10 @@

         Save this to put on each blast record object
         """
-        self._header.version = self._value.split()[1]
-        self._header.date = self._value.split()[2][1:-1]
+        s = self._value.split()
+        self._header.version = s[1]
+        if len(s) > 2:
+           self._header.date = s[2][1:-1]

     def _end_BlastOutput_reference(self):
         """a reference to the article describing the algorithm

I'm sorry, I haven't checked to see if this is fixed in 1.45.


-- 
Configure bugmail: http://bugzilla.open-bio.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the Biopython-dev mailing list