process {

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

    withName: PICARD_MARKDUPLICATES_UNSORTED {
        ext.args = 'ASSUME_SORT_ORDER=queryname'
    }

}
