diff --git a/nf_core/module-template/modules/main.nf b/nf_core/module-template/modules/main.nf index 457f2b39bc..26703aeb57 100644 --- a/nf_core/module-template/modules/main.nf +++ b/nf_core/module-template/modules/main.nf @@ -52,11 +52,11 @@ process {{ tool_name_underscore|upper }} { // TODO nf-core: Named file extensions MUST be emitted for ALL output channels {{ 'tuple val(meta), path("*.bam")' if has_meta else 'path "*.bam"' }}, emit: bam // TODO nf-core: List additional required output channels/values here - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: {% if has_meta -%} - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" {%- endif %} // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 // If the software is unable to output a version number on the command-line then it can be manually specified @@ -80,7 +80,7 @@ process {{ tool_name_underscore|upper }} { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - samtools: \$( samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//' ) + ${getSoftwareName(task.process)}: \$( samtools --version 2>&1 | sed 's/^.*samtools //; s/Using.*\$//' ) END_VERSIONS """ } diff --git a/nf_core/module-template/modules/meta.yml b/nf_core/module-template/modules/meta.yml index c42dd613bd..d58df5a371 100644 --- a/nf_core/module-template/modules/meta.yml +++ b/nf_core/module-template/modules/meta.yml @@ -37,9 +37,9 @@ output: Groovy Map containing sample information e.g. [ id:'test', single_end:false ] {% endif -%} - - version: + - versions: type: file - description: File containing software version + description: File containing software versions pattern: "versions.yml" ## TODO nf-core: Delete / customise this example output - bam: diff --git a/nf_core/pipeline-template/modules.json b/nf_core/pipeline-template/modules.json index c828028317..a225b686a8 100644 --- a/nf_core/pipeline-template/modules.json +++ b/nf_core/pipeline-template/modules.json @@ -4,13 +4,13 @@ "repos": { "nf-core/modules": { "custom/dumpsoftwareversions": { - "git_sha": "22ec5c6007159d441585ef54bfa6272b6f93c78a" + "git_sha": "7b3315591a149609e27914965f858c9a7e071564" }, "fastqc": { - "git_sha": "ab67a1d41b63bf52fd7c147f7f8f6e8d167590b5" + "git_sha": "7b3315591a149609e27914965f858c9a7e071564" }, "multiqc": { - "git_sha": "ab67a1d41b63bf52fd7c147f7f8f6e8d167590b5" + "git_sha": "7b3315591a149609e27914965f858c9a7e071564" } } } diff --git a/nf_core/pipeline-template/modules/local/samplesheet_check.nf b/nf_core/pipeline-template/modules/local/samplesheet_check.nf index 9bada69b98..b8354f35e4 100644 --- a/nf_core/pipeline-template/modules/local/samplesheet_check.nf +++ b/nf_core/pipeline-template/modules/local/samplesheet_check.nf @@ -1,5 +1,5 @@ // Import generic module functions -include { saveFiles } from './functions' +include { saveFiles; getProcessName } from './functions' params.options = [:] @@ -20,12 +20,18 @@ process SAMPLESHEET_CHECK { path samplesheet output: - path '*.csv' + path '*.csv' , emit: csv + path "versions.yml", emit: versions script: // This script is bundled with the pipeline, in {{ name }}/bin/ """ check_samplesheet.py \\ $samplesheet \\ samplesheet.valid.csv + + cat <<-END_VERSIONS > versions.yml + ${getProcessName(task.process)}: + python: \$(python --version | sed 's/Python //g') + END_VERSIONS """ } diff --git a/nf_core/pipeline-template/modules/nf-core/modules/custom/dumpsoftwareversions/main.nf b/nf_core/pipeline-template/modules/nf-core/modules/custom/dumpsoftwareversions/main.nf index 8424ab07b8..cf10a8e072 100644 --- a/nf_core/pipeline-template/modules/nf-core/modules/custom/dumpsoftwareversions/main.nf +++ b/nf_core/pipeline-template/modules/nf-core/modules/custom/dumpsoftwareversions/main.nf @@ -22,9 +22,9 @@ process CUSTOM_DUMPSOFTWAREVERSIONS { path versions output: - path 'software_versions.yml' , emit: yml - path 'software_versions_mqc.yml', emit: mqc_yml - path 'versions.yml' , emit: versions + path "software_versions.yml" , emit: yml + path "software_versions_mqc.yml", emit: mqc_yml + path "versions.yml" , emit: versions script: """ diff --git a/nf_core/pipeline-template/modules/nf-core/modules/fastqc/main.nf b/nf_core/pipeline-template/modules/nf-core/modules/fastqc/main.nf index 88bfbf5b02..9f6cfc5538 100644 --- a/nf_core/pipeline-template/modules/nf-core/modules/fastqc/main.nf +++ b/nf_core/pipeline-template/modules/nf-core/modules/fastqc/main.nf @@ -24,11 +24,11 @@ process FASTQC { output: tuple val(meta), path("*.html"), emit: html tuple val(meta), path("*.zip") , emit: zip - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: // Add soft-links to original FastQs for consistent naming in pipeline - def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" + def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}" if (meta.single_end) { """ [ ! -f ${prefix}.fastq.gz ] && ln -s $reads ${prefix}.fastq.gz @@ -36,7 +36,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + ${getSoftwareName(task.process)}: \$( fastqc --version | sed -e "s/FastQC v//g" ) END_VERSIONS """ } else { @@ -47,7 +47,7 @@ process FASTQC { cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - fastqc: \$( fastqc --version | sed -e "s/FastQC v//g" ) + ${getSoftwareName(task.process)}: \$( fastqc --version | sed -e "s/FastQC v//g" ) END_VERSIONS """ } diff --git a/nf_core/pipeline-template/modules/nf-core/modules/multiqc/main.nf b/nf_core/pipeline-template/modules/nf-core/modules/multiqc/main.nf index 2e7ad932e5..0861aa5934 100644 --- a/nf_core/pipeline-template/modules/nf-core/modules/multiqc/main.nf +++ b/nf_core/pipeline-template/modules/nf-core/modules/multiqc/main.nf @@ -24,16 +24,15 @@ process MULTIQC { path "*multiqc_report.html", emit: report path "*_data" , emit: data path "*_plots" , optional:true, emit: plots - path "versions.yml" , emit: version + path "versions.yml" , emit: versions script: - def software = getSoftwareName(task.process) """ multiqc -f $options.args . cat <<-END_VERSIONS > versions.yml ${getProcessName(task.process)}: - multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" ) + ${getSoftwareName(task.process)}: \$( multiqc --version | sed -e "s/multiqc, version //g" ) END_VERSIONS """ } diff --git a/nf_core/pipeline-template/subworkflows/local/input_check.nf b/nf_core/pipeline-template/subworkflows/local/input_check.nf index b664bc8caf..c1b071961c 100644 --- a/nf_core/pipeline-template/subworkflows/local/input_check.nf +++ b/nf_core/pipeline-template/subworkflows/local/input_check.nf @@ -12,12 +12,14 @@ workflow INPUT_CHECK { main: SAMPLESHEET_CHECK ( samplesheet ) + .csv .splitCsv ( header:true, sep:',' ) .map { create_fastq_channels(it) } .set { reads } emit: - reads // channel: [ val(meta), [ reads ] ] + reads // channel: [ val(meta), [ reads ] ] + versions = SAMPLESHEET_CHECK.out.versions // channel: [ versions.yml ] } // Function to get list of [ meta, [ fastq_1, fastq_2 ] ] diff --git a/nf_core/pipeline-template/workflows/pipeline.nf b/nf_core/pipeline-template/workflows/pipeline.nf index 4239f20f50..0682ed96cc 100644 --- a/nf_core/pipeline-template/workflows/pipeline.nf +++ b/nf_core/pipeline-template/workflows/pipeline.nf @@ -67,7 +67,7 @@ def multiqc_report = [] workflow {{ short_name|upper }} { - ch_software_versions = Channel.empty() + ch_versions = Channel.empty() // // SUBWORKFLOW: Read in samplesheet, validate and stage input files @@ -75,6 +75,7 @@ workflow {{ short_name|upper }} { INPUT_CHECK ( ch_input ) + ch_versions = ch_versions.mix(INPUT_CHECK.out.versions) // // MODULE: Run FastQC @@ -82,10 +83,10 @@ workflow {{ short_name|upper }} { FASTQC ( INPUT_CHECK.out.reads ) - ch_software_versions = ch_software_versions.mix(FASTQC.out.version.first().ifEmpty(null)) + ch_versions = ch_versions.mix(FASTQC.out.versions.first()) CUSTOM_DUMPSOFTWAREVERSIONS ( - ch_software_versions.collectFile() + ch_versions.collectFile() ) // @@ -104,8 +105,8 @@ workflow {{ short_name|upper }} { MULTIQC ( ch_multiqc_files.collect() ) - multiqc_report = MULTIQC.out.report.toList() - ch_software_versions = ch_software_versions.mix(MULTIQC.out.version.ifEmpty(null)) + multiqc_report = MULTIQC.out.report.toList() + ch_versions = ch_versions.mix(MULTIQC.out.versions) } /*