Skip to content

Instantly share code, notes, and snippets.

@eric-czech
Created January 20, 2021 20:31
Show Gist options
  • Save eric-czech/e9334f5caf5c65c8e39cebe6fde6faa2 to your computer and use it in GitHub Desktop.
Save eric-czech/e9334f5caf5c65c8e39cebe6fde6faa2 to your computer and use it in GitHub Desktop.
OLS term search function
def get_ols(term):
import requests
url = 'http://www.ebi.ac.uk/ols/api/ontologies/efo/terms?obo_id=' + term
res = requests.get(url)
terms = res.json()['_embedded']['terms']
assert len(terms) == 1
return terms[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment