a framework querying ontology terms
Project description
ontquery
a framework querying ontology terms
SciCrunch api key
If you don't have your own SciGraph instance you will need a SciCunch API key in order to run the demos (e.g. python __init__.py
).
To do this go to SciCrunch and register for an account and then get an api key.
You can then set the SCICRUNCH_API_KEY
environment variable.
For example in bash export SCICRUNCH_API_KEY=my-api-key
.
See https://github.com/tgbugs/ontquery/blob/db8cad7463704bce9010651c3744452aa5370114/ontquery/__init__.py#L557-L558 for how to pass the key in.
Usage
from ontquery import OntQuery, SciGraphRemote, OntTerm, OntCuries
import os
from pyontutils.core import PREFIXES as uPREFIXES
curies = OntCuries(uPREFIXES)
api_key = os.environ['SCICRUNCH_API_KEY']
query = OntQuery(SciGraphRemote(api_key=api_key))
OntTerm.query = query
query('mouse')
3 potential matches are shown:
Query {'term': 'mouse', 'limit': 10} returned more than one result. Please review.
OntTerm('NCBITaxon:10090', label='Mus musculus', synonyms=['mouse', 'house mouse', 'mice C57BL/6xCBA/CaJ hybrid', 'Mus muscaris'])
OntTerm('NCBITaxon:10088', label='Mus <mouse, genus>', synonyms=['mouse', 'Mus', 'mice'])
OntTerm('BIRNLEX:167', label='Mouse', synonyms=['mouse', 'Mus musculus', 'house mouse'])
The one we are looking for is Mus musculus
, and we can select that with OntTerm(label='Mus musculus')
or with OntTerm(curie='NCBITaxon:10090')
.
This workflow works for a variety of categories:
- species (e.g. 'mouse', 'rat', 'rhesus macaque')
- brain area (e.g. 'hippocampus', 'CA1', 'S1')
- cell type (e.g. 'mossy cell', 'pyramidal cell')
- institution (e.g. 'UC San Francisco', 'Brown University')
- disease (e.g. "Parkinson's Disease", 'ALS')
Building for release
python setup.py sdist --release && python setup.py bdist_wheel --universal --release
Building a release requires a working install of pyontutils in order to build the
scigraph client library. The --release
tells setup to build the scigraph client.
Related issues
https://github.com/NeurodataWithoutBorders/nwb-schema/issues/1#issuecomment-368741867
https://github.com/NeurodataWithoutBorders/nwb-schema/issues/1#issuecomment-369215854
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for ontquery-0.0.5-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a6302ff426f504667167c44610e22d7fde0352b809fbd0a02de12e87cb0c8126 |
|
MD5 | a27633ec04b223929cfb0bd3ca1e7438 |
|
BLAKE2b-256 | 0e33d5a1c2500a52c848f381cfc862b9d87e2fc6c916ebbf037a0fd88c062ae8 |