Skip to content

Commit

Permalink
fix: use latest datavzrd wrapper, integrating templating of config, t…
Browse files Browse the repository at this point in the history
…hereby avoiding leaks of local storage paths into datavzrd config (#74)

* fix: group render and report rules together in order to avoid leaks of local storage paths into datavzrd config

Otherwise, the consuming rule can fail on certain systems where local storage paths are job specific

* fix: snakefmt

* use latest wrapper, omitting the grouping stuff entirely

* use yte

---------

Co-authored-by: Famke Bäuerle <[email protected]>
  • Loading branch information
johanneskoester and famosab authored May 4, 2024
1 parent 65930c5 commit 40a64ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 35 deletions.
2 changes: 2 additions & 0 deletions workflow/resources/datavzrd/fp-fn-config.yte.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__use_yte__: true

__definitions__:
- import os
- import pandas as pd
Expand Down
4 changes: 3 additions & 1 deletion workflow/resources/datavzrd/precision-recall-config.yte.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__use_yte__: true

__variables__:
green: "#74c476"
orange: "#fd8d3c"
Expand All @@ -9,7 +11,7 @@ default-view: results-table

datasets:
results:
path: ?input.dataset
path: ?input.table
separator: "\t"
links:
link to table:
Expand Down
43 changes: 9 additions & 34 deletions workflow/rules/eval.smk
Original file line number Diff line number Diff line change
Expand Up @@ -242,25 +242,11 @@ rule collect_precision_recall:
"../scripts/collect-precision-recall.py"


rule render_precision_recall_report_config:
rule report_precision_recall:
input:
dataset="results/precision-recall/benchmarks/{benchmark}.{vartype}.tsv",
template=workflow.source_path(
config=workflow.source_path(
"../resources/datavzrd/precision-recall-config.yte.yaml"
),
params:
somatic=get_somatic_status,
output:
"results/datavzrd-config/precision-recall/{benchmark}/{vartype}.config.yaml",
log:
"logs/yte/datavzrd-config/precision-recall/{benchmark}/{vartype}.log",
template_engine:
"yte"


rule report_precision_recall:
input:
config="results/datavzrd-config/precision-recall/{benchmark}/{vartype}.config.yaml",
table="results/precision-recall/benchmarks/{benchmark}.{vartype}.tsv",
output:
report(
Expand All @@ -271,8 +257,10 @@ rule report_precision_recall:
),
log:
"logs/datavzrd/precision-recall/{benchmark}/{vartype}.log",
params:
somatic=get_somatic_status,
wrapper:
"v2.13.0/utils/datavzrd"
"v3.10.1/utils/datavzrd"


rule extract_fp_fn:
Expand Down Expand Up @@ -316,26 +304,11 @@ rule collect_fp_fn:
"../scripts/collect-fp-fn.py"


rule render_fp_fn_report_config:
input:
main_dataset="results/fp-fn/genomes/{genome}/{cov}/{classification}/main.tsv",
dependency_sorting_datasets="results/fp-fn/genomes/{genome}/{cov}/{classification}/dependency-sorting",
template=workflow.source_path("../resources/datavzrd/fp-fn-config.yte.yaml"),
output:
"results/datavzrd-config/fp-fn/{genome}/{cov}/{classification}.config.yaml",
params:
labels=lambda w: get_callsets_labels(get_genome_callsets(w.genome)),
log:
"logs/yte/datavzrd-config/fp-fn/{genome}/{cov}/{classification}.log",
template_engine:
"yte"


rule report_fp_fn:
input:
main_dataset="results/fp-fn/genomes/{genome}/{cov}/{classification}/main.tsv",
dependency_sorting_datasets="results/fp-fn/genomes/{genome}/{cov}/{classification}/dependency-sorting",
config="results/datavzrd-config/fp-fn/{genome}/{cov}/{classification}.config.yaml",
config=workflow.source_path("../resources/datavzrd/fp-fn-config.yte.yaml"),
output:
report(
directory("results/report/fp-fn/{genome}/{cov}/{classification}"),
Expand All @@ -346,5 +319,7 @@ rule report_fp_fn:
),
log:
"logs/datavzrd/fp-fn/{genome}/{cov}/{classification}.log",
params:
labels=lambda w: get_callsets_labels(get_genome_callsets(w.genome)),
wrapper:
"v2.13.0/utils/datavzrd"
"v3.10.1/utils/datavzrd"

0 comments on commit 40a64ed

Please sign in to comment.