From 8a2293937eab0787f226d5cd93d50410aecd3bc3 Mon Sep 17 00:00:00 2001 From: Adam Rosenbaum Date: Thu, 28 Nov 2024 13:05:00 +0100 Subject: [PATCH] Fix longread binning preparation from all combination of assemblies, and reads --- subworkflows/local/longread_binning_preparation.nf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/subworkflows/local/longread_binning_preparation.nf b/subworkflows/local/longread_binning_preparation.nf index 0e22f33d..b3300f68 100644 --- a/subworkflows/local/longread_binning_preparation.nf +++ b/subworkflows/local/longread_binning_preparation.nf @@ -10,12 +10,20 @@ workflow LONGREAD_BINNING_PREPARATION { ch_versions = Channel.empty() MINIMAP2_ASSEMBLY_INDEX ( assemblies ) - MINIMAP2_ASSEMBLY_ALIGN ( reads, MINIMAP2_ASSEMBLY_INDEX.out.index, true, 'bai', false, false ) + + ch_combined_reads_idx = reads + .combine(MINIMAP2_ASSEMBLY_INDEX.out.index) + + ch_minimap2_input_reads = ch_combined_reads_idx + .map { meta, reads, meta_idx ,index -> [ meta, reads ] } + ch_minimap2_input_idx = ch_combined_reads_idx + .map { meta, reads, meta_idx, index -> [ meta_idx, index ] } + + MINIMAP2_ASSEMBLY_ALIGN ( ch_minimap2_input_reads, ch_minimap2_input_idx, true, 'bai', false, false ) ch_versions = ch_versions.mix( MINIMAP2_ASSEMBLY_ALIGN.out.versions.first() ) ch_minimap2_aligned = MINIMAP2_ASSEMBLY_ALIGN.out.bam .join(MINIMAP2_ASSEMBLY_ALIGN.out.index, by: 0) - ch_minimap2_aligned.view() if (params.binning_map_mode == 'all'){ ch_grouped_mappings = ch_minimap2_aligned