Skip to content

Instantly share code, notes, and snippets.

@eric-czech
Created May 11, 2021 11:06
Show Gist options
  • Save eric-czech/bf6510a86e98e2ce1a2229dbc8643048 to your computer and use it in GitHub Desktop.
Save eric-czech/bf6510a86e98e2ce1a2229dbc8643048 to your computer and use it in GitHub Desktop.
Search EFO OLS using disease query
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