[Biopython-dev] [Bug 2393] New: Bio.GenBank.NCBIDictionary fails with release 1.44

bugzilla-daemon at portal.open-bio.org bugzilla-daemon at portal.open-bio.org
Thu Nov 8 12:34:07 UTC 2007


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

           Summary: Bio.GenBank.NCBIDictionary fails with release 1.44
           Product: Biopython
           Version: 1.44
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Main Distribution
        AssignedTo: biopython-dev at biopython.org
        ReportedBy: mdehoon at ims.u-tokyo.ac.jp


In Biopython release 1.44, some magic code in Bio/__init__.py was removed. This
causes Bio.GenBank.NCBIDictionary to fail, since Bio.db is no longer known. See
this message from Eric Gibert on the mailing list:

http://lists.open-bio.org/pipermail/biopython/2007-November/003876.html

This code example shows the error:

>>> from Bio.GenBank import NCBIDictionary
>>> d = NCBIDictionary("nucleotide","genbank")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/Bio/GenBank/__init__.py", line 1283,
in
 __init__
    from Bio import db
ImportError: cannot import name db
>>>


The attached patch is a first attempt to resurrect the NCBIDictionary
functionality, using NCBI's EUtils directly instead of going though Bio.db. One
important difference is that __getitem__ now returns a handle instead of the
record contents. NCBIDictionary can then be used as follows:

>>> from Bio.GenBank import NCBIDictionary
>>> d = NCBIDictionary("nucleotide","genbank")
>>> handle = d['57282195']
>>> from Bio import SeqIO
>>> record = SeqIO.parse(handle, "genbank").next()


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