2021-02-16 18:11:36 +00:00
|
|
|
process TABIX_BGZIP {
|
2021-01-30 10:22:25 +00:00
|
|
|
tag "$meta.id"
|
2021-03-16 17:16:47 +00:00
|
|
|
label 'process_low'
|
2021-01-30 10:22:25 +00:00
|
|
|
|
2021-07-28 08:10:44 +00:00
|
|
|
conda (params.enable_conda ? 'bioconda::tabix=1.11' : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0' :
|
|
|
|
'quay.io/biocontainers/tabix:1.11--hdfd78af_0' }"
|
2021-01-30 10:22:25 +00:00
|
|
|
|
|
|
|
input:
|
2021-02-16 23:28:32 +00:00
|
|
|
tuple val(meta), path(input)
|
2021-01-30 10:22:25 +00:00
|
|
|
|
|
|
|
output:
|
2022-04-20 14:26:56 +00:00
|
|
|
tuple val(meta), path("${prefix}*"), emit: output
|
|
|
|
path "versions.yml" , emit: versions
|
2021-01-30 10:22:25 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-01-30 10:22:25 +00:00
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
2022-04-20 14:26:56 +00:00
|
|
|
prefix = task.ext.prefix ?: "${meta.id}"
|
|
|
|
in_bgzip = input.toString().endsWith(".gz")
|
|
|
|
command1 = in_bgzip ? '-d' : '-c'
|
|
|
|
command2 = in_bgzip ? '' : " > ${prefix}.${input.getExtension()}.gz"
|
2021-01-30 10:22:25 +00:00
|
|
|
"""
|
2022-04-20 14:26:56 +00:00
|
|
|
bgzip $command1 $args -@${task.cpus} $input $command2
|
2021-04-07 07:39:53 +00:00
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-01-30 10:22:25 +00:00
|
|
|
"""
|
|
|
|
}
|