-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmanuscript.rules
More file actions
150 lines (118 loc) · 3.16 KB
/
Copy pathmanuscript.rules
File metadata and controls
150 lines (118 loc) · 3.16 KB
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
149
150
# Manuscript
# ==========
#
# This snakefile has rules to build the main manuscript, including all artwork and tables.
#
# N.B., all rules in this file assume that all source files, including any data required,
# are present within the GitHub repository. Thus it should be possible to execute all rules
# within the CI environment.
#
# Setup
# -----
#
# Rules in this section include source and setup scripts, to ensure any changes in these will
# trigger a rebuild.
#
import glob
sources = glob.glob('agam-report-base/src/python/*')
rule setup:
input:
sources,
"notebooks/setup.ipynb",
output:
"build/notebooks/setup.md",
shell:
"./nbexec.sh notebooks/setup.ipynb"
# Artwork
# -------
#
# Rules in this section build artwork (figures, figure components, etc.).
#
rule artwork_demo:
# Example of how to include a Jupyter notebook in the artwork build.
input:
rules.setup.output,
"notebooks/artwork_demo.ipynb",
output:
"build/notebooks/artwork_demo.md",
"artwork/demo.png",
shell:
"./nbexec.sh notebooks/artwork_demo.ipynb"
rule artwork_ld:
input:
rules.setup.output,
"notebooks/artwork_ld.ipynb",
output:
"build/notebooks/artwork_ld.md",
"artwork/fig_ld.png",
shell:
"./nbexec.sh notebooks/artwork_ld.ipynb"
rule artwork:
# Build all artwork.
input:
rules.artwork_demo.output,
rules.artwork_ld.output,
# add more inputs here as required
output:
touch("build/manuscript.artwork.done")
# Tables
# ------
#
# Rules in this section build tables for the manuscript.
#
rule table_demo:
# Demo of a notebook that builds a latex table.
input:
rules.setup.output,
"notebooks/table_demo.ipynb",
output:
"build/notebooks/table_demo.md",
"tables/demo.tex"
shell:
"./nbexec.sh notebooks/table_demo.ipynb"
rule table_variants_missense:
# Build the LaTex table of missense variants in VGSC.
input:
rules.setup.output,
"notebooks/table_variants_missense.ipynb",
"data/tbl_variants_phase1.pkl",
output:
"build/notebooks/table_variants_missense.md",
"tables/variants_missense.tex"
shell:
"./nbexec.sh notebooks/table_variants_missense.ipynb"
rule tables:
# Build all tables.
input:
rules.table_demo.output,
rules.table_variants_missense.output,
# add more inputs here as required
output:
touch("build/manuscript.tables.done")
# Main manuscript
# ---------------
rule main:
# Build the manuscript PDF file. This rule should depend on all artwork and tables.
input:
rules.artwork.output,
rules.tables.output,
"main.tex",
"refs.bib",
# add more inputs here as required
output:
"build/main.pdf",
touch("build/manuscript.main.done")
shell:
"./latex.sh"
# Utilities
# ---------
rule all:
# Build everything.
input:
rules.main.output,
output:
touch("build/manuscript.done")
rule clean:
# Clean out the build folder.
shell:
"rm -rvf build/*"