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) def options = initOptions(params.options)
process BEDTOOLS_MERGE { process BEDTOOLS_MERGE {
tag "$meta.id"
label 'process_medium' label 'process_medium'
publishDir "${params.outdir}", publishDir "${params.outdir}",
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
@ -16,16 +17,16 @@ process BEDTOOLS_MERGE {
container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0" container "quay.io/biocontainers/bedtools:2.29.2--hc088bd4_0"
} }
input: input:
path(sort) tuple val(meta), path(sort)
output: output:
path("*.merged.bed"), emit: merge path("*.merged.bed"), emit: merge
path "*.version.txt", emit: version path "*.version.txt", emit: version
// TODO fix output file naming
script: script:
def software = getSoftwareName(task.process) 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 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 { workflow test_bedtools_merge {
test_bedtools_sort()
def input = [] def input = []
input = [ input = [ [ id:'test' ], // meta map
test_bedtools_sort.out.sort.collect { it[1] }.ifEmpty([]) file("${launchDir}/tests/data/bed/A.bed", checkIfExists: true) ]
] BEDTOOLS_MERGE(input)
BEDTOOLS_MERGE(*input)
} }
// TODO streamline slop module // TODO streamline slop module