[Biopython-dev] [Bug 2481] New: bitscore not parsed.

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Fri Apr 4 00:00:56 UTC 2008


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

           Summary: bitscore not parsed.
           Product: Biopython
           Version: 1.45
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: sbassi at gmail.com


>>> from Bio.Blast import NCBIXML
>>> fr=NCBIXML.parse(open('/media/disk/GENES/INTA9/BLAST/seqspMOS.xml')).next()
>>> fr.descriptions[0].title
u'gnl|BL_ORD_ID|0 pMOS (vector para mt INTA)'
>>> fr.descriptions[0].bits
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: Description instance has no attribute 'bits'

To fix this, two files must be modified:

NCBIXML.py
and
Record.py

In NCBIXML.py, 2 changes:
Line 94 : "method = self._secure_name('_end_' + name.replace("-","_"))" #name
in the xml file is "bit-score" and the function should be named like this but
can only be named "_end_Hsp_bit_score" hence change from - to _ resolve the
issue and should not disturb the rest, this method could/should be also applied
line 63 for StartElement
Lines 409-410 uncommented

In Record.py:
Add "self.bits = None"  # in line 68

This bug was reported to me by Yoan Jacquemin when testing my code to convert
BLAST XML output to HTML.
After applying this modifications, it works:

>>> from Bio.Blast import NCBIXML
>>> f_in='/mnt/hda2/bio/3vsT.xml'
>>> fr=NCBIXML.parse(open(f_in)).next()
>>> fr.descriptions[0].bits
32.210500000000003


-- 
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