Skip to content

Commit

Permalink
Merge pull request #3177 from obophenotype/make-composite-stripping-o…
Browse files Browse the repository at this point in the history
…ptional

Allow to optionally keep disjointness axioms when building composite products.
  • Loading branch information
gouttegd authored Jan 17, 2024
2 parents fe6f488 + edbadda commit 9d94885
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ontology/uberon.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,14 @@ COLLECTED_metazoan_SOURCES = $(COLLECTED_vertebrate_SOURCES) \
# Composite pipeline proper
# ----------------------------------------

# Set to false to keep disjointness axioms in collected/composite
# products. Such axioms are stripped by default because too many
# taxon-specific ontologies are inconsistent with Uberon.
COMPOSITE_STRIP_DISJOINTS=true
ifeq ($(COMPOSITE_STRIP_DISJOINTS),true)
COMPOSITE_STRIPPING_COMMAND = remove --axioms "DisjointClasses DisjointUnion"
endif

# Step 1: Create a "collected" ontology, which is simply a merge of
# Uberon, CL, and the components listed in the COLLECTED_*_SOURCES
# variables above.
Expand All @@ -1171,20 +1179,18 @@ $(TMPDIR)/collected-%.owl: $(BRIDGEDIR)/collected-%-hdr.owl uberon.owl $(IMPORTD
# Step 1b: collected-metazoan is not merely an intermediate towards
# composite-metazoan, it is also a released artefact.
collected-metazoan.owl: $(TMPDIR)/collected-metazoan.owl
$(ROBOT) remove -i $< --axioms "DisjointClasses DisjointUnion" \
$(ROBOT) merge -i $< $(COMPOSITE_STRIPPING_COMMAND) \
annotate --ontology-iri $(ONTBASE)/$@ $(ANNOTATE_ONTOLOGY_VERSION) -o $@

# Step 2: Create a "composite" ontology. This is the core of the
# composite pipeline. It heavily relies on the Uberon plugin for ROBOT,
# which provides the 'merge-species' and 'merge-equivalent-sets'
# commands.
# The pipeline starts by removing all the disjointness axioms, because
# many external ontologies do not adhere to all Uberon constraints.
TAXON_GCI_RELS = RO:0002202 RO:0002496 RO:0002497 BFO:0000051
MERGESPECIES_OPTS = --remove-declarations --extended-translation --translate-gcas
.PRECIOUS: $(TMPDIR)/composite-%.owl
$(TMPDIR)/composite-%.owl: $(TMPDIR)/collected-%.owl $(TMPDIR)/plugins/uberon.jar
$(ROBOT) remove -i $< --axioms "DisjointClasses DisjointUnion" \
$(ROBOT) merge -i $< $(COMPOSITE_STRIPPING_COMMAND) \
uberon:merge-species $(MERGESPECIES_OPTS) -s 'mouse' -t NCBITaxon:10090 $(foreach rel,$(TAXON_GCI_RELS),-q $(rel)) \
uberon:merge-species $(MERGESPECIES_OPTS) -s 'human' -t NCBITaxon:9606 $(foreach rel,$(TAXON_GCI_RELS),-q $(rel)) \
uberon:merge-species $(MERGESPECIES_OPTS) -s 'primate' -t NCBITaxon:9443 \
Expand Down

0 comments on commit 9d94885

Please sign in to comment.