nf-core_modules/modules/tabix/bgzip/main.nf

39 lines
1.3 KiB
Text
Raw Normal View History

2021-01-30 10:22:25 +00:00
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
2021-01-30 10:22:25 +00:00
params.options = [:]
options = initOptions(params.options)
2021-01-30 10:22:25 +00:00
process TABIX_BGZIP {
2021-01-30 10:22:25 +00:00
tag "$meta.id"
label 'process_low'
2021-01-30 10:22:25 +00:00
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
2021-01-30 10:22:25 +00:00
conda (params.enable_conda ? 'bioconda::tabix=1.11' : null)
2021-01-30 10:22:25 +00:00
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/tabix:1.11--hdfd78af_0"
2021-01-30 10:22:25 +00:00
} else {
container "quay.io/biocontainers/tabix:1.11--hdfd78af_0"
2021-01-30 10:22:25 +00:00
}
input:
tuple val(meta), path(input)
2021-01-30 10:22:25 +00:00
output:
tuple val(meta), path("*.gz"), emit: gz
path "versions.yml" , emit: versions
2021-01-30 10:22:25 +00:00
script:
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bgzip -c $options.args $input > ${prefix}.${input.getExtension()}.gz
2021-04-07 07:39:53 +00:00
cat <<-END_VERSIONS > versions.yml
${getProcessName(task.process)}:
${getSoftwareName(task.process)}: \$(echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/ .*\$//')
END_VERSIONS
2021-01-30 10:22:25 +00:00
"""
}