Skip to content

Commit

Permalink
Pass layout to the report stage
Browse files Browse the repository at this point in the history
  • Loading branch information
johandahlberg committed May 27, 2024
1 parent 1d2fcde commit bd29d2c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/local/pixelator/single-cell/report/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ process PIXELATOR_REPORT {
path graph_data , stageAs: "results/graph/*"
path annotate_data , stageAs: "results/annotate/*"
path analysis_data , stageAs: "results/analysis/*"
path layout_data , stageAs: "results/layout/*"


output:
Expand Down
5 changes: 5 additions & 0 deletions subworkflows/local/generate_reports.nf
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ workflow GENERATE_REPORTS {
graph_data // channel: [meta, [path, ...]]
annotate_data // channel: [meta, [path, ...]]
analysis_data // channel: [meta, [path, ...]]
layout_data // channel: [meta, [path, ...]]

main:
ch_versions = Channel.empty()
Expand Down Expand Up @@ -57,6 +58,7 @@ workflow GENERATE_REPORTS {
ch_graph_col = graph_data.map { meta, data -> [meta.id, data] }
ch_annotate_col = annotate_data.map { meta, data -> [meta.id, data] }
ch_analysis_col = analysis_data.map { meta, data -> [meta.id, data] }
ch_layout_col = layout_data.map { meta, data -> [meta.id, data] }

//
// Combine all inputs and group them, then split them up again.
Expand Down Expand Up @@ -87,6 +89,7 @@ workflow GENERATE_REPORTS {
.concat ( ch_graph_col )
.concat ( ch_annotate_col )
.concat ( ch_analysis_col )
.concat ( ch_layout_col )
.groupTuple (size: 10)

//
Expand All @@ -108,6 +111,7 @@ workflow GENERATE_REPORTS {
ch_graph_grouped = ch_report_data.map { id, data -> data[7] ? data[7].flatten() : [] }
ch_annotate_grouped = ch_report_data.map { id, data -> data[8] ? data[8].flatten() : [] }
ch_analysis_grouped = ch_report_data.map { id, data -> data[9] ? data[9].flatten() : [] }
ch_layout_grouped = ch_report_data.map { id, data -> data[10] ? data[10].flatten() : [] }

//
// MODULE: Run pixelator single-cell report for each samples
Expand All @@ -124,6 +128,7 @@ workflow GENERATE_REPORTS {
ch_graph_grouped,
ch_annotate_grouped,
ch_analysis_grouped,
ch_layout_grouped,
)

ch_versions = ch_versions.mix(PIXELATOR_REPORT.out.versions.first())
Expand Down
5 changes: 4 additions & 1 deletion workflows/pixelator.nf
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ workflow PIXELATOR {

//
// MODULE: Run pixelator single-cell layout
//
PIXELATOR_LAYOUT ( ch_analysed )
ch_layout = PIXELATOR_LAYOUT.out.dataset
ch_versions = ch_versions.mix(PIXELATOR_LAYOUT.out.versions.first())
Expand Down Expand Up @@ -230,6 +231,7 @@ workflow PIXELATOR {
ch_cluster_data = PIXELATOR_GRAPH.out.all_results
ch_annotate_data = PIXELATOR_ANNOTATE.out.all_results
ch_analysis_data = PIXELATOR_ANALYSIS.out.all_results
ch_layout_data = PIXELATOR_ANALYSIS.out.all_results

GENERATE_REPORTS(
ch_cat_panel_files,
Expand All @@ -240,7 +242,8 @@ workflow PIXELATOR {
ch_collapse_data,
ch_cluster_data,
ch_annotate_data,
ch_analysis_data
ch_analysis_data,
ch_layout_data
)

ch_versions = ch_versions.mix(GENERATE_REPORTS.out.versions)
Expand Down

0 comments on commit bd29d2c

Please sign in to comment.