rename file_type to output extension

This commit is contained in:
Rike 2022-05-09 16:06:22 +02:00
parent 1de1c2253e
commit 5bd456e5e8

View file

@ -21,8 +21,8 @@ process SAMTOOLS_CONVERT {
script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def file_type = input.getExtension() == "bam" ? "cram" : "bam"
def prefix = task.ext.prefix ?: "${meta.id}"
def output_extension = input.getExtension() == "bam" ? "cram" : "bam"
"""
samtools view \\
@ -30,9 +30,9 @@ process SAMTOOLS_CONVERT {
--reference ${fasta} \\
$args \\
$input \\
-o ${prefix}.${file_type}
-o ${prefix}.${output_extension}
samtools index -@${task.cpus} ${prefix}.${file_type}
samtools index -@${task.cpus} ${prefix}.${output_extension}
cat <<-END_VERSIONS > versions.yml
"${task.process}":