process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } withName: BIOBAMBAM_BAMMERGE { ext.args = "md5=1 md5filename=test.md5 index=1 indexfilename=test.bam.bai" } }