Skip to content

Commit

Permalink
update pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Sep 4, 2024
1 parent 8dbc878 commit 56b91d4
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 22 deletions.
4 changes: 2 additions & 2 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= 6d08c1892cf5022d04f85e26f8e689356a8bac275e24f2e6cb105e7d2097bb56
CONFIG_HASH= 1e77a49593b43cb269ead22e0f03aa7e85284fb88e0e8b01cb02248f733fccd6


# ----------------------------------------
Expand Down Expand Up @@ -396,7 +396,7 @@ $(IMPORTDIR)/merged_terms_combined.txt: $(ALL_TERMS_COMBINED)

$(IMPORTDIR)/merged_import.owl: $(MIRRORDIR)/merged.owl $(IMPORTDIR)/merged_terms_combined.txt
if [ $(IMP) = true ]; then $(ROBOT) merge -i $< \
remove --select "<http://purl.obolibrary.org/obo/GOCHE_*>" remove --select "<http://purl.obolibrary.org/obo/NCBITaxon_Union_*>" remove --select "<http://purl.obolibrary.org/obo/NCBITaxon_*>" remove --select "<http://www.informatics.jax.org/marker/MGI:*>" remove --select "<http://purl.obolibrary.org/obo/OBI_*>" remove --select "<http://purl.obolibrary.org/obo/CARO_*>" remove --select "<http://purl.obolibrary.org/obo/XAO_*>" remove --select "<http://purl.obolibrary.org/obo/WBbt_*>" remove --select "<http://purl.obolibrary.org/obo/DDANAT_*>" remove --select "<http://purl.obolibrary.org/obo/CHEBItemp_*>" remove --select "<http://purl.obolibrary.org/obo/WBls_*>" remove --select "<http://purl.obolibrary.org/obo/ZFA_*>" remove --select "<http://purl.obolibrary.org/obo/PLANA_*>" remove --select "<http://purl.obolibrary.org/obo/FBbt_*>" remove --select "<http://purl.obolibrary.org/obo/FBcv_*>" remove --select "<http://purl.obolibrary.org/obo/PCO_*>" remove --select "<http://purl.obolibrary.org/obo/NCIT_*>" remove --select "<http://purl.obolibrary.org/obo/BTO_*>" remove --select "<http://www.ebi.ac.uk/efo/EFO_*>" remove --select "<http://purl.obolibrary.org/obo/ENVO_*>" remove --select "<http://purl.obolibrary.org/obo/SO_*>" remove --select "<http://purl.obolibrary.org/obo/cl#abbreviation*>" remove --select "<http://purl.obolibrary.org/obo/cl#added_for_HCA*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#ABBREVIATION*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#COMPARATIVE_PREFERRED*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#DEPRECATED*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#DUBIOUS*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#HOMOLOGY*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#HUMAN_PREFERRED*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#INCONSISTENT*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#LATIN*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#MISSPELLING*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#NON_AMNIOTE*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#NON_MAMMAL*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#PENDING_REVIEW*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#PLURAL*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#SENSU*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#SYSTEMATIC*>" \
remove --select "<http://purl.obolibrary.org/obo/GOCHE_*>" remove --select "<http://purl.obolibrary.org/obo/NCBITaxon_Union_*>" remove --select "<http://purl.obolibrary.org/obo/NCBITaxon_*>" remove --select "<http://www.informatics.jax.org/marker/MGI:*>" remove --select "<http://purl.obolibrary.org/obo/OBI_*>" remove --select "<http://purl.obolibrary.org/obo/CARO_*>" remove --select "<http://purl.obolibrary.org/obo/XAO_*>" remove --select "<http://purl.obolibrary.org/obo/WBbt_*>" remove --select "<http://purl.obolibrary.org/obo/DDANAT_*>" remove --select "<http://purl.obolibrary.org/obo/CHEBItemp_*>" remove --select "<http://purl.obolibrary.org/obo/WBls_*>" remove --select "<http://purl.obolibrary.org/obo/ZFA_*>" remove --select "<http://purl.obolibrary.org/obo/PLANA_*>" remove --select "<http://purl.obolibrary.org/obo/FBbt_*>" remove --select "<http://purl.obolibrary.org/obo/FBdv_*>" remove --select "<http://purl.obolibrary.org/obo/PCO_*>" remove --select "<http://purl.obolibrary.org/obo/NCIT_*>" remove --select "<http://purl.obolibrary.org/obo/BTO_*>" remove --select "<http://www.ebi.ac.uk/efo/EFO_*>" remove --select "<http://purl.obolibrary.org/obo/ENVO_*>" remove --select "<http://purl.obolibrary.org/obo/SO_*>" remove --select "<http://purl.obolibrary.org/obo/cl#abbreviation*>" remove --select "<http://purl.obolibrary.org/obo/cl#added_for_HCA*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#ABBREVIATION*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#COMPARATIVE_PREFERRED*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#DEPRECATED*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#DUBIOUS*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#HOMOLOGY*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#HUMAN_PREFERRED*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#INCONSISTENT*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#LATIN*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#MISSPELLING*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#NON_AMNIOTE*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#NON_MAMMAL*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#PENDING_REVIEW*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#PLURAL*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#SENSU*>" remove --select "<http://purl.obolibrary.org/obo/uberon/core#SYSTEMATIC*>" \
extract -T $(IMPORTDIR)/merged_terms_combined.txt --force true --copy-ontology-annotations true --individuals exclude --method BOT \
remove $(patsubst %, --term %, $(ANNOTATION_PROPERTIES)) -T $(IMPORTDIR)/merged_terms_combined.txt --select complement --select annotation-properties \
query --update ../sparql/inject-subset-declaration.ru --update ../sparql/inject-synonymtype-declaration.ru --update ../sparql/postprocess-module.ru \
Expand Down
2 changes: 1 addition & 1 deletion src/ontology/upheno-odk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ import_group:
- <http://purl.obolibrary.org/obo/ZFA_*>
- <http://purl.obolibrary.org/obo/PLANA_*>
- <http://purl.obolibrary.org/obo/FBbt_*>
- <http://purl.obolibrary.org/obo/FBcv_*>
- <http://purl.obolibrary.org/obo/FBdv_*>
- <http://purl.obolibrary.org/obo/PCO_*>
- <http://purl.obolibrary.org/obo/NCIT_*>
- <http://purl.obolibrary.org/obo/BTO_*>
Expand Down
83 changes: 64 additions & 19 deletions src/ontology/upheno.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@ $(MAPPINGDIR)/upheno-cross-species.sssom.tsv: $(TMPDIR)/upheno-species-lexical.c
$(MAPPINGDIR)/%.sssom.owl: $(MAPPINGDIR)/%.sssom.tsv
sssom convert -i $< -O owl -o $@

%.db: %.owl
@rm -f $*.db
@rm -f .template.db
@rm -f .template.db.tmp
@rm -f $*-relation-graph.tsv.gz
RUST_BACKTRACE=full semsql make $*.db -P config/prefixes.csv
@rm -f .template.db
@rm -f .template.db.tmp
@rm -f $*-relation-graph.tsv.gz
@test -f $*.db || (echo "Error: File not found!" && exit 1)

.PRECIOUS: %.db

semsim/upheno-0.4.semsimian.tsv: upheno.db $(IMPORTDIR)/all_phenotype_terms.txt
runoak --stacktrace -vvv -i semsimian:sqlite:upheno.db similarity -p i \
--set1-file $(IMPORTDIR)/all_phenotype_terms.txt \
--set2-file $(IMPORTDIR)/all_phenotype_terms.txt \
--min-jaccard-similarity 0.4 -O csv -o $@

custom_reports: $(REPORTDIR)/upheno-associated-entities.csv \
$(REPORTDIR)/upheno-eq-analysis.csv
Expand Down Expand Up @@ -89,25 +107,25 @@ $(EDIT_PREPROCESSED): $(SRC)

upheno-old-model.owl: $(TMPDIR)/upheno-old-metazoa.owl
$(ROBOT) remove -i $< --axioms DisjointClasses \
remove --axioms DisjointUnion \
remove --axioms DifferentIndividuals \
remove --axioms NegativeObjectPropertyAssertion \
remove --axioms NegativeDataPropertyAssertion \
remove --axioms FunctionalObjectProperty \
remove --axioms InverseFunctionalObjectProperty \
remove --axioms ReflexiveObjectProperty \
remove --axioms IrrefexiveObjectProperty \
remove --axioms DisjointObjectProperties \
remove --axioms FunctionalDataProperty \
remove --axioms DisjointDataProperties \
remove --term owl:Nothing \
remove --axioms "annotation" \
reason --reasoner ELK \
filter \
--term "http://purl.obolibrary.org/obo/UPHENO_0001001" \
--select "self descendants equivalents" \
annotate --ontology-iri $(ONTBASE)/$@ --version-iri $(ONTBASE)/releases/$(TODAY)/$@ \
-o $@
remove --axioms DisjointUnion \
remove --axioms DifferentIndividuals \
remove --axioms NegativeObjectPropertyAssertion \
remove --axioms NegativeDataPropertyAssertion \
remove --axioms FunctionalObjectProperty \
remove --axioms InverseFunctionalObjectProperty \
remove --axioms ReflexiveObjectProperty \
remove --axioms IrrefexiveObjectProperty \
remove --axioms DisjointObjectProperties \
remove --axioms FunctionalDataProperty \
remove --axioms DisjointDataProperties \
remove --term owl:Nothing \
remove --axioms "annotation" \
reason --reasoner ELK \
filter \
--term "http://purl.obolibrary.org/obo/UPHENO_0001001" \
--select "self descendants equivalents" \
annotate --ontology-iri $(ONTBASE)/$@ --version-iri $(ONTBASE)/releases/$(TODAY)/$@ \
-o $@

upheno-curated.owl: upheno-basic.owl
$(ROBOT) merge -i upheno-basic.owl \
Expand Down Expand Up @@ -194,9 +212,36 @@ $(COMPONENTSDIR)/upheno-bridge.owl: $(SRC) $(MAPPINGDIR)/upheno-species-independ
###### Import preparation ##########
####################################

$(IMPORTDIR)/all_phenotype_terms.txt: mirror/merged.owl
$(ROBOT) query -f csv -i $< --query ../sparql/all_phenotype_terms.sparql $@
sed -i 's/[?]//g' $@
sed -i 's/http:[/][/]purl[.]obolibrary[.]org[/]obo[/]//g' $@
sed -i 's/_/:/g' $@


$(IMPORTDIR)/merged_terms_combined.txt: $(ALL_TERMS_COMBINED) $(IMPORTDIR)/all_phenotype_terms.txt
if [ $(IMP) = true ]; then cat $^ | grep -v ^# | sort | uniq > $@; fi

ALL_MIRRORS = $(patsubst %, $(MIRRORDIR)/%.owl, $(IMPORTS))
ifeq ($(strip $(MERGE_MIRRORS)),true)
$(MIRRORDIR)/merged.owl: $(ALL_MIRRORS)
$(ROBOT) merge $(patsubst %, -i %, $(ALL_MIRRORS)) \
upheno:extract-upheno-relations \
--root-phenotype UPHENO:0001001 \
--root-phenotype MP:0000001 \
--root-phenotype HP:0000118 \
--root-phenotype WBPhenotype:0000886 \
--root-phenotype XPO:00000000 \
--root-phenotype XPO:0000000 \
--root-phenotype PLANP:00000000 \
--root-phenotype ZP:0000000 \
--root-phenotype FBcv:0001347 \
--root-phenotype FYPO:0000001 \
--root-phenotype DDPHENO:0010000 \
--root-phenotype PHIPO:0000505 \
--root-phenotype MGPO:0001001 \
--root-phenotype APO:0000017 \
--relation UPHENO:0000003 --relation UPHENO:0000001 \
remove --axioms disjoint --preserve-structure false remove --term http://www.w3.org/2002/07/owl#Nothing --axioms logical --preserve-structure false \
remove --term RO:0000052 --term RO:0002314 --axioms tbox --preserve-structure false \
remove --axioms equivalent --preserve-structure false \
Expand Down

0 comments on commit 56b91d4

Please sign in to comment.