From 2f19b4279c0e3e236d6657ba02841ccc4c9b1854 Mon Sep 17 00:00:00 2001 From: sruthipsuresh Date: Fri, 8 Jan 2021 13:05:46 -0600 Subject: [PATCH] All modules corrected, TODO config --- software/bedtools/merge/main.nf | 7 ++++--- tests/software/bedtools/main.nf | 10 ++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/software/bedtools/merge/main.nf b/software/bedtools/merge/main.nf index 6f32f441..cc3e05bd 100644 --- a/software/bedtools/merge/main.nf +++ b/software/bedtools/merge/main.nf @@ -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 """ } diff --git a/tests/software/bedtools/main.nf b/tests/software/bedtools/main.nf index 327108d6..8eb35be4 100644 --- a/tests/software/bedtools/main.nf +++ b/tests/software/bedtools/main.nf @@ -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