This does NOT work if there are duplicate values in the channel that you want to filter:
#!/usr/bin/env nextflow
nextflow.enable.dsl=2
workflow {
Channel.of(["b"]) \
| set { to_keep }
Channel.of(
['a', 1],
['b', 2],
['b', 3],
['c', 4],
) \
| set{dict}
dict.join(to_keep).view()
}
results in:
['b', 2]
instead of:
['b', 2], ['b', 3]