From 82784295364ffc436afd2cb7ac35258f59763efa Mon Sep 17 00:00:00 2001 From: Felipe Marques de Almeida Date: Wed, 30 Oct 2024 10:13:59 +0000 Subject: [PATCH] also convert concat h5ads --- modules/local/concat_h5ad.nf | 2 +- subworkflows/local/mtx_conversion.nf | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/local/concat_h5ad.nf b/modules/local/concat_h5ad.nf index 41310553..393a7353 100644 --- a/modules/local/concat_h5ad.nf +++ b/modules/local/concat_h5ad.nf @@ -11,7 +11,7 @@ process CONCAT_H5AD { path samplesheet output: - path "*.h5ad", emit: h5ad + tuple val(meta), path("*.h5ad"), emit: h5ad when: task.ext.when == null || task.ext.when diff --git a/subworkflows/local/mtx_conversion.nf b/subworkflows/local/mtx_conversion.nf index 55bd68dc..9891536d 100644 --- a/subworkflows/local/mtx_conversion.nf +++ b/subworkflows/local/mtx_conversion.nf @@ -56,13 +56,6 @@ workflow MTX_CONVERSION { } - // - // MODULE: Convert to Rds with AnndataR package - // - ANNDATAR_CONVERT ( - ch_h5ads - ) - // // Concat sample-specific h5ad in one // @@ -78,6 +71,18 @@ workflow MTX_CONVERSION { ch_concat_h5ad_input, samplesheet ) + ch_h5ad_concat = CONCAT_H5AD.out.h5ad.map{ meta, file -> + def meta_clone = meta.clone() + meta_clone.id = 'combined' // maintain output prefix + [ meta_clone, file ] + } + + // + // MODULE: Convert to Rds with AnndataR package + // + ANNDATAR_CONVERT ( + ch_h5ads.mix( ch_h5ad_concat ) + ) //TODO CONCAT h5ad and MTX to h5ad should also have versions.yaml output // ch_versions = ch_versions.mix(MTX_TO_H5AD.out.versions, MTX_TO_SEURAT.out.versions)