@@ -40,8 +40,8 @@ workflow VCFTOMAF {
4040
4141 main :
4242
43- ch_versions = Channel . empty()
44- ch_multiqc_files = Channel . empty()
43+ ch_versions = channel . empty()
44+ ch_multiqc_files = channel . empty()
4545
4646 //
4747 // SUBWORKFLOW: Read in samplesheet, validate and stage input files
@@ -121,20 +121,43 @@ workflow VCFTOMAF {
121121 //
122122 // Collate and save software versions
123123 //
124- softwareVersionsToYAML(ch_versions)
125- .collectFile(storeDir : " ${ params.outdir} /pipeline_info" , name : ' nf_core_pipeline_software_mqc_versions.yml' , sort : true , newLine : true )
124+ def topic_versions = channel. topic(" versions" )
125+ .distinct()
126+ .branch { entry ->
127+ versions_file : entry instanceof Path
128+ versions_tuple : true
129+ }
130+
131+ def topic_versions_string = topic_versions. versions_tuple
132+ .map { process, tool, version ->
133+ [process[process. lastIndexOf(' :' ) + 1 .. -1 ], " ${ tool} : ${ version} " ]
134+ }
135+ .groupTuple(by : 0 )
136+ .map { process, tool_versions ->
137+ tool_versions. unique(). sort()
138+ " ${ process} :\n ${ tool_versions.join('\n')} "
139+ }
140+
141+ softwareVersionsToYAML(ch_versions. mix(topic_versions. versions_file))
142+ .mix(topic_versions_string)
143+ .collectFile(
144+ storeDir : " ${ params.outdir} /pipeline_info" ,
145+ name : ' nf_core_' + ' pipeline_software_' + ' mqc_' + ' versions.yml' ,
146+ sort : true ,
147+ newLine : true ,
148+ )
126149 .set { ch_collated_versions }
127150
128151 //
129152 // MODULE: MultiQC
130153 //
131- ch_multiqc_config = Channel . fromPath(" $projectDir /assets/multiqc_config.yml" , checkIfExists : true )
132- ch_multiqc_custom_config = params. multiqc_config ? Channel . fromPath(params. multiqc_config, checkIfExists : true ) : Channel . empty()
133- ch_multiqc_logo = params. multiqc_logo ? Channel . fromPath(params. multiqc_logo, checkIfExists : true ) : Channel . empty()
154+ ch_multiqc_config = channel . fromPath(" $projectDir /assets/multiqc_config.yml" , checkIfExists : true )
155+ ch_multiqc_custom_config = params. multiqc_config ? channel . fromPath(params. multiqc_config, checkIfExists : true ) : channel . empty()
156+ ch_multiqc_logo = params. multiqc_logo ? channel . fromPath(params. multiqc_logo, checkIfExists : true ) : channel . empty()
134157 summary_params = paramsSummaryMap(workflow, parameters_schema : " nextflow_schema.json" )
135- ch_workflow_summary = Channel . value(paramsSummaryMultiqc(summary_params))
158+ ch_workflow_summary = channel . value(paramsSummaryMultiqc(summary_params))
136159 ch_multiqc_custom_methods_description = params. multiqc_methods_description ? file(params. multiqc_methods_description, checkIfExists : true ) : file(" $projectDir /assets/methods_description_template.yml" , checkIfExists : true )
137- ch_methods_description = Channel . value(methodsDescriptionText(ch_multiqc_custom_methods_description))
160+ ch_methods_description = channel . value(methodsDescriptionText(ch_multiqc_custom_methods_description))
138161 ch_multiqc_files = ch_multiqc_files. mix(ch_workflow_summary. collectFile(name : ' workflow_summary_mqc.yaml' ))
139162 ch_multiqc_files = ch_multiqc_files. mix(ch_collated_versions)
140163 ch_multiqc_files = ch_multiqc_files. mix(ch_methods_description. collectFile(name : ' methods_description_mqc.yaml' , sort : false ))
0 commit comments