2021-06-25 08:52:02 +00:00
|
|
|
process TABIX_BGZIPTABIX {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
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-06-25 08:52:02 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(input)
|
|
|
|
|
|
|
|
output:
|
2021-12-07 09:12:58 +00:00
|
|
|
tuple val(meta), path("*.gz"), path("*.tbi"), emit: gz_tbi
|
2021-10-01 13:04:56 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-06-25 08:52:02 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-06-25 08:52:02 +00:00
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
|
|
|
def args2 = task.ext.args2 ?: ''
|
2021-12-02 12:39:55 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
2021-06-25 08:52:02 +00:00
|
|
|
"""
|
2022-02-10 09:34:22 +00:00
|
|
|
bgzip --threads ${task.cpus} -c $args $input > ${prefix}.gz
|
2021-11-26 07:58:40 +00:00
|
|
|
tabix $args2 ${prefix}.gz
|
2021-06-25 08:52:02 +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-06-25 08:52:02 +00:00
|
|
|
"""
|
2022-03-28 15:48:39 +00:00
|
|
|
|
|
|
|
stub:
|
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
|
|
"""
|
|
|
|
touch ${prefix}.gz
|
|
|
|
touch ${prefix}.gz.tbi
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
|
|
|
tabix: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
|
|
|
|
END_VERSIONS
|
|
|
|
"""
|
2021-06-25 08:52:02 +00:00
|
|
|
}
|