[BioPython] New User problem with GenBank

JP Glutting jpg at research.dfci.harvard.edu
Wed Sep 10 13:19:13 EDT 2003


I am having some trouble with a script that I wrote to retrieve GenBank 
data.

If I run this (I am just inserting a known GI [33413925]) for a protein 
I ran this on a few months ago:

 >>> from Bio import GenBank
 >>> gi = 33413925
 >>> record_parser = GenBank.FeatureParser()
 >>> ncbi_dict = GenBank.NCBIDictionary(database="Protein")
 >>> ncbi_parse_dict = GenBank.NCBIDictionary(database="Protein", 
parser=record_parser)
 >>> gb_record = ncbi_dict[gi]
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.2/site-packages/Bio/GenBank/__init__.py", line 
1538, in __getitem__
     raise KeyError, x
KeyError: ERROR, possibly because id not available?

Any idea why this happens, and if there is a work-around?

Thanks,

JP

Peter Bienstman wrote:
> FYI, I've confirmed that the parsing errors don't occur with the current CVS 
> version, so the fix should be in the upcoming new release.
> 
> Cheers,
> 
> Peter





More information about the BioPython mailing list