Tuesday, March 31, 2015

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 = "Your.Name.Here@example.org"
handle = Entrez.espell(term="cance")
record = Entrez.read(handle)
print("Query:",record["Query"])
print("Corrected Query:",record["CorrectedQuery"])

#Query: cance
#Corrected Query: cancer

No comments:

Post a Comment