|
| 1 | +include { checkItemAllowed } from "${meta.resources_dir}/helper.nf" |
| 2 | + |
1 | 3 | workflow auto { |
2 | 4 | findStates(params, meta.config) |
3 | 5 | | meta.workflow.run( |
@@ -81,9 +83,15 @@ workflow run_wf { |
81 | 83 |
|
82 | 84 | // run only non-control methods & filter by method_ids |
83 | 85 | 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 | + ) |
85 | 93 | def method_filter = comp.config.info.type == "method" |
86 | | - id_filter && method_filter |
| 94 | + method_check && method_filter |
87 | 95 | }, |
88 | 96 |
|
89 | 97 | // define a new 'id' by appending the method name to the dataset id |
@@ -127,9 +135,15 @@ workflow run_wf { |
127 | 135 |
|
128 | 136 | // run only control methods & filter by method_ids |
129 | 137 | 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 | + ) |
131 | 145 | def method_filter = comp.config.info.type == "control_method" |
132 | | - id_filter && method_filter |
| 146 | + method_check && method_filter |
133 | 147 | }, |
134 | 148 |
|
135 | 149 | // define a new 'id' by appending the method name to the dataset id |
@@ -160,6 +174,18 @@ workflow run_wf { |
160 | 174 | id: { id, state, comp -> |
161 | 175 | id + "." + comp.config.name |
162 | 176 | }, |
| 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 | + }, |
163 | 189 | // use 'fromState' to fetch the arguments the component requires from the overall state |
164 | 190 | fromState: [ |
165 | 191 | input_unintegrated: "input_unintegrated", |
|
0 commit comments