[Biopython] ncbi entrez eutils

Vikram K kpguy1975 at gmail.com
Thu Dec 30 17:22:31 UTC 2010


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', '71390237',
'71390236', '297381040', '297381039', '297381038', '297381037', '297381036',
'297381035', '284178681'], u'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'], u'TranslationSet': [{u'To': '"Opuntia"[Organism] OR
Opuntia[All Fields]', u'From': 'Opuntia'}], u'RetStart': '0',
u'QueryTranslation': '"Opuntia"[Organism] OR Opuntia[All Fields]'}
>>> 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"]. What information  is
record["Count"]--the value 427-- giving?

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

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

Thanks.
Vikram



More information about the Biopython mailing list