Skip to content

Commit

Permalink
add stub test for samtools/mpileup (#7192)
Browse files Browse the repository at this point in the history
add stub test
  • Loading branch information
FriederikeHanssen authored Dec 10, 2024
1 parent d752b3e commit 13e7d10
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions modules/nf-core/samtools/mpileup/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,44 @@ 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

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.*\$//')
Expand Down

0 comments on commit 13e7d10

Please sign in to comment.