-
Notifications
You must be signed in to change notification settings - Fork 1
/
Snakefile
71 lines (67 loc) · 2.27 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
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
include: "rules/common.smk"
rule all:
input:
"figures/snakemake_dag.png",
"data/dnr_data/dnr_combined.csv",
"data/weather/all_stations_weather_imputed.csv",
"data/data_prep/combined.csv",
"data/data_prep/combined_normalized.csv",
"data/model_training/feature_importances.csv",
expand(
"data/model_training/training_results_{result_type}.csv",
result_type=RESULT_TYPES
),
"data/land_use/sample_site_land_use_percentages.csv",
expand(
"figures/training_metrics_{result_type}.png",
result_type=RESULT_TYPES
),
"results/summary_statistics_one_week_ahead.csv",
"data/model_training/testing_results.csv",
expand(
"figures/feature_importance/{feature_type}_importances.png",
feature_type=FEATURE_TYPES
),
"figures/microcystin_histogram.tiff",
"figures/microcystin_histogram_threshed.tiff",
"figures/historical_hab_occurrences.png",
"figures/historical_hab_occurrences.tiff",
"results/model_training/variable_evaluation_metrics.csv",
"results/model_training/variable_importance_workflow_fit_200.rds"
# Restores the R environment used in this workflow. Not all packages
# were available for installation through conda, so we use renv to do so.
rule restore_renv:
input:
r_script = "code/restore_renv.R",
r_depends_file = "DESCRIPTION"
output:
touch(".hab_prediction_env_restored")
log:
err = "logs/restore_r.err",
out = "logs/restore_r.out"
conda:
"environment.yml"
shell:
"""
{input.r_script} 2> {log.err} 1> {log.out}
"""
rule generate_snakemake_dag:
input:
script = "code/make_snakemake_dag.sh",
output:
"figures/snakemake_dag.png",
log:
err = "logs/generate_snakemake_dag.err",
out = "logs/generate_snakemake_dag.out"
conda:
"environment.yml"
shell:
"""
{input.script} 2> {log.err} 1> {log.out}
"""
include: "rules/weather_data.smk"
include: "rules/dnr_data.smk"
include: "rules/land_use_data.smk"
include: "rules/data_prep.smk"
include: "rules/model_training.smk"
include: "rules/results_and_figures.smk"