mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-11 04:33:10 +00:00
94733a85c0
Co-authored-by: Mahesh Binzer-Panchal <mahesh.binzer-panchal@nbis.se>
40 lines
1.4 KiB
Text
40 lines
1.4 KiB
Text
process BIOBAMBAM_BAMMERGE {
|
|
tag "$meta.id"
|
|
label 'process_low'
|
|
|
|
conda (params.enable_conda ? "bioconda::biobambam=2.0.183" : null)
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
'https://depot.galaxyproject.org/singularity/biobambam:2.0.183--h9f5acd7_1':
|
|
'quay.io/biocontainers/biobambam:2.0.183--h9f5acd7_1' }"
|
|
|
|
input:
|
|
tuple val(meta), path(bam)
|
|
|
|
output:
|
|
tuple val(meta), path("${prefix}.bam") ,emit: bam
|
|
tuple val(meta), path("${indexfilename}") ,optional:true, emit: bam_index
|
|
tuple val(meta), path("${md5filename}") ,optional:true, emit: checksum
|
|
path "versions.yml" ,emit: versions
|
|
|
|
when:
|
|
task.ext.when == null || task.ext.when
|
|
|
|
script:
|
|
def args = task.ext.args ?: ''
|
|
prefix = task.ext.prefix ?: "${meta.id}"
|
|
indexfilename = args.contains("indexfilename=") ? (args =~ /indexfilename=([^\s]+)/)[0][1] : ""
|
|
md5filename = args.contains("md5filename=") ? (args =~ /md5filename=([^\s]+)/)[0][1] : ""
|
|
def input_string = bam.join(" I=")
|
|
|
|
"""
|
|
bammerge \\
|
|
I=${input_string} \\
|
|
$args \\
|
|
> ${prefix}.bam
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
bammerge: \$( bammerge --version |& sed '1!d; s/.*version //; s/.\$//' )
|
|
END_VERSIONS
|
|
"""
|
|
}
|