/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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
----------------------------------------------------------------------------------------
*/

//
// Call SV in mitochondria
//

process {

    withName: '.*CALL_SV_MT:MT_DELETION' {
        ext.args = '-s --insert-size 16000'
        ext.prefix = { "${meta.id}_mitochondria_deletions" }
        publishDir = [
            path: { "${params.outdir}/call_sv/mitochondria" },
            mode: params.publish_dir_mode,
            saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
        ]
    }

    if (!params.skip_eklipse){
        withName: '.*CALL_SV_MT:EKLIPSE' {
            ext.args = "-tmp ."
            publishDir = [
                path: { "${params.outdir}/call_sv/mitochondria" },
                mode: params.publish_dir_mode,
                saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
            ]
        }
    }
}

