[BioPython] Parsing and Creating Dictionaries of GenBank files

Pepe Barbe elventear at gmail.com
Thu Apr 20 01:02:30 UTC 2006


Hello,

Following the simple steps in the BioPython cookbook, I wanted to
create a dictionary with the following GenBank file:

ftp://ftp.ncbi.nlm.nih.gov/genomes/Bacteria/Escherichia_coli_K12/NC_000913.gbk

Below you can find what I tried executing and the error I got. I would
appreciate any insight into solving the error and correctly producing
the dictionary.

Thanks!
Pepe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>> dict_file = 'NC_000913.gbk'
>>> index_file = 'NC_000913.idx'
>>> from Bio import GenBank
>>> GenBank.index_file(dict_file, index_file)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/sw/lib/python2.4/site-packages/Bio/GenBank/__init__.py", line
1283, in index_file
    SimpleSeqRecord.create_flatdb([filename], indexname, indexer)
  File "/sw/lib/python2.4/site-packages/Bio/Mindy/SimpleSeqRecord.py",
line 152, in create_flatdb
    creator.load(filename, builder = builder, fileid_info = {})
  File "/sw/lib/python2.4/site-packages/Bio/Mindy/BaseDB.py", line 36, in load
    raise TypeError("Cannot identify file as a %s format" %
TypeError: Cannot identify file as a unknown format




More information about the Biopython mailing list