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.
1 answer
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]'}
Log in to answer this question.
I can replicate this empty results using NCBI commandline utils, it'd be interesting to find out how to tackle this.