Created
January 20, 2021 20:31
-
-
Save eric-czech/e9334f5caf5c65c8e39cebe6fde6faa2 to your computer and use it in GitHub Desktop.
OLS term search function
This file contains hidden or 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 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