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
Release files for ontquery 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ontquery-0.0.5.tar.gz | 29.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ontquery-0.0.5-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 58.7 kB
Release files / ontquery-0.0.5.tar.gz
| Download URL | ontquery-0.0.5.tar.gz |
|---|---|
| Size | 29.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ebfd9717aad1808797043b43c35331ddcb0c395180cc1db084d7a7ec7d289de
|
|
BLAKE2b-256 checksum How to use checksums |
65972ae7e86f9c120073a682d9b8a9a4ea3cfb3a171149cfe7841b6b0ccc6442
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.6
|
Release files / ontquery-0.0.5-py2.py3-none-any.whl
| Download URL | ontquery-0.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 29.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
a6302ff426f504667167c44610e22d7fde0352b809fbd0a02de12e87cb0c8126
|
|
BLAKE2b-256 checksum How to use checksums |
0e33d5a1c2500a52c848f381cfc862b9d87e2fc6c916ebbf037a0fd88c062ae8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.6
|