Novice-y question - for the minimap2 module, how w...
# modules
m
Novice-y question - for the minimap2 module, how would you dynamically change the mapping mode based on if ont or hifi reads are provided? only way I can think of is to import it twice as e.g., ONT_ALIGN HIFI_ALIGN - then set mapping modes via conf. But that seems a bit dumb 🙂
a
That’s a perfectly valid pattern and one that pipelines in nf-core definitely use (although not necessarily for minimap2). It’s a pattern that makes more sense if there are quite different flows downstream or several config/channel options which would need to change. You can alternatively set the arg dynamically with a closure if you have a value you can use to pick the right setting. e.g.
Copy code
withName: MINIMAP2_ALIGN {
    ext.args = { meta.platform == 'ont' ? '-x ont ' : '-x pacbio'}
}
j
If you’re willing to set an entry in the meta map, you could tag readsets as ont or hifi and then set a closure for the args in the config that dynamically sets -x accordingly
👍 1
m
Okay fair! Tempted to go for the meta route, would save a lot of if elsing… cheers!