Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add taxon subsets #2810

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ subsets/BDS_subset.tsv
subsets/BDS_subset.owl
subsets/BDS_subset.obo
subsets/BDS_subset.json
subsets/*-view.*
subsets/*-tags.*
src/ontology/subsets/BDS_subset.tsv
src/ontology/subsets/BDS_subset.owl
src/ontology/subsets/BDS_subset.obo
src/ontology/subsets/BDS_subset.json
src/ontology/subsets/*-view.*
src/ontology/subsets/*-tags.*
src/mappings/cl-local.sssom.tsv
src/mappings/cl.sssom.tsv
cl.json
Expand Down
9 changes: 6 additions & 3 deletions src/ontology/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# More information: https://github.com/INCATools/ontology-development-kit/

# Fingerprint of the configuration file when this Makefile was last generated
CONFIG_HASH= f7d9e8d156ea19124c47084171b68728b3f6cf2fddba07984f7985402bfc2b36
CONFIG_HASH= d4e868f8bbec3ce7b0d7656c824520ab0b96d8901a8c2b9cf400c27c3fb3dac2


# ----------------------------------------
Expand Down Expand Up @@ -132,7 +132,7 @@ custom_robot_plugins:


.PHONY: extra_robot_plugins
extra_robot_plugins: $(ROBOT_PLUGINS_DIRECTORY)/flybase.jar
extra_robot_plugins: $(ROBOT_PLUGINS_DIRECTORY)/flybase.jar $(ROBOT_PLUGINS_DIRECTORY)/uberon.jar


# Install all ROBOT plugins to the runtime plugins directory
Expand All @@ -155,6 +155,9 @@ $(ROBOT_PLUGINS_DIRECTORY)/%.jar:
$(ROBOT_PLUGINS_DIRECTORY)/flybase.jar:
curl -L -o $@ https://github.com/FlyBase/flybase-robot-plugin/releases/download/flybase-robot-plugin-0.2.2/flybase.jar

$(ROBOT_PLUGINS_DIRECTORY)/uberon.jar:
curl -L -o $@ https://github.com/gouttegd/uberon-robot-plugin/releases/download/uberon-robot-plugin-0.3.1/uberon.jar


# ----------------------------------------
# Release assets
Expand Down Expand Up @@ -188,7 +191,7 @@ all_imports: $(IMPORT_FILES)
# ----------------------------------------


SUBSETS = BDS_subset blood_and_immune_upper_slim eye_upper_slim general_cell_types_upper_slim kidney_upper_slim
SUBSETS = BDS_subset blood_and_immune_upper_slim eye_upper_slim general_cell_types_upper_slim kidney_upper_slim human-view mouse-view

SUBSET_ROOTS = $(patsubst %, $(SUBSETDIR)/%, $(SUBSETS))
SUBSET_FILES = $(foreach n,$(SUBSET_ROOTS), $(foreach f,$(FORMATS_INCL_TSV), $(n).$(f)))
Expand Down
4 changes: 4 additions & 0 deletions src/ontology/cl-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ robot_plugins:
plugins:
- name: flybase
mirror_from: https://github.com/FlyBase/flybase-robot-plugin/releases/download/flybase-robot-plugin-0.2.2/flybase.jar
- name: uberon
mirror_from: https://github.com/gouttegd/uberon-robot-plugin/releases/download/uberon-robot-plugin-0.3.1/uberon.jar
subset_group:
products:
- id: BDS_subset
- id: blood_and_immune_upper_slim
- id: eye_upper_slim
- id: general_cell_types_upper_slim
- id: kidney_upper_slim
- id: human-view
- id: mouse-view
sssom_mappingset_group:
products:
- id: cl-local
Expand Down
47 changes: 46 additions & 1 deletion src/ontology/cl.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# ----------------------------------------

# Preprocessing: automatically generate text definitions from logical definitions
$(EDIT_PREPROCESSED): $(SRC) all_robot_plugins
$(EDIT_PREPROCESSED): $(SRC) | all_robot_plugins
$(ROBOT) flybase:rewrite-def -i $< --dot-definitions --null-definitions \
--no-ids --filter-prefix CL_ \
--add-annotation "oboInOwl:hasDbXref FBC:Autogenerated" \
Expand All @@ -34,6 +34,16 @@ cl-plus.owl: $(ONT)-full.owl
annotate --ontology-iri $(ONTBASE)/$@ \
$(ANNOTATE_ONTOLOGY_VERSION) --output $@

# Main release artefact (cl.owl)
# We override the standard ODK-generate rule so that we can merge in the
# tags for the taxon subsets.
POSTPROCESS_ADDITIONS = subsets/human-tags.ofn \
subsets/mouse-tags.ofn
$(ONT).owl: $(ONT)-full.owl $(POSTPROCESS_ADDITIONS)
$(ROBOT) merge -i $< $(foreach add,$(POSTPROCESS_ADDITIONS),-i $(add)) \
annotate --ontology-iri $(URIBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) \
convert -o $@


# ----------------------------------------
# SSSOM MAPPINGS
Expand Down Expand Up @@ -178,6 +188,41 @@ test: obocheck \
test_obsolete


# ----------------------------------------
# TAXON SUBSETS
# ----------------------------------------

TAXON_ID_human = NCBITaxon:9606
TAXON_ID_mouse = NCBITaxon:10090

# Create a taxon-specific subset. This rule creates two distinct files:
# (1) the subset proper (subsets/%-view.owl), which can be used on its
# own (and can be published as a release artifact if desired);
# (2) a small containing oboInOwl:inSubset annotations to "tag" all
# terms that belong to the subset (subsets/%-tags.ofn); that file
# can then be combined with a CL release product.
.PRECIOUS: subsets/%-view.owl
subsets/%-view.owl subsets/%-tags.ofn: $(ONT)-full.owl | all_robot_plugins
$(ROBOT) expand --input $< --expand-term RO:0002161 \
uberon:create-species-subset --taxon $(TAXON_ID_$*) \
--strategy precise \
--reasoner WHELK \
--root CL:0000000 \
--prefix 'cl: http://purl.obolibrary.org/cl#' \
--subset-name cl:$*_subset \
--only-tag-in CL: \
--write-tags-to subsets/$*-tags.ofn \
reason --reasoner WHELK --equivalent-classes-allowed all \
--exclude-tautologies structural \
relax \
remove --axioms equivalent \
reduce --reasoner WHELK \
annotate --ontology-iri $(ONTBASE)/subsets/$*-view.owl \
--version-iri $(ONTBASE)/releases/$(VERSION)/subsets/$*-view.owl \
--annotation owl:versionInfo $(VERSION) \
convert --format ofn --output subsets/$*-view.owl


# ----------------------------------------
# DOSDP PATTERNS HACKS
# ----------------------------------------
Expand Down