[BioPython] problem with GenBank.NCBIDictionary ?

Jeffrey Chang jchang@smi.stanford.edu
Wed, 15 May 2002 10:18:57 -0700


It looks like GenBank is expecting to get genbank ID's rather than
accession numbers.  Using your code, if I look for the ID:
    gb_rec = gb_dict['1617401']
I get the gene back with accession X98475.

I'll have to look more closely into retrieving by accession number.

Jeff



On Wed, May 15, 2002 at 11:02:24AM +0200, Catherine Letondal wrote:
> 
> Hi,
> 
> I get an error when trying to use GenBank.NCBIDictionary:
> 
> from Bio import GenBank
> gb_dict = GenBank.NCBIDictionary(parser=GenBank.RecordParser())
> gb_rec = gb_dict['X98475']
> 
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/local/lib/python2.2/site-packages/Bio/GenBank/__init__.py", line 1552, in __getitem__
>     raise KeyError, "I unexpectedly got back html-formatted data."
> KeyError: I unexpectedly got back html-formatted data.
> 
> Is my code incorrect?
> 
> I have manually tried to open an NCBI query:
> from Bio.WWW import NCBI
> query=NCBI.query('Text', 'Nucleotide', opt='GenBank', uid='X98475')
> 
> ...and what I get is the following:
> http://www-alt.pasteur.fr/~letondal/tmp/ncbi_result.html
> Error handling request: NStr::StringToInt(): cannot convert
> 
> Can someone explain??
> 
> Thanks!
> 
> -- 
> Catherine Letondal -- Pasteur Institute Computing Center
> _______________________________________________
> BioPython mailing list  -  BioPython@biopython.org
> http://biopython.org/mailman/listinfo/biopython