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

37 lines
1.3 KiB
Text
Raw Normal View History

2021-01-30 05:22:25 -05:00
// Import generic module functions
include { initOptions; saveFiles; getSoftwareName } from './functions'
params.options = [:]
options = initOptions(params.options)
2021-01-30 05:22:25 -05:00
process TABIX_BGZIP {
2021-01-30 05:22:25 -05:00
tag "$meta.id"
label 'process_low'
2021-01-30 05:22:25 -05: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 05:22:25 -05:00
conda (params.enable_conda ? "bioconda::tabix=0.2.6" : null)
2021-01-30 05:22:25 -05:00
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
container "https://depot.galaxyproject.org/singularity/tabix:0.2.6--ha92aebf_0"
2021-01-30 05:22:25 -05:00
} else {
container "quay.io/biocontainers/tabix:0.2.6--ha92aebf_0"
2021-01-30 05:22:25 -05:00
}
input:
tuple val(meta), path(input)
2021-01-30 05:22:25 -05:00
output:
tuple val(meta), path("*.gz"), emit: gz
2021-01-30 05:22:25 -05:00
path "*.version.txt" , emit: version
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bgzip -c $options.args $input > ${prefix}.${input.getExtension()}.gz
2021-04-07 03:39:53 -04:00
echo \$(tabix -h 2>&1) | sed 's/^.*Version: //; s/(.*\$//' > ${software}.version.txt
2021-01-30 05:22:25 -05:00
"""
}