Question: Entrez esearch term format
1
gravatar for smiller
20 months ago by
smiller60
United States
smiller60 wrote:

I'm using biopython to perform an Entrez esearch of the NCBI taxonomy database. The term is the exact string as it appears in the database.

Entrez.read(Entrez.esearch(db='Taxonomy', term="Cupriavidus sp. HPC(L)"))

returns

{'QueryTranslation': 'Cupriavidus sp. HPC[All Names] AND (L[All Names])', 'IdList': [], 'Count': '0', 'RetStart': '0', 'ErrorList': {'FieldNotFound': [], 'PhraseNotFound': ['Cupriavidus', 'sp.', 'HPC', 'L']}, 'RetMax': '0', 'TranslationSet': [], 'WarningList': {'PhraseIgnored': [], 'QuotedPhraseNotFound': [], 'OutputMessage': ['No items found.']}}

This should return information on TaxID 1217418.

Thanks in advance.

ADD COMMENTlink modified 20 months ago • written 20 months ago by smiller60

I can replicate this empty results using NCBI commandline utils, it'd be interesting to find out how to tackle this.

esearch -db taxonomy -query "Cupriavidus sp HPC(L)"
ADD REPLYlink written 20 months ago by Sej Modha4.1k
2
gravatar for smiller
20 months ago by
smiller60
United States
smiller60 wrote:

SIMPLE AND OBVIOUS SOLUTION:

Enclose the search term in double quotes to make it literal.

Entrez.read(Entrez.esearch(db='Taxonomy', term="\"Cupriavidus sp. HPC(L)\""))

correctly returns

{'RetStart': '0', 'TranslationStack': [{'Count': '1', 'Field': 'All Names', 'Term': '"Cupriavidus sp. HPC(L)"[All Names]', 'Explode': 'N'}, 'GROUP'], 'IdList': ['1217418'], 'TranslationSet': [], 'Count': '1', 'RetMax': '1', 'QueryTranslation': '"Cupriavidus sp. HPC(L)"[All Names]'}

ADD COMMENTlink written 20 months ago by smiller60
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 875 users visited in the last hour