2020-11-13 02:42:47 +00:00
|
|
|
// Import generic module functions
|
|
|
|
include { initOptions; saveFiles; getSoftwareName } from './functions'
|
|
|
|
|
|
|
|
def options = initOptions(params.options)
|
|
|
|
|
|
|
|
process BEDTOOLS_MERGE {
|
|
|
|
label 'process_medium'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
2020-12-21 19:06:57 +00:00
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), publish_id:'') }
|
2020-11-13 02:42:47 +00:00
|
|
|
|
2020-12-21 19:06:57 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::bedtools =2.29.2" : null)
|
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
|
|
container "https://depot.galaxyproject.org/singularity/bedtools:2.29.2--hc088bd4_0"
|
|
|
|
} else {
|
2020-11-13 02:42:47 +00:00
|
|
|
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
|
2020-12-21 19:06:57 +00:00
|
|
|
}
|
2020-11-13 02:42:47 +00:00
|
|
|
input:
|
2020-12-21 19:06:57 +00:00
|
|
|
path(sort)
|
2020-11-13 02:42:47 +00:00
|
|
|
|
|
|
|
output:
|
2020-12-21 19:06:57 +00:00
|
|
|
path("*.merged.bed"), emit: merge
|
2020-11-13 02:42:47 +00:00
|
|
|
path "*.version.txt", emit: version
|
2020-12-21 19:06:57 +00:00
|
|
|
// TODO fix output file naming
|
2020-11-13 02:42:47 +00:00
|
|
|
script:
|
|
|
|
def software = getSoftwareName(task.process)
|
|
|
|
"""
|
2021-01-08 17:05:40 +00:00
|
|
|
bedtools merge -i $sort ${options.args} > ${prefix}.merged.bed
|
2020-11-13 02:42:47 +00:00
|
|
|
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
|
|
|
|
"""
|
|
|
|
}
|