[BioPython] Biopython and Quixote preventing use of Bio.GenBank.NCBIDictionary

Jonathan Taylor jonathan.taylor at utoronto.ca
Fri Nov 19 19:39:59 EST 2004


Hi,

I am using quixote, a web application server, to develop a web based
application.

I have a genbank id that I want to get the taxonomical description of. 
I can do this easily via my util.py script from the command line.  When
I it from inside my web application I get the error below.

Any help is greatly appreciated.

Thanks Jon.

Traceback (most recent call last):
  File "/usr/lib/python2.3/site-packages/quixote/publish.py", line 522, in process_request
    output = self.try_publish(request, env.get('PATH_INFO', ''))
  File "/usr/lib/python2.3/site-packages/quixote/publish.py", line 457, in try_publish
    output = object(request)
  File "/home/jtaylor/projects/fungid/fungid/web/input.ptl", line 93, in _q_index
    return form.action(request, 'Submit', values)
  File "/home/jtaylor/projects/fungid/fungid/web/input.ptl", line 67, in action
    seq = blast.add_sequence(record)
  File "/home/jtaylor/projects/fungid/fungid/lib/blast.py", line 100, in add_sequence
    name = util.lookup_name_from_gi(gi)
  File "/home/jtaylor/projects/fungid/fungid/lib/util.py", line 8, in lookup_name_from_gi
    ncbi_dict = GenBank.NCBIDictionary('nucleotide', 'genbank', parser = feature_parser)
  File "/home/jtaylor/lib/python/Bio/GenBank/__init__.py", line 1320, in __init__
    self.db = db["nucleotide-genbank-eutils"]
  File "/home/jtaylor/lib/python/Bio/config/Registry.py", line 93, in __getitem__
    return self._name_table[name]  # raises KeyError for unknown entries
KeyError: 'nucleotide-genbank-eutils'


Here is util.py:

from Bio import GenBank

def lookup_name_from_gi(gi):

  feature_parser = GenBank.RecordParser()
  ncbi_dict = GenBank.NCBIDictionary('nucleotide', 'genbank', parser =
feature_parser)

  record = ncbi_dict[str(gi)]

  # may want to use the taxonomy list to help here
  return record.source

if __name__ == '__main__':
  print lookup_name_from_gi(47499221)





More information about the BioPython mailing list