[Biopython] Entrez.efetch from gene

Michiel de Hoon mjldehoon at yahoo.com
Wed Jan 26 10:29:25 UTC 2011


Did you try retmode instead of rettype? Probably retmode='xml' will give you output in the XML format, which can then be parsed by Bio.Entrez.

--Michiel

--- On Tue, 1/25/11, Michael Fahy <fahy at chapman.edu> wrote:

> From: Michael Fahy <fahy at chapman.edu>
> Subject: [Biopython] Entrez.efetch from gene
> To: Biopython at lists.open-bio.org
> Date: Tuesday, January 25, 2011, 8:34 PM
> 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
> 
> 
> _______________________________________________
> Biopython mailing list  -  Biopython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
> 


      




More information about the Biopython mailing list