[Biopython] How to efetch Unigene records? Is it possible at all?

Matthew Strand stran104 at chapman.edu
Tue Aug 4 21:10:44 EDT 2009


I played with this a bit more and Brad is right, the Unigene database is not
supported through Entrez efetch. The ID returned by esearch is in fact the
GI and other types of records can be retreived with it (e.g. gene).

A list of supported databases and returntypes can be found at:
http://www.ncbi.nlm.nih.gov/corehtml/query/static/efetchseq_help.html

As Brad already suggested, downloading the files would work and it would be
fast to process locally as well.

Good luck  :-)


On Mon, Aug 3, 2009 at 12:07 PM, Carlos Javier Borroto <
carlos.borroto at gmail.com> wrote:

> On Thu, Jul 30, 2009 at 8:10 PM, Matthew Strand<stran104 at chapman.edu>
> wrote:
> > Hi Carlos,
> > I did something similar to this a while ago and meant to write a cookbook
> > entry for it but haven't gotten the chance yet. You could also try doing
> an
> > efetch on the ID of the record returned by esearch.
> >
> > I'm not near my workstation so I can't test it but you might try:
> > handle = Entrez.efetch(db="unigene", id="141673")
> >
> > If that works then you just need to pull the ID out of the esearch result
> > and do an efetch on it.
> >
>
> I tried that too, but no luck on my side:
>
> >>> from Bio import Entrez
> >>> from Bio import UniGene
> >>> Entrez.email = "carlos.borroto at gmail.com"
> >>> handle = Entrez.esearch(db="unigene", term="Hs.94542")
> >>> record = Entrez.read(handle)
> >>> record
> {u'Count': '1', u'RetMax': '1', u'IdList': ['141673'],
> u'TranslationStack': [{u'Count': '1', u'Field': 'All Fields', u'Term':
> 'Hs.94542[All Fields]', u'Explode': 'Y'}, 'GROUP'], u'TranslationSet':
> [], u'RetStart': '0', u'QueryTranslation': 'Hs.94542[All Fields]'}
> >>> record["IdList"][0]
> '141673'
> >>> handle = Entrez.efetch(db="unigene", id=record["IdList"][0])
> >>> print handle.read()
> (Output a HTML web page)
>
> regards,
> --
> Carlos Javier
>



-- 
Matthew Strand


More information about the Biopython mailing list