Created
May 11, 2021 11:06
-
-
Save eric-czech/bf6510a86e98e2ce1a2229dbc8643048 to your computer and use it in GitHub Desktop.
Search EFO OLS using disease query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def search_efo(disease): | |
import requests | |
from urllib.parse import quote_plus | |
res = requests.get(f"https://www.ebi.ac.uk/ols/api/select?q={quote_plus(disease)}&ontology=efo") | |
res = res.json() | |
docs = res['response']['docs'] | |
if len(docs) == 0: | |
return None | |
return docs[0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment