Skip to content

Commit

Permalink
Merge branch 'master' into neurons
Browse files Browse the repository at this point in the history
  • Loading branch information
tgbugs committed Aug 28, 2020
2 parents d6615f8 + cdffa6e commit 7bb15aa
Show file tree
Hide file tree
Showing 21 changed files with 77,682 additions and 50,903 deletions.
77 changes: 77 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# https://travis-ci.org/tgbugs/pyontutils
sudo: false
language: python
cache:
directories:
- $HOME/.cache/pip
- $HOME/.m2
- ${TRAVIS_BUILD_DIR}/../SciGraph
branches:
only:
- dev
- master
git:
depth: 10

python:
- 3.7

env:
global:
- ONTOLOGY=$(git show --first-parent --name-only --pretty='' HEAD | grep '\.ttl$')
- DOCS=$(git show --first-parent --name-only --pretty='' HEAD | grep '^docs\/')
- TRAVIS=$(git show --first-parent --name-only --pretty='' HEAD | grep '^\.travis.yml$')

before_install:
- if [[ -n $DOCS && $TRAVIS_BRANCH = master ]];then echo trigger docs build; fi
- git checkout ${TRAVIS_BRANCH} # ontload doesn't currently work if git is in detached head mode
- mkdir build
- pushd build
- wget https://raw.githubusercontent.com/tgbugs/pyontutils/master/nifstd/scigraph/graphload-base-template.yaml
- wget https://raw.githubusercontent.com/tgbugs/pyontutils/master/nifstd/scigraph/ontologies-nifstd.yaml
- popd

install:
- pip install pyontutils
- >
ontload scigraph
--scigraph-quiet
--scigraph-org SciGraph
--scigraph-branch master
--zip-location "${TRAVIS_BUILD_DIR}/build"
--git-local $(realpath "${TRAVIS_BUILD_DIR}/../")
script:
- >
ontload graph NIF-Ontology NIF
--scigraph-quiet
--path-build-scigraph $(realpath "${TRAVIS_BUILD_DIR}/../")
--scigraph-org SciGraph
--scigraph-branch master
--zip-location "${TRAVIS_BUILD_DIR}/build"
--git-local $(realpath "${TRAVIS_BUILD_DIR}/../")
--branch ${TRAVIS_BRANCH}
--graphload-config "${TRAVIS_BUILD_DIR}/build/graphload-base-template.yaml"
--graphload-ontologies "${TRAVIS_BUILD_DIR}/build/ontologies-nifstd.yaml"
after_success:
- echo ""

before_deploy:
- git config --local user.name "Travis Build Bot"
- git config --local user.email "[email protected]"
- export TRAVIS_TAG=${TRAVIS_TAG:-${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}}
- if [[ -n $ONTOLOGY || -n $TRAVIS ]];then git tag $TRAVIS_TAG; fi

deploy:
provider: releases
api_key:
secure: "CK0fvltjiIAiJ0fDlqzyHG0XpvoROODdRZc7LLwajxNAfRMl9TjH5jD9zVsaH3dt11grweoknRS8WcAzZ2kwDePEbTKON20Ay2tvf73fIzxpA+szg+zJF+sH23bx3xEQrjW/9SQTYx7dOGrvJwhI9GPqctFjPpSwy40/+nMBJ7gocF8TG1ZSswa1anFsM6LNtcSb+qRduIto8z8XkIyi7/BV6yfXrPj/HAeDUoDTVaIQj85DONWmV9h4vrkHBgcqFtWwVvt5uIRCscwFUPYhGcPCBE9sGGeCOaYLiwGzmBwoR4DPuc8Qns4WY/JqBa/IbhmuenybWxlTpgwW+NCs8VcmOrcP9plBxf52nVYNIT4u+k+2h4LwLu3fuJMA0YhQuwnok18b6wS4Yf0E04s03YiouM7kzDAQ6Y8ZESmcJ0CeileGDoxBeI4HIs+xohMsNbpj+KcxcBVQF9tvpBw9ysZodpiYPgO8fnVcIa7li4gtRcDgQGw0NeIEC/VU4wiZJQsQp1W6wqFI6fkZ6dsN9q/zO1nhkyhUChFWQAoQWaMZNhsS6xQiuZkjSrPtyFFEYR0rbzFIMIEk2fzbqwnE4pHyok2vTBDTVGdZGez+O0fLJPs1ojgS0BprciYZqeT8JRu+jv/MZ89lhdilwt1xsJH5+3dYtghAyUv8UfkgIss="
file_glob: true
file: "${TRAVIS_BUILD_DIR}/build/NIF-Ontology-${TRAVIS_BRANCH}-graph-*.zip"
skip_cleanup: true
prerelease: true
draft: true
on:
all_branches: true
condition: -n $ONTOLOGY
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ NIFSTD is a neuroscience ontology that maintains an extensive set of
terms and concepts important for the domains of neuroscience and biology.

# The ontology won't load!
If you are having trouble loading [ttl/nif.ttl](ttl/nif.ttl) in protege
please see [docs/development setup.md#protege](docs/development%20setup.md#protege).
If you are having trouble loading [ttl/nif.ttl](./ttl/nif.ttl) in protege
please see [docs/development-setup.md#protege](./docs/development-setup.md#protege).

# Using NIFSTD
The easiest way to use the NIF Ontology is through our SciGraph [REST API](https://scicrunch.org/browse/api-docs/index.html?url=https://scicrunch.org/swagger-docs/swagger.json).
You will need a SciCunch API key.
You can get one by [registering for a SciCrunch account](https://scicrunch.org/register)
and then [creating an api key](https://scicrunch.org/account/developer).
For several example queries, see [http://ontology.neuinfo.org/trees/examples](http://ontology.neuinfo.org/trees/examples).

# Contributing
## Ontology files
Please [fork](https://github.com/SciCrunch/NIF-Ontology#fork-destination-box) and submit
[pull requests](https://github.com/SciCrunch/NIF-Ontology/pull/new/master) on GitHub.
**Please read [the docs for development processes](docs/processes.md) in order to get started.**
In short, load [ttl/nif.ttl](ttl/nif.ttl) in your favourite ontology editor,
and before commit run [ttlfmt](https://github.com/tgbugs/pyontutils/blob/master/pyontutils/ttlfmt.py)
**Please read [the docs for development processes](./docs/processes.md) in order to get started.**
In short, load [ttl/nif.ttl](./ttl/nif.ttl) in your favourite ontology editor,
and before commit run [ttlfmt](https://github.com/tgbugs/pyontutils/blob/master/ttlser/ttlser/ttlfmt.py)
on any files that you have modified.

## Non-ontology files
This repository only holds ontology files (usually .ttl) that are directly part of NIFSTD
and its documentation. Workflows for ingesting external content into the ontology are managed
in the [pyontutils repository](https://github.com/tgbugs/pyontutils). If you have additional
non-ontology files please contribute them to the appropriate folder in
[pyontutils/development](https://github.com/tgbugs/pyontutils/tree/master/development).
[pyontutils/nifstd/development](https://github.com/tgbugs/pyontutils/tree/master/nifstd/development).

## New terms
There are two ways to submit new terms.
Expand All @@ -41,4 +42,4 @@ Please see the [documentation](http://ontology.neuinfo.org/docs) for information

# License
<a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />The contents of this repository are licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
The text of the license can also be found in the [./LICENSE](./LICENSE) file.
The text of the license can also be found in the [LICENSE](./LICENSE) file.
15 changes: 15 additions & 0 deletions catalog-extras
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
<uri id="User Entered Import Resolution" name="http://protege.stanford.edu/plugins/owl/dc/dcmitype.owl" uri="external/dc/dcmitype.owl"/>
<uri id="User Entered Import Resolution" name="http://protege.stanford.edu/plugins/owl/dc/dublincore.owl" uri="external/dc/dublincore.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid.owl" uri="external/doid.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/obo/ext.owl" uri="external/ext.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/symp_import.owl" uri="external/symp_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/omim_susc_import.owl" uri="external/omim_susc_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/geno_import.owl" uri="external/geno_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/cl_import.owl" uri="external/cl_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/ncbitaxon_import.owl" uri="external/ncbitaxon_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/foodon_import.owl" uri="external/foodon_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/uberon_import.owl" uri="external/uberon_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/ro_import.owl" uri="external/ro_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/chebi_import.owl" uri="external/chebi_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/trans_import.owl" uri="external/trans_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/hp_import.owl" uri="external/hp_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/doid/imports/so_import.owl" uri="external/so_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/go.owl" uri="external/go.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/iao.owl" uri="external/iao.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ncbitaxon/subsets/taxslim.owl" uri="external/taxslim.owl"/>
Expand All @@ -18,6 +31,8 @@
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ro/pato_import.owl" uri="external/ro/pato_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ro/rohom.owl" uri="external/ro/rohom.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ro/temporal-intervals.owl" uri="external/ro/temporal-intervals.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ro/chemical.owl" uri="external/ro/chemical.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/ro/other_import.owl" uri="external/ro/other_import.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/so.owl" uri="external/so.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/uberon.owl" uri="external/uberon.owl"/>
<uri id="User Entered Import Resolution" name="http://purl.obolibrary.org/obo/uberon/bridge/uberon-bridge-to-nifstd.owl" uri="external/uberon-bridge-to-nifstd.owl"/>
71 changes: 46 additions & 25 deletions docs/Neurons.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,37 @@
We are creating a new neuron ontology. This ontology is built on the idea that neuron types are fundamentally bags of phenotypes.
# The Neuron Phenotype Ontology
We are creating a new neuron ontology.
This ontology is built on the idea that neuron types are fundamentally bags of phenotypes.

# Phenotypes
In our model phenotypes are the outputs of some measurement or set of measurements and computations/classifications. Ideally the process for documenting exactly how each phenotype was measured would be included as well, but that is currently outside the scope of this project. The current major categories of phenotypes (with example identifiers are):
* species [NCBITaxon:10116]
* strain [???]
* developmental stage [uberon developmental stage?]
* brain region [UBERON:0000955]
* morphology [ilx:]
* electrophysiology [ilx:]
* morphology [ILX:]
* electrophysiology [ILX:]
* expression [NCBIGene:, PR:000004967; CHEBI:18243]
* projection pattern [ilx:]
* cell type specific connectivity [ilx:]
* circuit role [ilx:]
* projection pattern [ILX:]
* cell type specific connectivity [ILX:]
* circuit role [ILX:]

# Phenotype Predicates
The core of our neuron ontology is based around a set of phenotype predicates that define relationships between phenotypes an neurons. Some examples of these predicates (relationships) are `has morphological phenotype`, `has electrophysiological phenotype`, and `has expression phenotype`. In the first two cases these predicates correspond directly to phenotype classes that are in ttl/NIF-Neuron-Phenotype.ttl because there are not other ontologies that have provided a consistent delineation for many of these types. In the case of expression phenotypes there are a number of different sources of identifiers which all imply that slightly different measurements have been made. For example a `CHEBI` identifier would suggest that a stain against a particular small molecule might have been used, whereas the use of a `NCBIGene` identifier would imply that RNAseq had been used to detect the expression of a gene transcript. While these combinations can be used to provide some implicit information about the original type of measurement, all predicate-phenotype pairs are really proxies for the experimental protocol that was used and how the resulting measurement maps onto the categorical names provided. In the future we will provide a way to link these phenotype assertions to more detailed information about the exact experimental protocol used.

# Bagging
All neurons are modelled using `owl:equivalentClass` and `owl:disjointWith` statements on `owl:Restriction`s. We have also developed a [python library](https://github.com/tgbugs/pyontutils/blob/master/pyontutils/neurons.py) to regularize the bagging process. By using `owl:equivalentClass` and `owl:disjointWith` we are able to model both positive and negative phenotypes, so for example a parvalbumin positive (PV+) and somatostatin negative neuron (SOM-) would translate to the following.
```
All neurons are modelled using `owl:equivalentClass` and `owl:complementOf` statements on `owl:Restriction`s. We have also developed a [python library](https://github.com/tgbugs/pyontutils/tree/master/neurondm) to regularize the bagging process. By using `owl:equivalentClass` and `owl:disjointWith` or `owl:complementOf` we are able to model both positive and negative phenotypes, so for example a parvalbumin positive (PV+) and somatostatin negative neuron (SOM-) would translate to the following. Using complement of works in this context because of the use of `owl:intersectionOf` to construct the bag.
``` ttl
SOMEID:1234567 a owl:Class ;
owl:equivalentClass [ a owl:Class ;
owl:intersectionOf (
NIFCELL:sao1417703748
[ a owl:Restriction ;
owl:onProperty ilx:hasExpressionPhenotype ;
owl:someValuesFrom NIFMOL:nifext_6 ] ) ] ;
owl:disjointWith [ a owl:Restriction ;
owl:onProperty ilx:hasExpressionPhenotype ;
owl:someValuesFrom PR:000015665 ] .
owl:someValuesFrom NIFMOL:nifext_6 ]
[ a owl:Class ;
owl:complementOf [ a owl:Restriction ;
owl:onProperty ilx:hasExpressionPhenotype ;
owl:someValuesFrom PR:000015665 ] ) ] .
```

# Species specific identifiers
Expand All @@ -37,27 +40,45 @@ One of the advantages of using a phenotype based approach is that when there are
# WARNING
At the moment if you see an `ILX:` identifier in one of the ontology files that is involved in modelling neurons it is temporary and should not be used.

# Protege development setup
1. Follow the ontology [development setup doc](./development-setup.md).
Be sure not to miss the section on setting up the [catalog file](./development-setup.md#catalog).
2. Make sure you are working on the neurons branch (run `git checkout neurons`).
2. Open [ttl/neuron-development.ttl](./../ttl/neuron-development.ttl) **from disk** in protege.
3. Follow these sections of the ontology processes document as you edit the file.
- [Changing an ontology file](./processes.md#changing-an-ontology-file)
- [Prior to commit](./processes.md#prior-to-commit)
- [Do not push to master!](./processes.md#do-not-push-ontology-files-to-master)

# Setup and Example notebook
https://github.com/tgbugs/pyontutils/blob/master/docs/neurons_notebook.md
https://github.com/tgbugs/pyontutils/blob/master/docs/NeuronLangExample.ipynb
https://github.com/tgbugs/pyontutils/blob/master/neurondm/docs/neurons_notebook.md
https://github.com/tgbugs/pyontutils/blob/master/neurondm/docs/NeuronLangExample.ipynb

# Notes:

1. Mappings between hbp-cell and the new interlex identifiers.

2. The neurons branch
1. The neurons branch
https://github.com/SciCrunch/NIF-Ontology/tree/neurons/ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/neuron-development.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/bridge/neuron-bridge.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/phenotype-core.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/phenotypes.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/generated/neurons/huang-2017.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/generated/neurons/common-usage-types.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/generated/neurons/allen-cell-types.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/generated/neurons/huang-2017.ttl
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/generated/neurons/markram-2015.ttl

2. Mappings between hbp-cell and the new interlex identifiers.
https://github.com/SciCrunch/NIF-Ontology/blob/neurons/ttl/generated/NIF-Neuron-HBP-cell-import.ttl
https://github.com/tgbugs/pyontutils/blob/master/hbp_cell_conv.csv

3. Python code that generates the new neuron ttl files
https://github.com/tgbugs/pyontutils/blob/master/pyontutils/neuron_lang.py
https://github.com/tgbugs/pyontutils/blob/master/pyontutils/neurons.py
https://github.com/tgbugs/pyontutils/blob/master/pyontutils/nif_neuron.py
https://github.com/tgbugs/pyontutils/tree/master/pyontutils/neuron_models
https://github.com/tgbugs/nlxeol/blob/master/lift_neuron_triples.py
https://github.com/tgbugs/pyontutils/blob/master/pyontutils/resources/26451489%20table%201.csv
https://www.ncbi.nlm.nih.gov/pubmed/26451489
[neurondm/lang.py](https://github.com/tgbugs/pyontutils/blob/master/neurondm/neurondm/lang.py)
[neurondm/core.py](https://github.com/tgbugs/pyontutils/blob/master/neurondm/neurondm/core.py)
[neurondm/build.py](https://github.com/tgbugs/pyontutils/blob/master/neurondm/neurondm/build.py)
[neurondm/models](https://github.com/tgbugs/pyontutils/tree/master/neurondm/neurondm/models)
[nlxeol/lift_neuron_triples.py](https://github.com/tgbugs/nlxeol/blob/master/lift_neuron_triples.py)
[nifstd/resources/26451489 table 1.csv](https://github.com/tgbugs/pyontutils/blob/master/nifstd/resources/26451489%20table%201.csv)

4. Papers
Markram 2015 [PMID:26451489](https://www.ncbi.nlm.nih.gov/pubmed/26451489)
Huang 2017 [PMID:27053207](https://www.ncbi.nlm.nih.gov/pubmed/27053207)
1 change: 0 additions & 1 deletion docs/brain-regions.org
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#+MACRO: parc-r-volume-bounded-prob probabilistic parcellation region
#+MACRO: parc-r-volume-unbounded parcellation landmark region

#+SETUPFILE: theme-readtheorg.setup
#+OPTIONS: num:nil html-preamble:t H:2

* A model for semantic anatomical regions and parcellation anatomical regions
Expand Down
Loading

0 comments on commit 7bb15aa

Please sign in to comment.