From fd4f989ae0acdb0b741b489886b2e1914c851e5d Mon Sep 17 00:00:00 2001 From: Matthieu Muffato Date: Fri, 9 Feb 2024 21:45:16 +0000 Subject: [PATCH] bugfix: pair each blocklist with its BAM file --- modules/local/pacbio_filter.nf | 4 ++-- subworkflows/local/filter_pacbio.nf | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/local/pacbio_filter.nf b/modules/local/pacbio_filter.nf index e4deaa4..36dd257 100644 --- a/modules/local/pacbio_filter.nf +++ b/modules/local/pacbio_filter.nf @@ -11,8 +11,8 @@ process PACBIO_FILTER { tuple val(meta), path(txt) output: - path("*.blocklist"), emit: list - path "versions.yml", emit: versions + tuple val(meta), path("*.blocklist"), emit: list + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/subworkflows/local/filter_pacbio.nf b/subworkflows/local/filter_pacbio.nf index 3d55282..7dfe8a1 100644 --- a/subworkflows/local/filter_pacbio.nf +++ b/subworkflows/local/filter_pacbio.nf @@ -60,9 +60,18 @@ workflow FILTER_PACBIO { // Create filtered BAM file SAMTOOLS_CONVERT.out.bam | join ( SAMTOOLS_CONVERT.out.csi ) + | join ( PACBIO_FILTER.out.list ) + | set { ch_reads_and_list } + + ch_reads_and_list + | map { meta, bam, csi, list -> [meta, bam, csi] } | set { ch_reads } - SAMTOOLS_FILTER ( ch_reads, [ [], [] ], PACBIO_FILTER.out.list ) + ch_reads_and_list + | map { meta, bam, csi, list -> list } + | set { ch_lists } + + SAMTOOLS_FILTER ( ch_reads, [ [], [] ], ch_lists ) ch_versions = ch_versions.mix ( SAMTOOLS_FILTER.out.versions.first() )