-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
105 lines (75 loc) · 3.4 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Makefile to generate source JSON-LD contexts plus merged contexts
CONTEXTS := pr go obo idot idot_nr semweb monarch semweb_vocab ro_vocab commons
all: $(patsubst %,registry/%_context.jsonld,$(CONTEXTS)) reports/clashes.txt
# TODO: Dockerize
install:
pip install -r requirements.txt
test: all
trigger:
touch $@
## ----------------------------------------
## CONTEXTS
## ----------------------------------------
## OBO
## We pull from the official OBO registry
##
registry/obo_context.jsonld: trigger
wget --no-check-certificate http://obofoundry.org/registry/obo_context.jsonld -O $@ && touch $@
## Gene Ontology
## Minerva
registry/minerva_context.jsonld: trigger
wget --no-check-certificate https://raw.githubusercontent.com/geneontology/minerva/master/minerva-core/src/main/resources/amigo_context_manual.jsonld -O $@ && touch $@
registry/go_context.jsonld: registry/go-db-xrefs.json
./bin/go-xrefs-to-context.py $< > [email protected] && mv [email protected] $@
## Monarch
registry/monarch_curie_map.yaml:
wget --no-check-certificate https://raw.githubusercontent.com/monarch-initiative/dipper/master/dipper/curie_map.yaml -O $@
registry/monarch_context.jsonld: registry/monarch_curie_map.yaml
./bin/curiemap2context.py $< > [email protected] && mv [email protected] $@
## PRO
registry/pr_context.jsonld:
./bin/pro-obo2jsonld.pl > $@
## IDENTIFIERS.ORG
## Step1: Get miriam
registry/miriam.ttl: trigger
wget --no-check-certificate http://www.ebi.ac.uk/miriam/main/export/registry.ttl -O $@ && touch $@
##
## Everything from MIRIAM registry
registry/idot_context.jsonld: registry/miriam.ttl
./bin/miriam2jsonld.pl $< > $@
## NON-REDUNDANT IDOT
##
## OBO Library takes priority, we subtract OBO from IDOT
registry/idot_nr_context.jsonld: registry/idot_context.jsonld registry/obo_context.jsonld
python3 ./bin/subtract-context.py $^ > [email protected] && mv [email protected] $@
## Generic: derived from manually curated source
registry/%_context.jsonld: registry/%_context.yaml
./bin/yaml2json.py $< > [email protected] && mv [email protected] $@
## COMBINED
##
## The kitchen sink
# Highest priority LAST
COMMONS_SOURCES = semweb idot_nr monarch obo
registry/commons_context.jsonld: $(patsubst %, registry/%_context.jsonld, $(COMMONS_SOURCES))
python3 ./bin/concat-context.py $^ > [email protected] && mv [email protected] $@
GO_SOURCES = semweb go obo
registry/go_obo_context.jsonld: $(patsubst %, registry/%_context.jsonld, $(GO_SOURCES))
python3 ./bin/concat-context.py $^ > [email protected] && mv [email protected] $@
TRANSLATOR_SOURCES = semweb monarch go idot_nr obo
registry/translator_context.jsonld: $(patsubst %, registry/%_context.jsonld, $(TRANSLATOR_SOURCES))
python3 ./bin/concat-context.py $^ > [email protected] && mv [email protected] $@
SUPERSET_SOURCES = go idot semweb monarch semweb_vocab ro_vocab obo
reports/clashes.txt: $(patsubst %, registry/%_context.jsonld, $(SUPERSET_SOURCES))
(python3 ./bin/concat-context.py $^ > registry/superset.jsonld) >& $@
# requires biomake
reports/clashes-$(A)-$(B).txt: $(patsubst %, registry/%_context.jsonld, $(A) $(B))
(python3 ./bin/concat-context.py $^ > registry/superset.jsonld) >& $@
# requires biomake
reports/clashes-$(A)-$(B)-$(C).txt: $(patsubst %, registry/%_context.jsonld, $(A) $(B) $(C))
(python3 ./bin/concat-context.py $^ > registry/superset.jsonld) >& $@
## GO
## TODO
registry/go-db-xrefs.yaml:
wget --no-check-certificate https://raw.githubusercontent.com/geneontology/go-site/master/metadata/db-xrefs.yaml -O $@
registry/go-db-xrefs.json: registry/go-db-xrefs.yaml
./bin/yaml2json.pl $< > $@