From 95a9ffaa10235fdf6c7ad5ffd5ef94267ea3ca4a Mon Sep 17 00:00:00 2001 From: Felipe Marques de Almeida Date: Tue, 16 Apr 2024 08:56:59 +0000 Subject: [PATCH] parse filtered / raw channels --- subworkflows/local/align_cellranger.nf | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/subworkflows/local/align_cellranger.nf b/subworkflows/local/align_cellranger.nf index 39e54675..2461373b 100644 --- a/subworkflows/local/align_cellranger.nf +++ b/subworkflows/local/align_cellranger.nf @@ -40,9 +40,30 @@ workflow CELLRANGER_ALIGN { ) ch_versions = ch_versions.mix(CELLRANGER_COUNT.out.versions) + // + // Split channels of raw and filtered to avoid file collision problems when loading the inputs in conversion modules. + // + ch_matrices_raw = + CELLRANGER_COUNT.out.outs.map { meta, mtx_files -> + def desired_files = [] + mtx_files.each{ + if ( it.toString().contains("raw_feature_bc_matrix") ) { desired_files.add( it ) } + } + [ meta, desired_files ] + } + + ch_matrices_filtered = + CELLRANGER_COUNT.out.outs.map { meta, mtx_files -> + def desired_files = [] + mtx_files.each{ + if ( it.toString().contains("filtered_feature_bc_matrix") ) { desired_files.add( it ) } + } + [ meta, desired_files ] + } + emit: ch_versions cellranger_out = CELLRANGER_COUNT.out.outs - cellranger_matrices = CELLRANGER_COUNT.out.filtered.mix( CELLRANGER_COUNT.out.raw ) + cellranger_matrices = ch_matrices_raw.mix( ch_matrices_filtered ) star_index = cellranger_index }