[Biopython] Entrez.efetch from gene

Michael Fahy fahy at chapman.edu
Wed Jan 26 01:34:50 UTC 2011


Trying to use Entrez.efetch() to query the gene database.

The efetch help at
http://www.ncbi.nlm.nih.gov/entrez/query/static/efetchseq_help.html says
there are no retrieval types supported by the gene database.  If I do an
efetch query without specifying a value for rettype, it returns html.  Is
there a way in Biopython to parse this html?  Or is there another way to
query the gene database so it will return data that can be parsed?

Sample code:

from Bio import Entrez
Entrez.email = 'email at chapman.edu'

search_database = 'gene'
search_term = 'YIL065C'

handle = Entrez.esearch(db='gene',term=search_term)
record = Entrez.read(handle)
reclist = record['IdList']  

handle = Entrez.efetch(db=search_database,  id =reclist[0])

myrecord = handle.read()
print myrecord

----------------------------------------------------------
Michael A. Fahy
fahy at chapman.edu





More information about the Biopython mailing list