Skip to content

Commit

Permalink
Add module to filter single-id rows in merge_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
itrujnara committed Nov 14, 2024
1 parent 157fd78 commit 6c85f78
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
10 changes: 10 additions & 0 deletions subworkflows/local/merge_ids.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
}

0 comments on commit 6c85f78

Please sign in to comment.