From 7e883da90460f77b3745468452b4c549327dde13 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Fri, 22 Apr 2022 14:50:50 +0200 Subject: [PATCH] Revert "make use of dependent on input array size" This reverts commit 413980e93a9cb8ba51f430d8a794cb25c43e9305. --- modules/bamtools/split/main.nf | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/bamtools/split/main.nf b/modules/bamtools/split/main.nf index 7d69a824..f72d13be 100644 --- a/modules/bamtools/split/main.nf +++ b/modules/bamtools/split/main.nf @@ -9,6 +9,7 @@ process BAMTOOLS_SPLIT { input: tuple val(meta), path(bam) + path(bam_list) output: tuple val(meta), path("*.bam"), emit: bam @@ -20,22 +21,18 @@ process BAMTOOLS_SPLIT { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def input_list = bam.collect{"-in $it"}.join(' ') - def stub_cmd = !args.contains("-stub") : " -stub ${prefix}" : "" - - if (size(bam) > 1){ - def bamtools_merge_cmd = "bamtools merge ${input_list} |" - } else { - def split_input = input_list + if (bam_list) { + input_list += " -list $bam_list" + } + if (!args.contains("-stub")) { + args += " -stub ${prefix}" } - """ - ${bamtools_merge_cmd} \\ - bamtools split \\ - $split_input \\ - $stub_cmd \\ + bamtools merge \\ + ${input_list} \\ + | bamtools split \\ $args cat <<-END_VERSIONS > versions.yml