diff --git a/modules/nf-core/samtools/mpileup/main.nf b/modules/nf-core/samtools/mpileup/main.nf index 8a3ff75eb4a..925c8244e09 100644 --- a/modules/nf-core/samtools/mpileup/main.nf +++ b/modules/nf-core/samtools/mpileup/main.nf @@ -6,13 +6,14 @@ process SAMTOOLS_MPILEUP { container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://depot.galaxyproject.org/singularity/samtools:1.21--h50ea8bc_0' : 'biocontainers/samtools:1.21--h50ea8bc_0' }" + input: tuple val(meta), path(input), path(intervals) path fasta output: tuple val(meta), path("*.mpileup.gz"), emit: mpileup - path "versions.yml" , emit: versions + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when @@ -20,15 +21,29 @@ process SAMTOOLS_MPILEUP { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - intervals = intervals ? "-l ${intervals}" : "" + def intervals_arg = intervals ? "-l ${intervals}" : "" """ samtools mpileup \\ --fasta-ref $fasta \\ --output ${prefix}.mpileup \\ $args \\ - $intervals \\ + $intervals_arg \\ $input bgzip ${prefix}.mpileup + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def intervals_arg = intervals ? "-l ${intervals}" : "" + """ + touch ${prefix}.mpileup.gz + cat <<-END_VERSIONS > versions.yml "${task.process}": samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')