@@ -40,53 +40,43 @@ workflow POST_PROCESSING {
4040 ch_comparison_report_files = channel. empty()
4141
4242 if (! skip_visualisation){
43+ ch_report_input
44+ .multiMap { meta, pdbs, msa, pae ->
45+ full : [meta, pdbs, msa, pae]
46+ msa_only : [meta, msa]
47+ }
48+ .set { ch_report_split }
49+
4350 GENERATE_REPORT (
44- ch_report_input ,
51+ ch_report_split . full ,
4552 ch_report_template
4653 )
4754 ch_versions = ch_versions. mix(GENERATE_REPORT . out. versions)
4855
4956 if (requested_modes_size > 1 ){
50- // Multi-mode comparison: group structures and coverage data from all modes
57+ // Multi-mode comparison: group top-ranked structures and MSA data from all modes
5158 ch_top_ranked_model
52- .map { meta, pdb ->
53- [[" id" : meta. id], meta, pdb]
59+ .join(ch_report_split. msa_only)
60+ .map { meta, pdb, msa ->
61+ [[" id" : meta. id], meta, pdb, msa]
5462 }
55- .join(
56- GENERATE_REPORT . out. sequence_coverage,
57- by : [0 ],
58- remainder : true // Include models without coverage (e.g., ESMFold)
59- )
6063 .groupTuple(by : [0 ], size : requested_modes_size)
61- .map { key, model_meta_list, coverage_list ->
62- key. models = model_meta_list. collect { meta, pdb -> meta. model }. join(' ,' )
63- [key, model_meta_list. collect { meta , pdb -> pdb }, coverage_list]
64- }
65- .set { ch_comparison_report_input }
66-
67- // Separate channel components for clarity
68- ch_comparison_report_input
69- .map { meta, structures, coverage ->
70- [meta, structures. collect { f -> f. name }]
64+ .map { key, model_meta_list, pdbs, msas ->
65+ def models_str = model_meta_list. collect { it. model }. join(' ,' )
66+ [key + [models : models_str], pdbs, msas]
7167 }
72- .set { ch_pdb_input }
73-
74- ch_comparison_report_input
75- .map { meta, structures, coverage ->
76- [meta, coverage. findAll { f -> f != null }. collect { f -> f. name }]
77- }
78- .set { ch_msa_input }
79-
80- ch_comparison_report_input
81- .map { meta, structures, coverage ->
82- (structures + coverage. findAll { f -> f != null }). unique()
68+ .multiMap { meta, pdbs, msas ->
69+ def valid_msas = msas. findAll { ! it. name. startsWith(" DUMMY_" ) }
70+ pdbs : [meta, pdbs. collect { it. name }]
71+ msas : [meta, valid_msas. collect { it. name }]
72+ allfiles : (pdbs + valid_msas). unique()
8373 }
84- .set { ch_all_files }
74+ .set { ch_split }
8575
8676 COMPARE_STRUCTURES (
87- ch_pdb_input ,
88- ch_msa_input ,
89- ch_all_files ,
77+ ch_split . pdbs ,
78+ ch_split . msas ,
79+ ch_split . allfiles ,
9080 ch_report_template
9181 )
9282 ch_versions = ch_versions. mix(COMPARE_STRUCTURES . out. versions)
@@ -127,26 +117,21 @@ workflow POST_PROCESSING {
127117 ch_workflow_summary = channel. value(paramsSummaryMultiqc(summary_params))
128118 ch_methods_description = channel. value(methodsDescriptionText(ch_multiqc_methods_description))
129119
130- ch_multiqc_files = channel. empty()
131- ch_multiqc_files = ch_multiqc_files. mix(ch_workflow_summary. collectFile(name : ' workflow_summary_mqc.yaml' ))
132- ch_multiqc_files = ch_multiqc_files. mix(ch_methods_description. collectFile(name : ' methods_description_mqc.yaml' ))
133- ch_multiqc_files = ch_multiqc_files. mix(ch_collated_versions)
120+ ch_multiqc_files = ch_workflow_summary. collectFile(name : ' workflow_summary_mqc.yaml' )
121+ .mix(ch_methods_description. collectFile(name : ' methods_description_mqc.yaml' ))
122+ .mix(ch_collated_versions)
134123
135124 MULTIQC (
136125 ch_multiqc_rep
137126 .combine(
138127 ch_multiqc_files
139128 .collect()
140- .map { it -> [it] }
129+ .map { [it] }
141130 )
142131 .map { meta , report_files , multiqc_files -> [ meta, report_files + multiqc_files ] },
143132 ch_multiqc_config,
144- ch_multiqc_custom_config
145- .collect()
146- .ifEmpty([]),
147- ch_multiqc_logo
148- .collect()
149- .ifEmpty([]),
133+ ch_multiqc_custom_config. toList(),
134+ ch_multiqc_logo. toList(),
150135 [],
151136 []
152137 )
0 commit comments