-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (35 loc) · 1.62 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
SPECIES = human mouse
human_LISTS = transcription_factor transcription_factor.curated
mouse_LISTS = transcription_factor transcription_factor.curated
.PHONY: all
.PHONY: complete
.PHONY: namespaces
.PHONY: lists
all: complete namespaces lists
clean:
rm -rf `find . -name 'log.txt'`
define SPECIES_RULES
complete: $(1)_complete
namespaces: $(1)_namespaces
.PHONY: $(1)_complete
$(1)_complete: genes/$(1)/namespaces/log.complete.txt
genes/$(1)/namespaces/log.complete.txt: scripts/complete_namespaces.py | $(wildcard genes/$(1)/namespaces/sources/*.Missing.tsv)
set -o pipefail && scripts/complete_namespaces.py $(1) 2>&1 | tee genes/$(1)/namespaces/log.complete.txt
.PHONY: $(1)_namespaces
$(1)_namespaces: genes/$(1)/namespaces/log.txt
genes/$(1)/namespaces/log.txt: scripts/compute_namespaces.py \
$(filter-out %.Missing.tsv,$(filter-out README.md,$(wildcard genes/$(1)/namespaces/sources/*)))
set -o pipefail && scripts/compute_namespaces.py $(1) 2>&1 | tee genes/$(1)/namespaces/log.txt
rm genes/$(1)/namespaces/log.complete.txt
.PHONY: $(1)_lists
lists: $(1)_lists
$(1)_lists: genes/$(1)/lists/log.txt
$(foreach list,$($(1)_LISTS),$(eval $(call SPECIES_LIST_RULES,$(1),$(list))))
endef
define SPECIES_LIST_RULES
genes/$(1)/lists/log.txt: genes/$(1)/lists/$(2)/log.txt
genes/$(1)/lists/$(2)/log.txt: scripts/compute_list.py genes/$(1)/namespaces/log.txt \
$(filter-out %.Missing.tsv,$(filter-out README.md,$(wildcard genes/$(1)/lists/$(2)/sources/*)))
set -o pipefail && scripts/compute_list.py $(1) $(2) 2>&1 | tee genes/$(1)/lists/$(2)/log.txt
endef
$(foreach species,$(SPECIES),$(eval $(call SPECIES_RULES,$(species))))