/*
========================================================================================
    Config file for defining DSL2 per module options
========================================================================================
    Available keys to override module options:
        args            = Additional arguments appended to command in module.
        args2           = Second set of arguments appended to command in module (multi-tool modules).
        args3           = Third set of arguments appended to command in module (multi-tool modules).
        publish_dir     = Directory to publish results.
        publish_by_meta = Groovy list of keys available in meta map to append as directories to "publish_dir" path
                            If publish_by_meta = true                 - Value of ${meta['id']} is appended as a directory to "publish_dir" path
                            If publish_by_meta = ['id', 'custompath'] - If "id" is in meta map and "custompath" isn't then "${meta['id']}/custompath/"
                                                                        is appended as a directory to "publish_dir" path
                            If publish_by_meta = false / null         - No directories are appended to "publish_dir" path
        publish_files   = Groovy map where key = "file_ext" and value = "directory" to publish results for that file extension
                            The value of "directory" is appended to the standard "publish_dir" path as defined above.
                            If publish_files = null (unspecified)     - All files are published.
                            If publish_files = false                  - No files are published.
        suffix          = File name suffix for output files.
----------------------------------------------------------------------------------------
*/

params {
    modules {
        'fastp' {
            args          = '--cut_front --cut_tail --trim_poly_x --cut_mean_quality 30 --qualified_quality_phred 30 --unqualified_percent_limit 10 --length_required 50'
            publish_files = ['json':'', 'html':'', 'log': 'log']
        }
        'mash_sketch' {
            args = '-k 32 -m 3'
        }
        'rasusa' {
            args = '--seed 23032021'
        }
        'bwa_index' {
            args = ''
        }
        'bwa_mem' {
            args = ''
            args2 = '-F 4' // samtools view options discarding unmapped reads
            publish_files = false
        }
        'samtools_sort' {
            args = ''
            suffix = '.sorted'
        }
        'samtools_index' {
            args = ''
        }
        'bam_stats' {
            args = ''
        }
        'bcftools_mpileup' {
            args          = '--min-BQ 20 --annotate FORMAT/AD,FORMAT/ADF,FORMAT/ADR,FORMAT/DP,FORMAT/SP,INFO/AD,INFO/ADF,INFO/ADR'
            args2         = '--ploidy 1 --multiallelic-caller'
            args3         = ''
            publish_files = ['gz':'', 'gz.tbi':'', 'stats.txt':'']
            publish_dir   = 'variants'
        }
        'bcftools_filter' {
            args = '--soft-filter LowQual --exclude "%QUAL<25 || FORMAT/DP<10 || MAX(FORMAT/ADF)<2 || MAX(FORMAT/ADR)<2 || MAX(FORMAT/AD)/SUM(FORMAT/DP)<0.9 || MQ<30 || MQ0F>0.1" --output-type z'
            suffix = '.filtered'
            publish_dir   = 'variants'
        }
        'gubbins' {
            args = '-v -t hybrid'
        }
        'snpsites' {
            args = ''
        }
        'vcf2pseudogenome' {
            publish_dir = 'pseudogenomes'
        }
        'alignpseudogenomes' {
            publish_dir = 'pseudogenomes'
        }
        'rapidnj' {
            args = '-t d -b 1000 -n'
            publish_dir = 'rapidnj'
        }
        'fasttree' {
            args = '-gtr -gamma -fastest'
            publish_dir = 'fasttree'
        }
        'iqtree' {
            args = '-alrt 1000 -B 1000 -m MFP -czb'
            publish_dir = 'iqtree'
        }
        'raxmlng' {
            args = '--all --model GTR+G --bs-trees 1000'
            publish_dir = 'raxmlng'
        }
        'multiqc' {
            args = ''
            publish_files   = ['_data':'', 'html':'']
            publish_dir     = 'multiqc'
        }
    }
}
