diff --git a/common b/common index e64f472b..dabb6cef 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit e64f472b37f1bdbd383640098708ecf5c9f7fd7e +Subproject commit dabb6cef9a735e27cfc859a7afc9f5d6685f8635 diff --git a/src/workflows/run_benchmark/config.vsh.yaml b/src/workflows/run_benchmark/config.vsh.yaml index f70f9b43..62de9065 100644 --- a/src/workflows/run_benchmark/config.vsh.yaml +++ b/src/workflows/run_benchmark/config.vsh.yaml @@ -42,12 +42,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 @@ -55,6 +67,7 @@ resources: entrypoint: run_wf - type: file path: /_viash.yaml + - path: /common/nextflow_helpers/helper.nf dependencies: - name: h5ad/extract_uns_metadata diff --git a/src/workflows/run_benchmark/main.nf b/src/workflows/run_benchmark/main.nf index ff77ad8d..de64fbee 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( @@ -55,7 +57,7 @@ workflow run_wf { ****************************/ dataset_ch = input_ch // store join id - | map{ id, state -> + | map{ id, state -> [id, state + ["_meta": [join_id: id]]] } @@ -72,6 +74,7 @@ workflow run_wf { /*************************** * RUN METHODS AND METRICS * ***************************/ + score_ch = dataset_ch // run all methods @@ -85,7 +88,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 }, @@ -153,7 +162,7 @@ workflow run_wf { }, // use 'fromState' to fetch the arguments the component requires from the overall state fromState: [ - input_solution: "input_solution", + input_solution: "input_solution", input_integrated: "method_output_cleaned" ], // use 'toState' to publish that component's outputs to the overall state