[BioPython] New User problem with GenBank
Jeffrey Chang
jchang at jeffchang.com
Wed Sep 10 13:41:59 EDT 2003
Try doing:
>>> ncbi_dict = GenBank.NCBIDictionary(database="Protein", format="gp")
The code that chooses the proper format for the database needs to be
fixed...
Jeff
On Wednesday, September 10, 2003, at 10:19 AM, 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
>
> 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
>
>
>
> _______________________________________________
> BioPython mailing list - BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython
More information about the BioPython
mailing list