process {

    publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

    withName: MACS2_CALLPEAK {
        ext.args = '--qval 0.1'
    }

    withName: MACS2_CALLPEAK_CTRL {
        ext.args = '--qval 0.1'
    }

    withName: MACS2_CALLPEAK_BED {
        ext.args = '--format BED --qval 1 --nomodel --extsize 200'
    }

}
