Skip to content

Commit 4bd90a8

Browse files
committed
Merge remote-tracking branch 'origin/main' into add_results_processing
2 parents c4c082a + 3ebfec1 commit 4bd90a8

File tree

5 files changed

+59
-7
lines changed

5 files changed

+59
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@
122122

123123
* Schema defined in `src\api` has been modified to include dataset specific parameters (PR #71).
124124

125-
* Disabled parallelization of `metrics/cms` + cms distributions are now kept in the output AnnData object(PR #83).
125+
* Disabled parallelization of `metrics/cms` + cms distributions are now kept in the output AnnData object (PR #83).
126+
127+
* Add arguments for including/excluding methods and metrics in the benchmarking workflow (PR #100).
128+
126129

127130
## BUG FIXES
128131

_viash.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ authors:
5050
roles: [ "author", "maintainer" ]
5151
info:
5252
github: LuLeom
53+
orcid: 0009-0002-0742-8504
5354
- name: Givanna Putri
5455
roles: [ "author", "maintainer" ]
5556
info:
@@ -64,10 +65,12 @@ authors:
6465
roles: [ "contributor" ]
6566
info:
6667
github: KatrienQ
68+
orcid: 0000-0001-5306-5615
6769
- name: Sofie Van Gassen
6870
roles: [ "contributor" ]
6971
info:
7072
github: SofieVG
73+
orcid: 0000-0002-7119-5330
7174

7275
config_mods: |
7376
.runners[.type == "nextflow"].config.labels := { lowmem : "memory = 20.Gb", midmem : "memory = 50.Gb", highmem : "memory = 100.Gb", lowcpu : "cpus = 5", midcpu : "cpus = 15", highcpu : "cpus = 30", lowtime : "time = 1.h", midtime : "time = 4.h", hightime : "time = 8.h", veryhightime : "time = 24.h" }

scripts/run_benchmark/run_full_seqeracloud.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ cat > /tmp/params.yaml << HERE
1717
input_states: s3://openproblems-data/resources/task_cyto_batch_integration/datasets/**/state.yaml
1818
rename_keys: 'input_censored_split1:output_censored_split1;input_censored_split2:output_censored_split2;input_unintegrated:output_unintegrated'
1919
output_state: "state.yaml"
20+
# settings: '{"methods_include": ["combat", "gaussnorm"]}'
2021
publish_dir: "$publish_dir"
2122
HERE
2223

src/workflows/run_benchmark/config.vsh.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,36 @@ argument_groups:
4848
default: task_info.yaml
4949
- name: Methods
5050
arguments:
51-
- name: "--method_ids"
51+
- name: "--methods_include"
5252
type: string
5353
multiple: true
54-
description: A list of method ids to run. If not specified, all methods will be run.
54+
description: |
55+
A list of method ids to include. If specified, only these methods will be run.
56+
- name: "--methods_exclude"
57+
type: string
58+
multiple: true
59+
description: |
60+
A list of method ids to exclude. If specified, all methods except the ones listed will be run.
61+
- name: Metrics
62+
arguments:
63+
- name: "--metrics_include"
64+
type: string
65+
multiple: true
66+
description: |
67+
A list of metric ids to include. If specified, only these metrics will be run.
68+
- name: "--metrics_exclude"
69+
type: string
70+
multiple: true
71+
description: |
72+
A list of metric ids to exclude. If specified, all metrics except the ones listed will be run.
5573
5674
resources:
5775
- type: nextflow_script
5876
path: main.nf
5977
entrypoint: run_wf
6078
- type: file
6179
path: /_viash.yaml
80+
- path: /common/nextflow_helpers/helper.nf
6281

6382
dependencies:
6483
- name: utils/extract_uns_metadata

src/workflows/run_benchmark/main.nf

Lines changed: 30 additions & 4 deletions
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(
@@ -81,9 +83,15 @@ workflow run_wf {
8183

8284
// run only non-control methods & filter by method_ids
8385
filter: { id, state, comp ->
84-
def id_filter = !state.method_ids || state.method_ids.contains(comp.config.name)
86+
def method_check = checkItemAllowed(
87+
comp.config.name,
88+
state.methods_include,
89+
state.methods_exclude,
90+
"methods_include",
91+
"methods_exclude"
92+
)
8593
def method_filter = comp.config.info.type == "method"
86-
id_filter && method_filter
94+
method_check && method_filter
8795
},
8896

8997
// define a new 'id' by appending the method name to the dataset id
@@ -127,9 +135,15 @@ workflow run_wf {
127135

128136
// run only control methods & filter by method_ids
129137
filter: { id, state, comp ->
130-
def id_filter = !state.method_ids || state.method_ids.contains(comp.config.name)
138+
def method_check = checkItemAllowed(
139+
comp.config.name,
140+
state.methods_include,
141+
state.methods_exclude,
142+
"methods_include",
143+
"methods_exclude"
144+
)
131145
def method_filter = comp.config.info.type == "control_method"
132-
id_filter && method_filter
146+
method_check && method_filter
133147
},
134148

135149
// define a new 'id' by appending the method name to the dataset id
@@ -160,6 +174,18 @@ workflow run_wf {
160174
id: { id, state, comp ->
161175
id + "." + comp.config.name
162176
},
177+
filter: { id, state, comp ->
178+
// filter by metric_ids
179+
def metric_check = checkItemAllowed(
180+
comp.config.name,
181+
state.metrics_include,
182+
state.metrics_exclude,
183+
"metrics_include",
184+
"metrics_exclude"
185+
)
186+
// filter by method_id
187+
metric_check
188+
},
163189
// use 'fromState' to fetch the arguments the component requires from the overall state
164190
fromState: [
165191
input_unintegrated: "input_unintegrated",

0 commit comments

Comments
 (0)