diff --git a/nf_core/pipeline-template/main.nf b/nf_core/pipeline-template/main.nf index c13a0d24e1..4b21d29d8f 100644 --- a/nf_core/pipeline-template/main.nf +++ b/nf_core/pipeline-template/main.nf @@ -11,6 +11,8 @@ ---------------------------------------------------------------------------------------- */ +nextflow.preview.topic = true + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IMPORT FUNCTIONS / MODULES / SUBWORKFLOWS / WORKFLOWS diff --git a/nf_core/pipeline-template/modules/nf-core/fastqc/main.nf b/nf_core/pipeline-template/modules/nf-core/fastqc/main.nf index d79f1c862d..10c78c97bb 100644 --- a/nf_core/pipeline-template/modules/nf-core/fastqc/main.nf +++ b/nf_core/pipeline-template/modules/nf-core/fastqc/main.nf @@ -13,7 +13,9 @@ process FASTQC { output: tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.zip") , emit: zip + path "versions.yml" , emit: versions + tuple val("$task.process"), val("FastQC"), eval("fastqc --version | sed '/FastQC v/!d; s/.*v//'"), topic: version when: task.ext.when == null || task.ext.when diff --git a/nf_core/pipeline-template/modules/nf-core/multiqc/main.nf b/nf_core/pipeline-template/modules/nf-core/multiqc/main.nf index 47ac352f94..50f4e4be23 100644 --- a/nf_core/pipeline-template/modules/nf-core/multiqc/main.nf +++ b/nf_core/pipeline-template/modules/nf-core/multiqc/main.nf @@ -16,7 +16,7 @@ process MULTIQC { path "*multiqc_report.html", emit: report path "*_data" , emit: data path "*_plots" , optional:true, emit: plots - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions, topic: version_yaml when: task.ext.when == null || task.ext.when diff --git a/nf_core/pipeline-template/nextflow.config b/nf_core/pipeline-template/nextflow.config index 2e6a56b001..c1b915597f 100644 --- a/nf_core/pipeline-template/nextflow.config +++ b/nf_core/pipeline-template/nextflow.config @@ -258,7 +258,7 @@ manifest { homePage = 'https://github.com/{{ name }}' description = """{{ description }}""" mainScript = 'main.nf' - nextflowVersion = '!>=23.04.0' + nextflowVersion = '!>=23.11.0-edge' version = '{{ version }}' doi = '' } diff --git a/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf b/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf index 14558c3927..ba8d877ed8 100644 --- a/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf +++ b/nf_core/pipeline-template/subworkflows/nf-core/utils_nfcore_pipeline/main.nf @@ -107,15 +107,31 @@ def processVersionsFromYAML(yaml_file) { return yaml.dumpAsMap(versions).trim() } +// +// Get topic version for make it a YAML +// Expects: tuple val("$task.process"), val("PINTS"), eval("pints_caller --version") +// +def topicVersionToYAML(topic_version) { + def (taskProcess, tools, versions) = topic_version + + def toolsVersions = [tools, versions] + .transpose() + .collect { k, v -> "${k}: ${v}" } + return """ + |${taskProcess.tokenize(':').last()}: + | ${toolsVersions.join('\n| ')} + """.stripMargin().trim() +} + // // Get workflow version for pipeline // def workflowVersionToYAML() { return """ - Workflow: - $workflow.manifest.name: ${getWorkflowVersion()} - Nextflow: $workflow.nextflow.version - """.stripIndent().trim() + |Workflow: + | $workflow.manifest.name: ${getWorkflowVersion()} + | Nextflow: $workflow.nextflow.version + """.stripMargin().trim() } // @@ -125,6 +141,23 @@ def softwareVersionsToYAML(ch_versions) { return ch_versions .unique() .map { processVersionsFromYAML(it) } + .mix( + Channel.topic('version') + .unique() + .groupTuple(by: 0) + .map { topicVersionToYAML(it) } + ) + .mix( + Channel.topic('version_yaml') + .unique() + .map {processVersionsFromYAML(it)} + ) + .unique() + .mix( + Channel.topic('version_yaml') + .unique() + .map {processVersionsFromYAML(it)} + ) .unique() .mix(Channel.of(workflowVersionToYAML())) }