All modules corrected, TODO config

This commit is contained in:
sruthipsuresh 2021-01-08 13:05:46 -06:00
parent 6e7feb9e57
commit 2f19b4279c
2 changed files with 8 additions and 9 deletions

View file

@ -4,6 +4,7 @@ include { initOptions; saveFiles; getSoftwareName } from './functions'
def options = initOptions(params.options)
process BEDTOOLS_MERGE {
tag "$meta.id"
label 'process_medium'
publishDir "${params.outdir}",
mode: params.publish_dir_mode,
@ -16,16 +17,16 @@ process BEDTOOLS_MERGE {
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
}
input:
path(sort)
tuple val(meta), path(sort)
output:
path("*.merged.bed"), emit: merge
path "*.version.txt", emit: version
// TODO fix output file naming
script:
def software = getSoftwareName(task.process)
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
"""
bedtools merge -i $sort ${options.args} > ${prefix}.merged.bed
bedtools merge -i ${sort} ${options.args} > ${prefix}.merged.bed
bedtools --version | sed -e "s/Bedtools v//g" > ${software}.version.txt
"""
}

View file

@ -39,14 +39,12 @@ workflow test_bedtools_intersect {
}
// ensure input file is presorted (uses output of sort module)
// TODO use output of sort module
workflow test_bedtools_merge {
test_bedtools_sort()
def input = []
input = [
test_bedtools_sort.out.sort.collect { it[1] }.ifEmpty([])
]
BEDTOOLS_MERGE(*input)
input = [ [ id:'test' ], // meta map
file("${launchDir}/tests/data/bed/A.bed", checkIfExists: true) ]
BEDTOOLS_MERGE(input)
}
// TODO streamline slop module