bpy20. Using espell EUtil in Biopython

We can use Bio.Entrez.espell to find correct spelling for a term. The default database is Pubmed.

In the dictionary returned by Entrez.read(), there are 2 keys. The search term has the key of “Query” and the corrected term has the key “CorrectedQuery”.


# bpy20.py
from __future__ import print_function, division
from Bio import Entrez
Entrez.email = "[email protected]"
handle = Entrez.espell(term="cance")
record = Entrez.read(handle)
print("Query:",record["Query"])
print("Corrected Query:",record["CorrectedQuery"])

#Query: cance
#Corrected Query: cancer

Leave a Reply

Your email address will not be published. Required fields are marked *