nf-core_modules/modules/biobambam/bammarkduplicates2/main.nf
Matthieu Muffato 04e82ec61a
First version of the biobambam/bammarkduplicates2 module (#1247)
* First version of the biobambam/bammarkduplicates2 module

* Fixed the path of versions.yml

* Regenerated the checksums as the previous files were generated with a single core

* Added the `when:` block, as per #1261

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
2022-02-14 16:30:48 +00:00

38 lines
1.2 KiB
Text

process BIOBAMBAM_BAMMARKDUPLICATES2 {
tag "$meta.id"
label 'process_medium'
conda (params.enable_conda ? "bioconda::biobambam=2.0.182" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/biobambam:2.0.182--h7d875b9_0':
'quay.io/biocontainers/biobambam:2.0.182--h7d875b9_0' }"
input:
tuple val(meta), path(bam)
output:
tuple val(meta), path("*.bam") , emit: bam
tuple val(meta), path("*.metrics.txt"), emit: metrics
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}"
"""
bammarkduplicates2 \\
$args \\
I=$bam \\
O=${prefix}.bam \\
M=${prefix}.metrics.txt \\
tmpfile=$prefix \\
markthreads=$task.cpus
cat <<-END_VERSIONS > versions.yml
"${task.process}":
bammarkduplicates2: \$(echo \$(bammarkduplicates2 --version 2>&1) | sed 's/^This is biobambam2 version //; s/..biobambam2 is .*\$//' )
END_VERSIONS
"""
}