From 74e76f693559d4e14f96d2824f3646a28f3c731f Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 18 Aug 2026 11:05:19 +0200 Subject: [PATCH 1/3] use methods_include/exclude args --- src/workflows/run_benchmark/config.vsh.yaml | 19 ++++++++++++++++--- src/workflows/run_benchmark/main.nf | 10 +++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/workflows/run_benchmark/config.vsh.yaml b/src/workflows/run_benchmark/config.vsh.yaml index 4c1602d..637530c 100644 --- a/src/workflows/run_benchmark/config.vsh.yaml +++ b/src/workflows/run_benchmark/config.vsh.yaml @@ -47,12 +47,24 @@ argument_groups: required: true direction: output default: task_info.yaml - - name: Methods + - name: Method filtering + description: | + Use these arguments to filter methods by name. By default, all methods are + run. If `--methods_include` is defined, only those methods are run. If + `--methods_exclude` is defined, all methods except those specified are run. + These arguments are mutually exclusive, so only `--methods_include` OR + `--methods_exclude` can set but not both. arguments: - - name: "--method_ids" + - name: "--methods_include" type: string multiple: true - description: A list of method ids to run. If not specified, all methods will be run. + description: | + A list of method ids to include. If specified, only these methods will be run. + - name: "--methods_exclude" + type: string + multiple: true + description: | + A list of method ids to exclude. If specified, all methods except the ones listed will be run. resources: - type: nextflow_script @@ -60,6 +72,7 @@ resources: entrypoint: run_wf - type: file path: /_viash.yaml + - path: /common/nextflow_helpers/helper.nf dependencies: - name: utils/extract_uns_metadata diff --git a/src/workflows/run_benchmark/main.nf b/src/workflows/run_benchmark/main.nf index f912a21..02ee6b0 100644 --- a/src/workflows/run_benchmark/main.nf +++ b/src/workflows/run_benchmark/main.nf @@ -1,3 +1,5 @@ +include { checkItemAllowed } from "${meta.resources_dir}/helper.nf" + workflow auto { findStates(params, meta.config) | meta.workflow.run( @@ -57,7 +59,13 @@ workflow run_wf { // if the preferred normalisation is none at all, // we can pass whichever dataset we want def norm_check = (norm == "log_cp10k" && pref == "counts") || norm == pref - def method_check = !state.method_ids || state.method_ids.contains(comp.config.name) + def method_check = checkItemAllowed( + comp.config.name, + state.methods_include, + state.methods_exclude, + "methods_include", + "methods_exclude" + ) method_check && norm_check }, From 16ec24134ffdfd6b0a3f9db8921c712fffe53c17 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 18 Aug 2026 11:06:25 +0200 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fa4c46..386b650 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ +* `run_benchmark`: replaced the `--method_ids` argument with `--methods_include` and `--methods_exclude`, filtered via `checkItemAllowed()` from the common nextflow helpers (PR #20). + ## NEW FUNCTIONALITY * Added `control_methods/true_labels` component (PR #5). From dc657fdf7dcadb812c9930fd5389fc855047a7dc Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 18 Aug 2026 11:58:20 +0200 Subject: [PATCH 3/3] add metrics_include/exclude args --- CHANGELOG.md | 2 +- src/workflows/run_benchmark/config.vsh.yaml | 18 ++++++++++++++++++ src/workflows/run_benchmark/main.nf | 12 ++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 386b650..6f8fd0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ -* `run_benchmark`: replaced the `--method_ids` argument with `--methods_include` and `--methods_exclude`, filtered via `checkItemAllowed()` from the common nextflow helpers (PR #20). +* `run_benchmark`: replaced `--method_ids` with `--methods_include`/`--methods_exclude` and added `--metrics_include`/`--metrics_exclude` (PR #20). ## NEW FUNCTIONALITY diff --git a/src/workflows/run_benchmark/config.vsh.yaml b/src/workflows/run_benchmark/config.vsh.yaml index 637530c..6533bcd 100644 --- a/src/workflows/run_benchmark/config.vsh.yaml +++ b/src/workflows/run_benchmark/config.vsh.yaml @@ -65,6 +65,24 @@ argument_groups: multiple: true description: | A list of method ids to exclude. If specified, all methods except the ones listed will be run. + - name: Metric filtering + description: | + Use these arguments to filter metrics by name. By default, all metrics are + run. If `--metrics_include` is defined, only those metrics are run. If + `--metrics_exclude` is defined, all metrics except those specified are run. + These arguments are mutually exclusive, so only `--metrics_include` OR + `--metrics_exclude` can set but not both. + arguments: + - name: "--metrics_include" + type: string + multiple: true + description: | + A list of metric ids to include. If specified, only these metrics will be run. + - name: "--metrics_exclude" + type: string + multiple: true + description: | + A list of metric ids to exclude. If specified, all metrics except the ones listed will be run. resources: - type: nextflow_script diff --git a/src/workflows/run_benchmark/main.nf b/src/workflows/run_benchmark/main.nf index 02ee6b0..dc0991d 100644 --- a/src/workflows/run_benchmark/main.nf +++ b/src/workflows/run_benchmark/main.nf @@ -99,6 +99,18 @@ workflow run_wf { // run all metrics | runEach( components: metrics, + + // use the 'filter' argument to only run the metrics the user asked for + filter: { id, state, comp -> + checkItemAllowed( + comp.config.name, + state.metrics_include, + state.metrics_exclude, + "metrics_include", + "metrics_exclude" + ) + }, + id: { id, state, comp -> id + "." + comp.config.name },