From 6723ca7f9068ecbdee31dcad07f3115dc5b40667 Mon Sep 17 00:00:00 2001 From: Matthias De Smet <11850640+matthdsm@users.noreply.github.com> Date: Tue, 19 Apr 2022 15:05:02 +0200 Subject: [PATCH] bump version, add merge before split --- modules/bamtools/split/main.nf | 22 +++++++++++++++------- modules/bamtools/split/meta.yml | 8 +++++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/modules/bamtools/split/main.nf b/modules/bamtools/split/main.nf index 014e5cdb..f6382d97 100644 --- a/modules/bamtools/split/main.nf +++ b/modules/bamtools/split/main.nf @@ -2,13 +2,14 @@ process BAMTOOLS_SPLIT { tag "$meta.id" label 'process_low' - conda (params.enable_conda ? "bioconda::bamtools=2.5.1" : null) + conda (params.enable_conda ? "bioconda::bamtools=2.5.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/bamtools:2.5.1--h9a82719_9' : - 'quay.io/biocontainers/bamtools:2.5.1--h9a82719_9' }" + 'https://depot.galaxyproject.org/singularity/bamtools:2.5.2--hd03093a_0' : + 'quay.io/biocontainers/bamtools:2.5.2--hd03093a_0' }" input: tuple val(meta), path(bam) + path(bam_list) output: tuple val(meta), path("*.bam"), emit: bam @@ -19,12 +20,19 @@ process BAMTOOLS_SPLIT { script: def args = task.ext.args ?: '' + def args2 = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" + def input_list = bam.collect{"-in $it"}.join(' ') + if (bam_list) { + input += " -list $bam_list" + } + """ - bamtools \\ - split \\ - -in $bam \\ - $args + bamtools merge \\ + ${input_list} \\ + $args \\ + bamtools split \\ + $args2 cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/bamtools/split/meta.yml b/modules/bamtools/split/meta.yml index 0e848212..6c534281 100644 --- a/modules/bamtools/split/meta.yml +++ b/modules/bamtools/split/meta.yml @@ -23,8 +23,13 @@ input: e.g. [ id:'test', single_end:false ] - bam: type: file - description: A BAM file to split + description: A list of BAM files to merge and then split pattern: "*.bam" + - bam_list: + type: file + description: | + Input file containing bam files to merge before splitting, + one line per file output: - meta: @@ -43,3 +48,4 @@ output: authors: - "@sguizard" + - "@matthdsm"