Skip to content

Commit cea9ee9

Browse files
Merge pull request #29 from SchlossLab/report
Support Snakemake's report feature
2 parents 41c6dee + 3fce707 commit cea9ee9

File tree

6 files changed

+106658
-5
lines changed

6 files changed

+106658
-5
lines changed

.snakemake-workflow-catalog.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ usage:
55
conda: true
66
singularity: true
77
singularity+conda: true
8+
report: true

docs/report-test.html

Lines changed: 106622 additions & 0 deletions
Large diffs are not rendered by default.

workflow/Snakefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ include: "rules/plot.smk"
3232
include: "rules/example-report.smk"
3333

3434

35+
report: "report/workflow.rst"
36+
37+
3538
rule targets:
3639
input:
3740
f"report_{dataset}.md",

workflow/report/benchmarks.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Each model training run was given {{ snakemake.config['ncores'] }} cores for
2+
parallelization.

workflow/report/workflow.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Machine learning algorithms used were: {{ snakemake.config['ml_methods'] }}.
2+
Models were trained with {{ snakemake.config['nseeds'] }}
3+
different random partitions of the
4+
{{ snakemake.config['dataset_name'] }} dataset
5+
into training and testing sets using
6+
{{ snakemake.config['kfold'] }}-fold cross validation.

workflow/rules/plot.smk

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ rule plot_performance:
22
input:
33
csv="results/{dataset}/performance_results.csv",
44
output:
5-
plot="figures/{dataset}/performance.png",
5+
plot=report(
6+
"figures/{dataset}/performance.png",
7+
category="Performance",
8+
subcategory="Model Performance",
9+
),
610
log:
711
"log/{dataset}/plot_performance.txt",
812
conda:
@@ -17,7 +21,10 @@ if find_feature_importance:
1721
input:
1822
csv="results/{dataset}/feature-importance_results.csv",
1923
output:
20-
plot="figures/{dataset}/feature_importance.png",
24+
plot=report(
25+
"figures/{dataset}/feature_importance.png",
26+
category="Feature Importance",
27+
),
2128
log:
2229
"log/{dataset}/plot_feature_importance.txt",
2330
conda:
@@ -29,7 +36,10 @@ else:
2936

3037
rule make_blank_feature_plot:
3138
output:
32-
plot="figures/{dataset}/feature_importance.png",
39+
plot=report(
40+
"figures/{dataset}/feature_importance.png",
41+
category="Feature Importance",
42+
),
3343
log:
3444
"log/{dataset}/make_blank_plot.txt",
3545
conda:
@@ -42,7 +52,11 @@ rule plot_hp_performance:
4252
input:
4353
rds="results/{dataset}/hp_performance_results_{method}.Rds",
4454
output:
45-
plot="figures/{dataset}/hp_performance_{method}.png",
55+
plot=report(
56+
"figures/{dataset}/hp_performance_{method}.png",
57+
category="Performance",
58+
subcategory="Hyperparameter Tuning",
59+
),
4660
log:
4761
"log/{dataset}/plot_hp_perf_{method}.txt",
4862
conda:
@@ -55,7 +69,12 @@ rule plot_benchmarks:
5569
input:
5670
csv="results/{dataset}/benchmarks_results.csv",
5771
output:
58-
plot="figures/{dataset}/benchmarks.png",
72+
plot=report(
73+
"figures/{dataset}/benchmarks.png",
74+
category="Performance",
75+
subcategory="Runtime & Memory Usage",
76+
caption="../report/benchmarks.rst",
77+
),
5978
log:
6079
"log/{dataset}/plot_benchmarks.txt",
6180
conda:

0 commit comments

Comments
 (0)