Skip to content

Commit 6019b70

Browse files
committed
Add aggreagtion and quality metrics prototypical to workflow
1 parent 4f8e766 commit 6019b70

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

src/workflows/run_benchmark/main.nf

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,77 @@ workflow run_wf {
439439
}
440440
)
441441

442+
443+
/****************************************
444+
* AGGREGATE PROCESSED SPATIAL DATA *
445+
****************************************/
446+
447+
agg_spatial_data_methods = [
448+
aggregate_spatial_data
449+
]
450+
451+
agg_spatial_data_ch = expr_corr_ch
452+
| runEach(
453+
components: agg_spatial_data_methods,
454+
//filter: { id, state, comp ->
455+
// comp.config.name == state.current_method_id
456+
//},
457+
id: { id, state, comp ->
458+
id + "/agg_spatial_data_" + comp.name
459+
},
460+
fromState: { id, state, comp ->
461+
[
462+
input_raw_sp: state.input_sp,
463+
input_transcript_assignments: state.output_assignment,
464+
input_qc_col: state.output_qc_filter,
465+
input_spatial_corrected_counts: state.output_correction,
466+
]
467+
},
468+
toState: { id, out_dict, state, comp ->
469+
state + [
470+
steps: state.steps + [[
471+
type: "aggregate_spatial_data",
472+
component_id: comp.name,
473+
run_id: id
474+
]],
475+
output_agg_spatial_data: out_dict.output
476+
]
477+
}
478+
)
479+
480+
/*****************************
481+
* QUALITY METRICS *
482+
*****************************/
483+
484+
quality_metrics_methods = [
485+
quality_metrics
486+
]
487+
488+
quality_metrics_ch = agg_spatial_data_ch
489+
| runEach(
490+
components: quality_metrics_methods,
491+
id: { id, state, comp ->
492+
id + "/quality_metrics_" + comp.name
493+
},
494+
fromState: { id, state, comp ->
495+
[
496+
input: state.output_agg_spatial_data,
497+
]
498+
},
499+
toState: { id, out_dict, state, comp ->
500+
state + [
501+
steps: state.steps + [[
502+
type: "quality_metrics",
503+
component_id: comp.name,
504+
run_id: id
505+
]],
506+
output_quality_metrics: out_dict.output
507+
]
508+
}
509+
)
510+
511+
512+
442513
/****************************************
443514
* COMBINE WITH CONTROL *
444515
****************************************/

0 commit comments

Comments
 (0)