process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } withName: SAMTOOLS_COLLATE { ext.prefix = { "${meta.id}.collate" } } withName: SAMTOOLS_FIXMATE { ext.prefix = { "${meta.id}.fixmate" } } withName: SAMTOOLS_SORT { ext.prefix = { "${meta.id}.sorted" } } withName: SAMTOOLS_MARKDUP { ext.prefix = { "${meta.id}.markdup" } } }