From 490b687dbd3d0d525cc5f7d805f333abadc53b33 Mon Sep 17 00:00:00 2001 From: Story Benjamin Date: Sat, 18 Apr 2026 14:47:55 +0200 Subject: [PATCH] fix: sort BAM/BAI inputs to Manta for deterministic sample order --- CHANGELOG.md | 1 + subworkflows/local/call_sv_manta/main.nf | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd0496f5e..5a2f30ec5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### `Fixed` +- Ensure deterministic sample ordering in Manta SV output by sorting BAM/BAI channel inputs [#815](https://github.com/nf-core/raredisease/pull/815) - Fixed inconsistencies in JSON schema [#714](https://github.com/nf-core/raredisease/pull/714) - Fixed conda declaration in the add_varcallername_to_bed module [#733](https://github.com/nf-core/raredisease/pull/733) - Fixed CADD annotation to support chr prefix [#745](https://github.com/nf-core/raredisease/pull/745) diff --git a/subworkflows/local/call_sv_manta/main.nf b/subworkflows/local/call_sv_manta/main.nf index 5cef7a157..e0f1d717b 100644 --- a/subworkflows/local/call_sv_manta/main.nf +++ b/subworkflows/local/call_sv_manta/main.nf @@ -16,11 +16,13 @@ workflow CALL_SV_MANTA { val_analysis_type // string: "wes", "wgs", or "mito" main: - ch_bam.collect{_meta, bam -> bam} + ch_bam.map{ _meta, bam -> bam } + .collect(sort: { a, b -> a.getName() <=> b.getName() }) .toList() .set { bam_file_list } - ch_bai.collect{_meta, bai -> bai} + ch_bai.map{ _meta, bai -> bai } + .collect(sort: { a, b -> a.getName() <=> b.getName() }) .toList() .set { bai_file_list }