@@ -104,14 +104,35 @@ workflow CHIPSEQ {
104104
105105 main :
106106 ch_multiqc_files = channel. empty()
107+
108+ //
109+ // Collection versions from topic channel
110+ //
111+ def topic_versions = channel. topic(" versions" )
112+ .distinct()
113+ .branch { entry ->
114+ versions_file : entry instanceof Path
115+ versions_tuple : true
116+ }
117+
118+ def topic_versions_string = topic_versions. versions_tuple
119+ .map { process, tool, version ->
120+ [ process[process. lastIndexOf(' :' )+1 .. -1 ], " ${ tool} : ${ version} " ]
121+ }
122+ .groupTuple(by :0 )
123+ .map { process, tool_versions ->
124+ tool_versions. unique(). sort()
125+ " ${ process} :\n ${ tool_versions.join('\n')} "
126+ }
127+
107128 //
108129 // SUBWORKFLOW: Read in samplesheet, validate and stage input files
109130 //
110131 INPUT_CHECK (
111132 ch_samplesheet,
112133 params. seq_center
113134 )
114- ch_versions = ch_versions. mix(INPUT_CHECK . out. versions)
135+ ch_versions = ch_versions. mix(INPUT_CHECK . out. versions) // This has to be fixed!
115136 // TODO: OPTIONAL, you can use nf-validation plugin to create an input channel from the samplesheet with Channel.fromSamplesheet("input")
116137 // See the documentation https://nextflow-io.github.io/nf-validation/samplesheets/fromSamplesheet/
117138 // ! There is currently no tooling to help you write a sample sheet schema
@@ -521,31 +542,14 @@ workflow CHIPSEQ {
521542 //
522543 // Collate and save software versions
523544 //
524- def topic_versions = Channel . topic(" versions" )
525- .distinct()
526- .branch { entry ->
527- versions_file : entry instanceof Path
528- versions_tuple : true
529- }
530-
531- def topic_versions_string = topic_versions. versions_tuple
532- .map { process, tool, version ->
533- [ process[process. lastIndexOf(' :' )+1 .. -1 ], " ${ tool} : ${ version} " ]
534- }
535- .groupTuple(by :0 )
536- .map { process, tool_versions ->
537- tool_versions. unique(). sort()
538- " ${ process} :\n ${ tool_versions.join('\n')} "
539- }
540-
541- softwareVersionsToYAML(ch_versions. mix(topic_versions. versions_file))
545+ ch_collated_versions = softwareVersionsToYAML(ch_versions. mix(topic_versions. versions_file))
542546 .mix(topic_versions_string)
543547 .collectFile(
544548 storeDir : " ${ params.outdir} /pipeline_info" ,
545549 name : ' nf_core_' + ' chipseq_software_' + ' mqc_' + ' versions.yml' ,
546550 sort : true ,
547551 newLine : true
548- ). set { ch_collated_versions }
552+ )
549553
550554 //
551555 // MODULE: MultiQC
0 commit comments