/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Config file for defining DSL2 per module options and publishing paths
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Available keys to override module options:
        ext.args            = Additional arguments appended to command in module.
        ext.args2           = Second set of arguments appended to command in module (multi-tool modules).
        ext.args3           = Third set of arguments appended to command in module (multi-tool modules).
        ext.prefix          = File name prefix for output files.
        ext.when            = Conditional clause
----------------------------------------------------------------------------------------
*/


process {
    if (!params.skip_sv_annotation) {
        withName: '.*ANN_CSQ_PLI_SV:.*' {
            publishDir = [
                enabled: false
            ]
        }

        withName: '.*ANN_CSQ_PLI_SV:ADD_MOST_SEVERE_CSQ' {
            ext.prefix = { "${meta.id}_sv_csq_${meta.set}" }
        }

        withName: '.*ANN_CSQ_PLI_SV:ADD_MOST_SEVERE_PLI' {
            ext.prefix = { "${meta.id}_sv_csq_pli_${meta.set}" }
        }

        withName: '.*ANN_CSQ_PLI_SV:TABIX_BGZIPTABIX' {
            ext.prefix = { "${meta.id}_sv_csq_pli_${meta.set}" }
        }
    }
}

process {
    if (!params.skip_snv_annotation) {
        withName: '.*ANN_CSQ_PLI_SNV:.*' {
            ext.when = !params.skip_snv_annotation
            publishDir = [
                enabled: false
            ]
        }

        withName: '.*ANN_CSQ_PLI_SNV:ADD_MOST_SEVERE_CSQ' {
            ext.prefix = { "${meta.id}_snv_csq_${meta.set}" }
        }

        withName: '.*ANN_CSQ_PLI_SNV:ADD_MOST_SEVERE_PLI' {
            ext.prefix = { "${meta.id}_snv_csq_pli_${meta.set}" }
        }

        withName: '.*ANN_CSQ_PLI_SNV:TABIX_BGZIPTABIX' {
            ext.prefix = { "${meta.id}_snv_csq_pli_${meta.set}" }
        }
    }
}

process {
    if (!params.skip_mt_annotation) {
        withName: '.*ANN_CSQ_PLI_MT:.*' {
            ext.when = !params.skip_mt_annotation
            publishDir = [
                enabled: false
            ]
        }

        withName: '.*ANN_CSQ_PLI_MT:ADD_MOST_SEVERE_CSQ' {
            ext.prefix = { "${meta.id}_mt_csq_${meta.set}" }
        }

        withName: '.*ANN_CSQ_PLI_MT:ADD_MOST_SEVERE_PLI' {
            ext.prefix = { "${meta.id}_mt_csq_pli_${meta.set}" }
        }

        withName: '.*ANN_CSQ_PLI_MT:TABIX_BGZIPTABIX' {
            ext.prefix = { "${meta.id}_mt_csq_pli_${meta.set}" }
        }
    }
}
