Skip to content

Commit

Permalink
fix: Add work around when to_remove is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jvfe committed Feb 6, 2024
1 parent be46f35 commit 122b07e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions workflows/arete.nf
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,13 @@ workflow ARETE {

SUBSET_GENOMES.out.genomes_to_remove.set { to_remove }


gffs
.combine (to_remove.collect().map { [it] })
.filter { meta, path, to_remove -> !(meta.id in to_remove) }
.map { it[0, 1] }
.set { gffs }

}

if (params.run_recombination) {
Expand Down Expand Up @@ -449,6 +451,12 @@ workflow ANNOTATION {

SUBSET_GENOMES.out.genomes_to_remove.set { to_remove }


// TODO: Find a better way of handling empty to_remove channel.
// Weird hack but if there are no genomes to remove
// the gffs logic fails and generates an empty channel
// skipping phylo altogether.
to_remove.ifEmpty('NA').set { to_remove }
// Filter GFFs not in the to_remove ID list
gffs
.combine (to_remove.collect().map { [it] })
Expand Down

0 comments on commit 122b07e

Please sign in to comment.