-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
148 lines (99 loc) · 3.92 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
MAKEFLAGS += --warn-undefined-variables
SHELL := bash
.DEFAULT_GOAL := help
URIBASE := http://purl.obolibrary.org/obo
TMP_DATA := data/tmp
ROOT_DIR := $(shell pwd)
PHENOTYPE_DIR := $(ROOT_DIR)/data/phenotype
RUNNERS_DIR := $(ROOT_DIR)/runners
NAME := $(shell python -c 'import tomli; print(tomli.load(open("pyproject.toml", "rb"))["tool"]["poetry"]["name"])')
VERSION := $(shell python -c 'import tomli; print(tomli.load(open("pyproject.toml", "rb"))["tool"]["poetry"]["version"])')
SEMSIM_BASE_URL := https://storage.googleapis.com/data-public-monarchinitiative/semantic-similarity/latest
help: info
@echo ""
@echo "help"
@echo "make setup -- this runs the download and extraction of genomic, phenotypic and runners data"
@echo "make pheval -- this runs pheval pipeline corpus preparation and run"
@echo "make all -- this runs the entire pipeline including setup, corpus preparation and pheval run"
@echo "make help -- show this help"
@echo ""
info:
@echo "Project: $(NAME)"
@echo "Version: $(VERSION)"
.PHONY: prepare-inputs
configurations/template-1.0.0/config.yaml:
mkdir -p $(ROOT_DIR)/$(shell dirname $@)/
cp $(RUNNERS_DIR)/configurations/template-1.0.0.config.yaml $(ROOT_DIR)/$(shell dirname $@)/config.yaml
.PHONY: prepare-corpora
$(TMP_DATA)/semsim/%.tsv:
mkdir -p $(TMP_DATA)/semsim/
wget $(SEMSIM_BASE_URL)/$*.tsv -O $@
$(TMP_DATA)/semsim/%.sql:
mkdir -p $(TMP_DATA)/semsim/
wget $(SEMSIM_BASE_URL)/$*.sql -O $@
$(ROOT_DIR)/results/template-1.0.0/results.yml: configurations/template-1.0.0/config.yaml corpora/lirical/default/corpus.yml
rm -rf $(ROOT_DIR)/$(shell dirname $@)
mkdir -p $(ROOT_DIR)/$(shell dirname $@)
mkdir -p $(shell dirname $@)
pheval run \
--input-dir $(ROOT_DIR)/configurations/template-1.0.0 \
--testdata-dir $(ROOT_DIR)/corpora/lirical/default \
--runner templatephevalrunner \
--tmp-dir data/tmp/ \
--version 1.0.0 \
--output-dir $(shell dirname $@)
touch $@
.PHONY: pheval-run
pheval-run: $(ROOT_DIR)/results/template-1.0.0/results.yml
$(ROOT_DIR)/results/template-1.0.0/run_data.yaml:
printf '%s\n' \
"benchmark_name: fake_predictor_benchmark" \
"runs:" \
" - run_identifier: run_identifier_1" \
" results_dir: $(shell dirname $@)" \
" phenopacket_dir: $(ROOT_DIR)/corpora/lirical/default/phenopackets" \
" gene_analysis: True" \
" variant_analysis: False" \
" disease_analysis: False" \
" threshold:" \
" score_order: descending" \
"plot_customisation:" \
" gene_plots:" \
" plot_type: bar_cumulative" \
" rank_plot_title:" \
" roc_curve_title: " \
" precision_recall_title: " \
" disease_plots:" \
" plot_type: bar_cumulative" \
" rank_plot_title:" \
" roc_curve_title: " \
" precision_recall_title: " \
" variant_plots:" \
" plot_type: bar_cumulative" \
" rank_plot_title: " \
" roc_curve_title: " \
" precision_recall_title: " \
> $@
$(ROOT_DIR)/results/template-1.0.0/gene_rank_stats.svg: $(ROOT_DIR)/results/template-1.0.0/run_data.yaml
pheval-utils generate-benchmark-stats -r $<
.PHONY: pheval-report
pheval-report: $(ROOT_DIR)/results/template-1.0.0/gene_rank_stats.svg
corpora/lirical/default/corpus.yml:
test -d $(ROOT_DIR)/corpora/lirical/default/ || mkdir -p $(ROOT_DIR)/corpora/lirical/default/
test -L $(ROOT_DIR)/corpora/lirical/default/template_exome_hg19.vcf.gz || ln -s $(ROOT_DIR)/testdata/template_vcf/template_exome_hg19.vcf.gz $(ROOT_DIR)/corpora/lirical/default/template_exome_hg19.vcf.gz
pheval-utils create-spiked-vcfs \
--hg19-template-vcf $(ROOT_DIR)/corpora/lirical/default/template_exome_hg19.vcf.gz \
--phenopacket-dir=$(ROOT_DIR)/corpora/lirical/default/phenopackets \
--output-dir $(ROOT_DIR)/corpora/lirical/default/vcf
touch $@
.PHONY: pheval
pheval:
$(MAKE) prepare-inputs
$(MAKE) prepare-corpora
$(MAKE) pheval-run
$(MAKE) pheval-report
.PHONY: all
all:
$(MAKE) setup
$(MAKE) pheval
include ./resources/custom.Makefile