From 9391d7cf4d13dc32e73e10d60eff5f658be95f7b Mon Sep 17 00:00:00 2001 From: maxulysse Date: Tue, 4 Nov 2025 13:46:54 +0100 Subject: [PATCH 1/2] simplify TEMPLATE with nf-core-utils 0.4.0 --- nf_core/pipeline-template/nextflow.config | 3 +- .../pipeline-template/workflows/pipeline.nf | 36 ++++++------------- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index ccd9a797cb..b1ecae40ab 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -321,7 +321,8 @@ manifest { {% if nf_schema -%} // Nextflow plugins plugins { - id 'nf-schema@2.5.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-schema@2.5.1' // Validation of pipeline parameters and creation of an input channel from a sample sheet + id 'nf-core-utils@0.4.0' // Helper functions for pipeline } validation { diff --git a/nf_core/pipeline-template/workflows/pipeline.nf b/nf_core/pipeline-template/workflows/pipeline.nf index 94bdae9895..dc2f73af80 100644 --- a/nf_core/pipeline-template/workflows/pipeline.nf +++ b/nf_core/pipeline-template/workflows/pipeline.nf @@ -13,7 +13,7 @@ include { MULTIQC } from '../modules/nf-core/multiqc/main'{% endi include { paramsSummaryMap } from 'plugin/nf-schema'{% endif %} {%- if multiqc %} include { paramsSummaryMultiqc } from '../subworkflows/nf-core/utils_nfcore_pipeline'{% endif %} -include { softwareVersionsToYAML } from '../subworkflows/nf-core/utils_nfcore_pipeline' +include { softwareVersionsToYAML } from 'plugin/nf-core-utils' {%- if citations or multiqc %} include { methodsDescriptionText } from '../subworkflows/local/utils_nfcore_{{ short_name }}_pipeline'{% endif %} {%- endif %} @@ -50,31 +50,15 @@ workflow {{ short_name|upper }} { // // Collate and save software versions // - def topic_versions = Channel.topic("versions") - .distinct() - .branch { entry -> - versions_file: entry instanceof Path - versions_tuple: true - } - - def topic_versions_string = topic_versions.versions_tuple - .map { process, tool, version -> - [ process[process.lastIndexOf(':')+1..-1], " ${tool}: ${version}" ] - } - .groupTuple(by:0) - .map { process, tool_versions -> - tool_versions.unique().sort() - "${process}:\n${tool_versions.join('\n')}" - } - - softwareVersionsToYAML(ch_versions.mix(topic_versions.versions_file)) - .mix(topic_versions_string) - .collectFile( - storeDir: "${params.outdir}/pipeline_info", - name: {% if is_nfcore %}'nf_core_' + {% endif %} '{{ short_name }}_software_' {% if multiqc %} + 'mqc_' {% endif %} + 'versions.yml', - sort: true, - newLine: true - ).set { ch_collated_versions } + softwareVersionsToYAML( + softwareVersions: ch_versions.mix(channel.topic("versions")), + nextflowVersion: workflow.nextflow.version + ).collectFile( + storeDir: "${params.outdir}/pipeline_info", + name: {% if is_nfcore %}'nf_core_' + {% endif %} '{{ short_name }}_software_' {% if multiqc %} + 'mqc_' {% endif %} + 'versions.yml', + sort: true, + newLine: true, + ).set { ch_collated_versions } {% if multiqc %} // From 0771605cab644040b81f1cd223ca122bd9ec8d26 Mon Sep 17 00:00:00 2001 From: nf-core-bot Date: Tue, 4 Nov 2025 12:48:04 +0000 Subject: [PATCH 2/2] [automated] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9633bd0db..722b84afc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ ### Template +- simplify TEMPLATE with nf-core-utils 0.4.0 ([#3870](https://github.com/nf-core/tools/pull/3870)) + ### Linting ### Modules