/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    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   = When to run the module.
----------------------------------------------------------------------------------------
*/

// MANTA

process {
    if (params.tools && params.tools.split(',').contains('manta')) {
        withName: 'MANTA_GERMLINE|MANTA_TUMORONLY|MANTA_SOMATIC' {
            ext.args   = { params.wes ? "--exome" : '' }
            ext.prefix = { "${meta.id}.manta" }
            publishDir = [
                mode: params.publish_dir_mode,
                path: { "${params.outdir}/variant_calling/manta/${meta.id}" },
                pattern: "*{diploid_sv,tumor_sv,somatic_sv}.{vcf.gz,vcf.gz.tbi}"
            ]
        }
    }
}
