[BioPython] retrieving GenBank files

Jeffrey Chang jchang at jeffchang.com
Wed May 7 18:53:38 EDT 2003


Hi Ravinder,

Yes, the parameters for the NCBI EUtils script that the NCBIDictionary  
uses seems to have changed.  The work-around is to explicitly pass a  
parameter to the NCBIDictionary that specifies the database.  For  
nucleotide queries, do:
ncbi_dict=GenBank.NCBIDictionary(database="nucleotide")

More information is available at:
http://www.biopython.org/pipermail/biopython/2003-May/001279.html

Please let me know if this does not solve the problem.

Jeff




On Wednesday, May 7, 2003, at 03:03  PM, Ravinder Singh wrote:

> Hi,
> Using this code to retireve a genbank file, I'm getting the following  
> error. Any idea why is it not working? Of course, we would like to  
> download a list of genbank files.
> -------
> from Bio import GenBank
> gi_list = ['AE002603']
> ncbi_dict = GenBank.NCBIDictionary()
> gb_record = ncbi_dict[gi_list[0]]
> print gb_record # or write to afiel
> ---------
>
> (beagle)[3:52pm]>>python retrieve_gb.py
> Traceback (most recent call last):
>   File "retrieve_gb.py", line 6, in ?
>     gb_record = ncbi_dict[gi_list[0]]
>   File  
> "/usr4/singh-lab/rsingh/local/lib/python/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.
>
> --  
> *********************************************************************** 
> *********
> Dr. Ravinder Singh
> Assistant Professor
> MCD Biology
> 347 UCB
> University of Colorado
> Boulder, CO 80309-0347
>
> (303)492-8886 (voice)
> (303)492-7744 (fax)
>
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython




More information about the BioPython mailing list