Entrez esearch term format
1
1
Entering edit mode
7.4 years ago
smiller ▴ 70

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.

Entrez esearch NCBI biopython taxonomy • 2.8k views
ADD COMMENT
0
Entering edit mode

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 REPLY
2
Entering edit mode
7.4 years ago
smiller ▴ 70

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 COMMENT

Login before adding your answer.

Traffic: 3747 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6