Skip to content

Commit dc657fd

Browse files
committed
add metrics_include/exclude args
1 parent 16ec241 commit dc657fd

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<!-- * Restructured `src` directory (PR #3). -->
66

7-
* `run_benchmark`: replaced the `--method_ids` argument with `--methods_include` and `--methods_exclude`, filtered via `checkItemAllowed()` from the common nextflow helpers (PR #20).
7+
* `run_benchmark`: replaced `--method_ids` with `--methods_include`/`--methods_exclude` and added `--metrics_include`/`--metrics_exclude` (PR #20).
88

99
## NEW FUNCTIONALITY
1010

src/workflows/run_benchmark/config.vsh.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ argument_groups:
6565
multiple: true
6666
description: |
6767
A list of method ids to exclude. If specified, all methods except the ones listed will be run.
68+
- name: Metric filtering
69+
description: |
70+
Use these arguments to filter metrics by name. By default, all metrics are
71+
run. If `--metrics_include` is defined, only those metrics are run. If
72+
`--metrics_exclude` is defined, all metrics except those specified are run.
73+
These arguments are mutually exclusive, so only `--metrics_include` OR
74+
`--metrics_exclude` can set but not both.
75+
arguments:
76+
- name: "--metrics_include"
77+
type: string
78+
multiple: true
79+
description: |
80+
A list of metric ids to include. If specified, only these metrics will be run.
81+
- name: "--metrics_exclude"
82+
type: string
83+
multiple: true
84+
description: |
85+
A list of metric ids to exclude. If specified, all metrics except the ones listed will be run.
6886
6987
resources:
7088
- type: nextflow_script

src/workflows/run_benchmark/main.nf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,18 @@ workflow run_wf {
9999
// run all metrics
100100
| runEach(
101101
components: metrics,
102+
103+
// use the 'filter' argument to only run the metrics the user asked for
104+
filter: { id, state, comp ->
105+
checkItemAllowed(
106+
comp.config.name,
107+
state.metrics_include,
108+
state.metrics_exclude,
109+
"metrics_include",
110+
"metrics_exclude"
111+
)
112+
},
113+
102114
id: { id, state, comp ->
103115
id + "." + comp.config.name
104116
},

0 commit comments

Comments
 (0)