Skip to content

Commit

Permalink
Merge pull request #29 from SchlossLab/report
Browse files Browse the repository at this point in the history
Support Snakemake's report feature
  • Loading branch information
kelly-sovacool authored Jan 19, 2023
2 parents 41c6dee + 3fce707 commit cea9ee9
Show file tree
Hide file tree
Showing 6 changed files with 106,658 additions and 5 deletions.
1 change: 1 addition & 0 deletions .snakemake-workflow-catalog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ usage:
conda: true
singularity: true
singularity+conda: true
report: true
106,622 changes: 106,622 additions & 0 deletions docs/report-test.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ include: "rules/plot.smk"
include: "rules/example-report.smk"


report: "report/workflow.rst"


rule targets:
input:
f"report_{dataset}.md",
Expand Down
2 changes: 2 additions & 0 deletions workflow/report/benchmarks.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Each model training run was given {{ snakemake.config['ncores'] }} cores for
parallelization.
6 changes: 6 additions & 0 deletions workflow/report/workflow.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Machine learning algorithms used were: {{ snakemake.config['ml_methods'] }}.
Models were trained with {{ snakemake.config['nseeds'] }}
different random partitions of the
{{ snakemake.config['dataset_name'] }} dataset
into training and testing sets using
{{ snakemake.config['kfold'] }}-fold cross validation.
29 changes: 24 additions & 5 deletions workflow/rules/plot.smk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ rule plot_performance:
input:
csv="results/{dataset}/performance_results.csv",
output:
plot="figures/{dataset}/performance.png",
plot=report(
"figures/{dataset}/performance.png",
category="Performance",
subcategory="Model Performance",
),
log:
"log/{dataset}/plot_performance.txt",
conda:
Expand All @@ -17,7 +21,10 @@ if find_feature_importance:
input:
csv="results/{dataset}/feature-importance_results.csv",
output:
plot="figures/{dataset}/feature_importance.png",
plot=report(
"figures/{dataset}/feature_importance.png",
category="Feature Importance",
),
log:
"log/{dataset}/plot_feature_importance.txt",
conda:
Expand All @@ -29,7 +36,10 @@ else:

rule make_blank_feature_plot:
output:
plot="figures/{dataset}/feature_importance.png",
plot=report(
"figures/{dataset}/feature_importance.png",
category="Feature Importance",
),
log:
"log/{dataset}/make_blank_plot.txt",
conda:
Expand All @@ -42,7 +52,11 @@ rule plot_hp_performance:
input:
rds="results/{dataset}/hp_performance_results_{method}.Rds",
output:
plot="figures/{dataset}/hp_performance_{method}.png",
plot=report(
"figures/{dataset}/hp_performance_{method}.png",
category="Performance",
subcategory="Hyperparameter Tuning",
),
log:
"log/{dataset}/plot_hp_perf_{method}.txt",
conda:
Expand All @@ -55,7 +69,12 @@ rule plot_benchmarks:
input:
csv="results/{dataset}/benchmarks_results.csv",
output:
plot="figures/{dataset}/benchmarks.png",
plot=report(
"figures/{dataset}/benchmarks.png",
category="Performance",
subcategory="Runtime & Memory Usage",
caption="../report/benchmarks.rst",
),
log:
"log/{dataset}/plot_benchmarks.txt",
conda:
Expand Down

0 comments on commit cea9ee9

Please sign in to comment.