process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } withName:SAMTOOLS_VIEW { ext.args = "-q 30 -b" } withName:SAMTOOLS_FLAGSTAT2 { ext.prefix = "test.filtered" } }