-
Notifications
You must be signed in to change notification settings - Fork 0
/
Snakefile
44 lines (38 loc) · 1.06 KB
/
Snakefile
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
from snakemake.utils import R
def get_head_hash():
return os.popen('git rev-parse --verify HEAD 2>&1').read().strip()
rule default:
input: "index.html"
rule makeprops:
input: blocks="data/properties/blocks.txt",
addr="data/properties/addresses.txt"
output: "intermediates/results_extended.txt"
shell:
"""
ruby prepare.rb > {output}
"""
rule analyze:
input: prep="intermediates/results_extended.txt",
shp="data/shapefiles/Parcels_UniversityCity.shp"
output: "intermediates/properties.RData"
run:
R("""
inputfile<-"{input.prep}"
source("analysis.R")
""")
rule report:
input: prop="intermediates/properties.RData",
report="catchment.Rpres"
output: "{report}.html"
params: githash= get_head_hash()
run:
R("""
githash<-"{params.githash}"
rmarkdown::render("{input.report}",output_file="{output}")
""")
rule clean:
shell:
"""
rm -f *.html
rm -f intermediates/properties.RData
"""