-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
71 lines (52 loc) · 1.77 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
# Makefile ---
# Author: David Ochoa <ochoa@ebi.ac.uk>
ROOTDIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
RANALYSISDIR= $(ROOTDIR)/analysis/R
TMPDIR = $(ROOTDIR)/temp/
DOCSDIR= $(TMPDIR)/docs
FIGSDIR= $(TMPDIR)/figures
FIGSDIRONCO= $(TMPDIR)/figures_oncology
FIGSDIRNONONCO= $(TMPDIR)/figures_nononcology
#Reports
REPORT = $(DOCSDIR)/index.html
REPORTONCO = $(DOCSDIR)/index_oncology.html
REPORTNONONCO = $(DOCSDIR)/index_nononcoology.html
# Programs
# R ?= $(shell which R)
# RSCRIPT ?= $(shell which Rscript)
figures: $(FIGSDIR)
poetry run Rscript $(RANALYSISDIR)/figures.R './temp/report_cache/' $(FIGSDIR)
clean-report:
-rm $(REPORT)
clean-report-all:
-rm -rf $(TMPDIR)
setup-dev: SHELL:=/bin/bash
setup-dev: ## Setup development environment
@. utils/install_dependencies.sh
report: $(REPORT)
$(TMPDIR):
mkdir -p $@
$(DOCSDIR):
mkdir -p $@
$(FIGSDIR):
mkdir -p $@
$(FIGSDIRONCO):
mkdir -p $@
$(FIGSDIRNONONCO):
mkdir -p $@
#Report
$(REPORT): $(TMPDIR) $(DOCSDIR) $(FIGSDIR)
poetry run R \
-e "cache_dir <- '$(TMPDIR)/report_cache/'" \
-e "config_path <- '$(ROOTDIR)/config.yml'" \
-e "rmarkdown::render('$(RANALYSISDIR)/report.rmd', knit_root_dir='$(ROOTDIR)',output_file = '$@')"
$(REPORTONCO): $(TMPDIR) $(DOCSDIR) $(FIGSDIRONCO)
poetry run R \
-e "cache_dir <- '$(TMPDIR)/report_cache_oncology/'" \
-e "config_path <- '$(ROOTDIR)/config_oncology.yml'" \
-e "rmarkdown::render('$(RANALYSISDIR)/report.rmd', knit_root_dir='$(ROOTDIR)',output_file = '$@')"
$(REPORTNONONCO): $(TMPDIR) $(DOCSDIR) $(FIGSDIRNONONCO)
poetry run R \
-e "cache_dir <- '$(TMPDIR)/report_cache_nononcology/'" \
-e "config_path <- '$(ROOTDIR)/config_nononcology.yml'" \
-e "rmarkdown::render('$(RANALYSISDIR)/report.rmd', knit_root_dir='$(ROOTDIR)',output_file = '$@')"