-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (40 loc) · 2.08 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
RUN = poetry run
RULES_FILE = src/mondolib/config/mondo-match-rules.yaml
all: pyclasses test_inputs
pyclasses: src/mondolib/datamodels/mondolib_schema.py
src/mondolib/datamodels/%.py: src/mondolib/datamodels/%.yaml
$(RUN) gen-python $< > $@
tests/input/%.owl: tests/input/%.obo
robot convert -i $< -o $@
test_inputs: tests/input/example.db
tests/input/%.db: tests/input/%.owl
$(RUN) semsql make --docker $@
# *======|=|=||================
tmp/mondo_edit.obo:
wget -O tmp/mondo_edit.obo https://raw.githubusercontent.com/monarch-initiative/mondo/master/src/ontology/mondo-edit.obo
tmp/mondo.owl: tmp/mondo_edit.obo
robot convert -i $< --output $@
tmp/mondo-relaxed-branchreview.owl: tmp/mondo_edit.obo
robot merge -i $< -i $< relax -o $@
tmp/mondo-reasoned-branchreview.owl: tmp/mondo_edit.obo
robot merge -i $< -i $< reason -o $@
tmp/mondo%.db: tmp/mondo%.owl
$(RUN) semsql make $@
rm -f .template.db
rm -f tmp/mondo-relation-graph.tsv.gz
tmp/mondo_lexmatch.sssom.tsv: tmp/mondo.db
$(RUN) runoak -i sqlite:$< lexmatch -o $@ -R $(RULES_FILE) --ensure-strict-prefixes
tmp/mondo_validate_full.tsv: tmp/mondo.db
$(RUN) runoak -i sqlite:$< validate -o $@
tmp/mondo_validate.tsv: tmp/mondo_validate_full.tsv
$(RUN) mondoqc validate $< -o $@
obsoletion-tables: tmp/mondo-relaxed-branchreview.db tmp/mondo-reasoned-branchreview.db
for id in $(shell cat src/mondolib/config/branch_ids.tsv); do \
$(RUN) mondoqc create-review-table -i tmp/mondo-reasoned-branchreview.db -o tmp/mondo-reasoned-branch-$$id-review.tsv -f src/mondolib/config/obsoletion_terms.tsv -b $$id;\
$(RUN) mondoqc create-review-table -i tmp/mondo-relaxed-branchreview.db -o tmp/mondo-relaxed-branch-$$id-review.tsv -f src/mondolib/config/obsoletion_terms.tsv -b $$id;\
$(RUN) mondoqc relax-and-reason -i tmp/mondo-reasoned-branch-$$id-review.tsv -i tmp/mondo-relaxed-branch-$$id-review.tsv -r tmp/mondo-relaxed-branchreview.db -f src/mondolib/config/obsoletion_terms.tsv -o reports/mondo-combined-branch-$$id-review.tsv;\
done
lexmatch: tmp/mondo_lexmatch.sssom.tsv
validate: tmp/mondo_validate.tsv
clear-tmp:
rm -rf tmp/*