[Biopython] ncbi entrez eutils

Peter biopython at maubp.freeserve.co.uk
Thu Dec 30 18:29:33 UTC 2010


On Thu, Dec 30, 2010 at 5:22 PM, Vikram K wrote:
> have been investigating the ncbi entrez eutils feature. Consider the
> esearch eutils. i typed this on my python shell:
>
>>>> from Bio import Entrez
>>>> handle = Entrez.esearch(db="nucleotide", retmax=10, term="Opuntia")
>
>>>> record = Entrez.read(handle)
>
>>>> print record["Count"]
> 427
>>>> print record["IdList"]
> ['186461630', '71390237', '71390236', '297381040', '297381039', '297381038',
> '297381037', '297381036', '297381035', '284178681']
>>>> print record
> {u'Count': '427', u'RetMax': '10', u'IdList': ['186461630',... }
>>>> print record ["TranslationStack"]
> [{u'Count': '204', u'Field': 'Organism', u'Term': '"Opuntia"[Organism]',
> u'Explode': 'Y'}, {u'Count': '427', u'Field': 'All Fields', u'Term':
> 'Opuntia[All Fields]', u'Explode': 'Y'}, 'OR', 'GROUP']
>>>>
>
> When i go to NCBI Entrez Nucleotide and type Opuntia in the search space i
> get a list of 427 entries. The first 10 of these have gi numbers
> corresponding to the numbers given by record["IDList"].

That sounds as expected. Using the webpage and using the
API via Biopython should give the same results.

>
> What information  is record["Count"]--the value 427-- giving?
>

The number of records matching your search was 427 (however
you used retmax to only get the first 10).


>
> Also, what is the count value 204 which shows up when you output
> record["TranslationStack"]?
>

I don't know - I've never looked at it.

>
> Finally, is it correct to say that NCBI eutils are all APIs?
> Further, should Biopython also be considered as an API?
>

Yes, i think both could be regarded as APIs.

Peter




More information about the Biopython mailing list