From 6c85f786cf92ae8bd9374879372c0ad797372faf Mon Sep 17 00:00:00 2001 From: Igor Trujnara Date: Thu, 14 Nov 2024 16:09:01 +0100 Subject: [PATCH] Add module to filter single-id rows in merge_ids --- conf/modules.config | 6 ++++++ subworkflows/local/merge_ids.nf | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/conf/modules.config b/conf/modules.config index 1850d37..4d60d42 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -215,6 +215,12 @@ process { ] } + withName: 'REDUCE_IDMAP' { + ext.args = "-F\'\t\'" + ext.args2 = "\'NF >= 2\'" + ext.prefix = { "${meta.id}_idmap" } + } + withName: 'MERGE_CSV' { ext.args = '-f 1 --outer-join --na 0' publishDir = [ diff --git a/subworkflows/local/merge_ids.nf b/subworkflows/local/merge_ids.nf index ad13275..88613e6 100644 --- a/subworkflows/local/merge_ids.nf +++ b/subworkflows/local/merge_ids.nf @@ -5,6 +5,7 @@ include { GAWK as POSTPROCESS_DIAMOND } from '../../modules/nf-core/gawk/main.nf include { GAWK as GROUP_DIAMOND } from '../../modules/nf-core/gawk/main.nf' include { CAT_CAT as MERGE_DIAMOND } from '../../modules/nf-core/cat/cat/main.nf' include { CAT_CAT as MERGE_ALL } from '../../modules/nf-core/cat/cat/main.nf' +include { GAWK as REDUCE_IDMAP } from '../../modules/nf-core/gawk/main.nf' workflow MERGE_IDS { take: @@ -81,6 +82,15 @@ workflow MERGE_IDS { ch_id_clusters = ch_id_clusters.mix(MERGE_ALL.out.file_out) + // Reduce idmap + REDUCE_IDMAP ( + MERGE_ALL.out.file_out, + [] + ) + + ch_id_map = REDUCE_IDMAP.out.output + emit: ch_id_clusters + ch_id_map }