[BioPython] New User problem with GenBank

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


I should have mentioned that this is a new install of biopython 1.21 and 
Martel. I am running Debian Stable (Woody), and python2.2.

Cheers,

JP


JP Glutting wrote:
> 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
> 





More information about the BioPython mailing list