Skip to content

Commit

Permalink
Merge pull request #3266 from obophenotype/update-cl-mappings
Browse files Browse the repository at this point in the history
Use CL-provided mapping set.
  • Loading branch information
gouttegd authored May 17, 2024
2 parents 7c9b04f + 9b5321e commit 9785057
Show file tree
Hide file tree
Showing 7 changed files with 1,815 additions and 4,480 deletions.
23 changes: 12 additions & 11 deletions docs/bridges.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,24 @@ The pipeline may be triggered by invoking the Make target
`refresh-bridges` (whilst in the in `src/ontology` directory, where the
Makefile is located). Here is what happens then:

1. Production of a SSSOM mapping set from the Uberon and CL
cross-references. The Uberon `-edit` file is merged with the mirrored
copy of CL (which is downloaded if not already available) and
cross-references from both Uberon and CL are extracted and turned
into a SSSOM mapping set. This takes care of all the mappings with
the foreign ontologies for which Uberon and CL are the source of
truth.
1. Production of a SSSOM mapping set from the Uberon cross-references.
Cross-references are extracted directly from the Uberon `-edit` file
and turned into a SSSOM mapping set. This takes care of all the
mappings with the foreign ontologies for which Uberon is the source
of truth.
2. Production of a SSSOM mapping sets from ontologies that maintain
their own mappings as cross-references. The foreign ontologies are
downloaded and their cross-references are extracted in the same way
as the Uberon/CL cross-references are.
as the Uberon cross-references are. Note that currently there is no
such ontology.
3. Fetching of externally maintained mapping sets. For ontologies that
maintain their own mappings and provide a SSSOM mapping set directly,
we fetch the mapping set as it is.
we fetch the mapping set as it is. This currently concerns FBbt and
CL (the CL set brings with it the mappings between CL and all the
species-specific ontologies).
4. Merging of all the mapping sets. We merge the SSSOM mapping set that
was derived from the Uberon/CL cross-references (step 1), the sets
that were derived from the cross-references of foreign ontologies
was derived from the Uberon cross-references (step 1), the sets that
were derived from the cross-references of foreign ontologies
(step 2), and the sets that we obtained directly from foreign
ontologies (step 3).
5. Production of the bridges. We apply a large SSSOM/T-OWL ruleset (in
Expand Down
2,311 changes: 1,419 additions & 892 deletions src/mappings/cl.sssom.tsv

Large diffs are not rendered by default.

802 changes: 359 additions & 443 deletions src/mappings/fbbt.sssom.tsv

Large diffs are not rendered by default.

3,091 changes: 0 additions & 3,091 deletions src/mappings/zfa.sssom.tsv

This file was deleted.

10 changes: 3 additions & 7 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= d9dd1f14c02c9157faa08c0c33d811609f31616c2917255ed4dca5559cb438ec
CONFIG_HASH= efb88af827f2af6cc513d695dc0dd59380e3e34c4ecf16d3648ebcfbba0aa64f


# ----------------------------------------
Expand Down Expand Up @@ -65,7 +65,7 @@ PATTERN_RELEASE_FILES= $(PATTERNDIR)/definitions.owl $(PATTERNDIR)/pattern.
MAPPINGDIR= ../mappings
MAPPING_TESTER= sssom validate
SSSOMPY= sssom
MAPPINGS= fbbt cl zfa biomappings uberon-local uberon import-corrections
MAPPINGS= fbbt cl biomappings uberon-local uberon import-corrections
MAPPING_RELEASE_FILES= $(foreach n,$(MAPPINGS), $(MAPPINGDIR)/$(n).sssom.tsv)


Expand Down Expand Up @@ -202,7 +202,7 @@ all_subsets: $(SUBSET_FILES)
# ----------------------------------------


MAPPINGS = fbbt cl zfa biomappings uberon-local uberon import-corrections
MAPPINGS = fbbt cl biomappings uberon-local uberon import-corrections

MAPPING_FILES = $(patsubst %, $(MAPPINGDIR)/%.sssom.tsv, $(MAPPINGS))

Expand Down Expand Up @@ -756,10 +756,6 @@ $(MAPPINGDIR)/fbbt.sssom.tsv:
$(MAPPINGDIR)/cl.sssom.tsv:
test -f $@

# This mappingset is manually curated, so we only check that the file actually exists.
$(MAPPINGDIR)/zfa.sssom.tsv:
test -f $@

# This mappingset is manually curated, so we only check that the file actually exists.
$(MAPPINGDIR)/biomappings.sssom.tsv:
test -f $@
Expand Down
4 changes: 1 addition & 3 deletions src/ontology/uberon-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ sssom_mappingset_group:
maintenance: manual
- id: cl
maintenance: manual
- id: zfa
maintenance: manual
- id: biomappings
maintenance: manual
- id: uberon-local
Expand Down Expand Up @@ -152,4 +150,4 @@ components:
- filename: in-subset.owl
- filename: hra_subset.owl
- filename: vasculature_class.owl
- filename: hra_depiction_3d_images.owl
- filename: hra_depiction_3d_images.owl
54 changes: 21 additions & 33 deletions src/ontology/uberon.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1233,55 +1233,41 @@ $(MAPPINGDIR)/uberon-local.sssom.tsv: $(SRC) | all_robot_plugins
--prefix 'FMA: http://purl.org/sig/ont/fma/fma' \
> $(REPORTDIR)/uberon-xrefs-extraction.txt

# Uberon's "meta" mapping set, made by compiling the "local" set above
# with the sets obtained from FBbt, CL, and ZFA below.
# Uberon's "meta" mapping set, containing all mappings between Uberon
# and foreign ontologies, regardless of where they are maintained. Made
# by compiling the "local" set above with the FBbt set obtained below.
$(MAPPINGDIR)/uberon.sssom.tsv: $(MAPPINGDIR)/uberon-local.sssom.tsv \
$(MAPPINGDIR)/fbbt.sssom.tsv \
$(MAPPINGDIR)/cl.sssom.tsv \
$(MAPPINGDIR)/zfa.sssom.tsv
$(MAPPINGDIR)/fbbt.sssom.tsv
sssom-cli $(foreach src, $^, -i $(src)) \
--prefix-map-from-input \
--rule '(object==UBERON:* || object==CL:*) -> invert()' \
--rule '(subject==UBERON:* || subject==CL:*) -> include()' \
--rule 'object==UBERON:* -> invert()' \
--rule 'subject==UBERON:* -> include()' \
--output $@

# Remote mapping sets
# -------------------

# The following providers publish their own mapping sets.
EXTERNAL_SSSOM_PROVIDERS = fbbt cl zfa biomappings
EXTERNAL_SSSOM_PROVIDERS = fbbt cl biomappings

# All the sets coming from the above ontologies.
EXTERNAL_SSSOM_SETS = $(foreach provider, $(EXTERNAL_SSSOM_PROVIDERS), $(MAPPINGDIR)/$(provider).sssom.tsv)

# We only refresh external resources under IMP=true
ifeq ($(strip $(IMP)),true)

# FBbt mapping set. Nominally a simple mirror, but we need a custom rule
# because the default, ODK-generated rule would ignore the MIR variable.
# FBbt mapping set. We filter it to only keep UBERON-related mappings
# (CL-related mappings are already bundled with the CL set).
$(MAPPINGDIR)/fbbt.sssom.tsv: .FORCE
wget "http://purl.obolibrary.org/obo/fbbt/fbbt.sssom.tsv" -O $@

# CL mapping set (extracted from CL cross-references). We need to first
# merge Uberon with CL, because the treat-xrefs-as-... annotations are
# only in Uberon; then we need to remove the Uberon terms to avoid
# extracting the cross-references from them as well.
$(MAPPINGDIR)/cl.sssom.tsv: $(SRC) $(IMPORTDIR)/local-cl.owl | all_robot_plugins
$(ROBOT) merge -i $(SRC) -i $(IMPORTDIR)/local-cl.owl --collapse-import-closure false \
remove --base-iri http://purl.obolibrary.org/obo/CL_ --axioms external \
sssom:xref-extract --mapping-file $@ -v --drop-duplicates \
--set-id "$(ONTBASE)/mappings/cl-mappings.sssom.tsv" \
--prefix 'KUPO: http://purl.obolibrary.org/obo/KUPO_' \
--prefix 'SCTID: http://purl.obolibrary.org/obo/SCTID_' \
--prefix 'FMA: http://purl.org/sig/ont/fma/fma' \
> $(REPORTDIR)/cl-xrefs-extraction.txt
wget "http://purl.obolibrary.org/obo/fbbt/fbbt.sssom.tsv" -O - | \
sssom-cli --prefix-map-from-input \
--rule 'object==UBERON:* -> include()' \
--output $@

# ZFA mapping set (extracted from ZFA cross-references).
$(MAPPINGDIR)/zfa.sssom.tsv: $(IMPORTDIR)/local-zfa.owl | all_robot_plugins
$(ROBOT) sssom:xref-extract -i $(IMPORTDIR)/local-zfa.owl --mapping-file $@ \
-v --drop-duplicates \
--set-id "$(ONTBASE)/mappings/zfa-mappings.sssom.tsv" \
> $(REPORTDIR)/zfa-xrefs-extraction.txt
# CL mapping set. We simply fetch it as it is from CL. It already
# contains all mappings related to CL (including the FBbt and ZFA ones).
$(MAPPINGDIR)/cl.sssom.tsv: .FORCE
wget "http://purl.obolibrary.org/obo/cl/cl.sssom.tsv" -O $@

# Biomappings mapping set. Nominally a simple mirror, but we need a
# custom rule for two reasons:
Expand Down Expand Up @@ -1321,15 +1307,17 @@ CUSTOM_BRIDGES = $(BRIDGEDIR)/uberon-bridge-to-mba.owl \
$(TMPDIR)/bridges.rules: $(SCRIPTSDIR)/sssomt.m4 $(BRIDGEDIR)/bridges.rules.m4
m4 $^ > $@

# 2. Generate the bridges from the "meta" mapping set.
# 2. Generate the bridges from the "meta" mapping set and the CL set.
# Note that merging CL here is not strictly necessary, but doing so
# allows sssom-inject to filter out any mapping with an inexistent or
# obsolete Uberon/CL class.
$(TMPDIR)/bridges: $(SRC) $(IMPORTDIR)/local-cl.owl $(MAPPINGDIR)/uberon.sssom.tsv \
$(TMPDIR)/bridges: $(SRC) $(IMPORTDIR)/local-cl.owl \
$(MAPPINGDIR)/uberon.sssom.tsv $(MAPPINGDIR)/cl.sssom.tsv \
$(TMPDIR)/bridges.rules $(BRIDGEDIR)/bridges.dispatch \
$(CUSTOM_BRIDGES) | all_robot_plugins
$(ROBOT) merge -i $(SRC) -i $(IMPORTDIR)/local-cl.owl \
sssom:inject --sssom $(MAPPINGDIR)/uberon.sssom.tsv \
--sssom $(MAPPINGDIR)/cl.sssom.tsv \
--ruleset $(TMPDIR)/bridges.rules \
--exclude-rule xrefs \
--dispatch-table $(BRIDGEDIR)/bridges.dispatch && \
Expand Down

0 comments on commit 9785057

Please sign in to comment.