[BioPython] downloading Genbank files continued

Ashleigh Smythe absmythe at ucdavis.edu
Wed Apr 30 10:51:28 EDT 2003


Thanks for the comments.  To clarify further...

1.  I have downloaded sequences via the NCBI web interface for the 
past few years but I'm doing bigger sets of taxa now and trying to 
learn python/biopython so that's why I'm trying to learn this route 
rather than my old web route.

2.  I am trying to download gene sequences, not proteins.

3.  As for the code I'm using I'm following the Genbank part of the 
online tutorial from Bioinformatics.org, just trying it with a genus 
that I know only has a few records:

>>>From Bio import GenBank

>>>gi_list=GenBank.search_for("Cervidellus")

Then to make sure I got something I do

>>>print gi_list
['16269590' , '6983954']

Then I create a dictionary

>>>ncbi_dict=GenBank.NCBIDictionary()

Then to fetch the records corresponding to my gi's

>>>gb_record=ncbi_dict[gi_list]

This chugs along fine, indicating what year it is searching, starting 
in 2003, and then when it hits one of my records it gives me:

File ".../GenBank/__init__.py", line 1560, in __getitem__ raise 
KeyError, "I unexpectedly got back html-formatted data."

4.  This has failed each time for me but I've only tried a few taxa - 
maybe I should try more.


I hope this clears things up a bit so maye someone can see what is going on.

Thanks again for the help!

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


More information about the BioPython mailing list