Skip to content

Commit c0eed36

Browse files
committed
use methods_include/exclude args
1 parent 139aec9 commit c0eed36

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

src/workflows/run_benchmark/config.vsh.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,32 @@ argument_groups:
4747
required: true
4848
direction: output
4949
default: task_info.yaml
50-
- name: Methods
50+
- name: Method filtering
51+
description: |
52+
Use these arguments to filter methods by name. By default, all methods are
53+
run. If `--methods_include` is defined, only those methods are run. If
54+
`--methods_exclude` is defined, all methods except those specified are run.
55+
These arguments are mutually exclusive, so only `--methods_include` OR
56+
`--methods_exclude` can set but not both.
5157
arguments:
52-
- name: "--method_ids"
58+
- name: "--methods_include"
5359
type: string
5460
multiple: true
55-
description: A list of method ids to run. If not specified, all methods will be run.
61+
description: |
62+
A list of method ids to include. If specified, only these methods will be run.
63+
- name: "--methods_exclude"
64+
type: string
65+
multiple: true
66+
description: |
67+
A list of method ids to exclude. If specified, all methods except the ones listed will be run.
5668
5769
resources:
5870
- type: nextflow_script
5971
path: main.nf
6072
entrypoint: run_wf
6173
- type: file
6274
path: /_viash.yaml
75+
- path: /common/nextflow_helpers/helper.nf
6376

6477
dependencies:
6578
- name: utils/extract_uns_metadata

src/workflows/run_benchmark/main.nf

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
include { checkItemAllowed } from "${meta.resources_dir}/helper.nf"
2+
13
workflow auto {
24
findStates(params, meta.config)
35
| meta.workflow.run(
@@ -57,7 +59,13 @@ workflow run_wf {
5759
// if the preferred normalisation is none at all,
5860
// we can pass whichever dataset we want
5961
def norm_check = (norm == "log_cp10k" && pref == "counts") || norm == pref
60-
def method_check = !state.method_ids || state.method_ids.contains(comp.config.name)
62+
def method_check = checkItemAllowed(
63+
comp.config.name,
64+
state.methods_include,
65+
state.methods_exclude,
66+
"methods_include",
67+
"methods_exclude"
68+
)
6169

6270
method_check && norm_check
6371
},

0 commit comments

Comments
 (0)