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

//
// Structural variant calling options
//

process {

    withName: '.*CALL_STRUCTURAL_VARIANTS:.*' {
        publishDir = [
            enabled: false
        ]
    }

    withName: '.*CALL_STRUCTURAL_VARIANTS:SVDB_MERGE' {
        ext.args = '--pass_only --same_order'
        publishDir = [
            path: { "${params.outdir}/call_sv" },
            mode: params.publish_dir_mode,
            saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
        ]
    }

    withName: '.*CALL_STRUCTURAL_VARIANTS:TABIX_TABIX' {
        publishDir = [
            path: { "${params.outdir}/call_sv" },
            mode: params.publish_dir_mode,
            saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
        ]
    }
}
