[BioPython] downloading Genbank files from NCBI

Peter Wilkinson pwilk at videotron.ca
Wed Apr 30 02:30:29 EDT 2003


Ashleigh,

well, you can go to NCBI, and go to the taxonomy web page, and search for 
the taxa you want, and download all the relevant files you need, all this 
within NCBI's web interface.

Could you post the code you have written? The only thought I have for the 
moment is that the files you have retrieved are in html format, unless 
something funny has gone on with the parser.
With my use of the Genbank parser, I have not had this problem (yet).

Peter W.



At 06:28 PM 29/04/2003 -0700, Ashleigh Smythe wrote:
>Hello.  I've been learning to use python and biopython for a few months 
>now but am also new to programming/Linux in general so please forgive me 
>for being slow!
>
>I want to use biopython to download files of certain taxa and certain 
>genes from Genbank.  I've been following the tutorial on the biopython 
>website. I can use the search_for attribute from the GenBank module to get 
>identifiers for sequence records but when I try to use 
>GenBank.NCBIDictionary() to actually get the records it chugs along fine 
>until it finds the record and then I get an error that says:
>
>File ".../GenBank/__init__.py", line 1560, in __getitem__ raise KeyError, 
>"I unexpectedly got back html-formatted data."
>
>I don't know to fix the NCBIDictionary code to fix this.  I have been 
>trying various other ways in general to extract the records I want from 
>Genbank, such as parsing the big flat files but I haven't yet figured out 
>how to extract the records I want.
>
>Any suggestions as to how to fix the NCBIDictionary problem or how to do 
>what I want to do in some other way would be greatly appreciated.
>
>Thanks!
>Ashleigh
>***************************
>Ashleigh B. Smythe
>Graduate Research Assistant
>Department of Nematology
>UC Davis
>One Shield's Ave.
>Davis, CA 95616
>(530)754-4321
>absmythe at ucdavis.edu
>_______________________________________________
>BioPython mailing list  -  BioPython at biopython.org
>http://biopython.org/mailman/listinfo/biopython


-------------------------------------
Peter Wilkinson
Bioinformatics Consultant

-------------------------------------  




More information about the BioPython mailing list