/*
========================================================================================
    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 {
        'fastqc_raw' {
            args            = "--quiet"
            publish_files   = ['html':'']
            publish_dir     = "QC_shortreads/fastqc"
        }
        'fastp' {
            args            = "-q ${params.fastp_qualified_quality} --cut_front --cut_tail --cut_mean_quality ${params.fastp_cut_mean_quality}"
            publish_files   = ['html':'', 'json':'']
            publish_by_meta = true
            publish_dir     = "QC_shortreads/fastp"
        }
        'bowtie2_host_removal_align' {
            publish_files   = ['log':'', 'read_ids.txt':'']
            publish_dir     = "QC_shortreads/remove_host"
            suffix          = "host_removed"
        }
        'bowtie2_phix_removal_align' {
            publish_files   = ['log':'']
            publish_dir     = "QC_shortreads/remove_phix"
            suffix          = "phix_removed"
        }
        'fastqc_trimmed' {
            args            = "--quiet"
            publish_files   = ['html':'']
            publish_dir     = "QC_shortreads/fastqc"
            suffix          = ".trimmed"
        }
        'nanolyse' {
            publish_files   = ['log':'']
            publish_dir     = "QC_longreads/NanoLyse"
        }
        'nanoplot_raw' {
            publish_files   = ['png':'', 'html':'', 'txt':'']
            publish_by_meta = true
            publish_dir     = "QC_longreads/NanoPlot"
            suffix          = "raw"
        }
        'nanoplot_filtered' {
            publish_files   = ['png':'', 'html':'', 'txt':'']
            publish_by_meta = true
            publish_dir     = "QC_longreads/NanoPlot"
            suffix          = "filtered"
        }
        'centrifuge' {
            publish_files   = ['txt':'']
            publish_by_meta = true
            publish_dir     = "Taxonomy/centrifuge"
        }
        'kraken2' {
            publish_files   = ['txt':'']
            publish_by_meta = true
            publish_dir     = "Taxonomy/kraken2"
        }
        'krona' {
            publish_files   = ['html':'']
            publish_by_meta = true
            publish_dir     = "Taxonomy"
        }
        'megahit' {
            publish_files   = ['fa.gz':'', 'log':'']
            publish_dir     = "Assembly"
        }
        'spades' {
            publish_files   = ['fasta.gz':'', 'gfa.gz':'', 'log':'']
            publish_dir     = "Assembly/SPAdes"
        }
        'spadeshybrid' {
            publish_files   = ['fasta.gz':'', 'gfa.gz':'', 'log':'']
            publish_dir     = "Assembly/SPAdesHybrid"
        }
        'quast' {
            publish_by_meta = ['assembler', 'QC', 'id']
            publish_dir     = "Assembly"
        }
        'bowtie2_assembly_align' {
            publish_files   = ['log':'']
            publish_by_meta = ['assembler', 'QC', 'id']
            publish_dir     = "Assembly"
        }
        'metabat2' {
            publish_files   = ['txt.gz':'', 'fa':'', 'fa.gz':'']
            publish_dir     = "GenomeBinning"
        }
        'mag_depths' {
            publish_files   = false
        }
        'mag_depths_plot' {
            publish_dir     = "GenomeBinning"
        }
        'mag_depths_summary' {
            publish_dir     = "GenomeBinning"
        }
        'busco_db_preparation' {
            publish_files   = ['tar.gz':'']
            publish_dir     = "GenomeBinning/QC/BUSCO"
        }
        'busco' {
            publish_dir     = "GenomeBinning/QC/BUSCO"
        }
        'busco_save_download' {
            publish_dir     = "GenomeBinning/QC/BUSCO"
        }
        'busco_plot' {
            publish_dir     = "GenomeBinning/QC/BUSCO"
        }
        'busco_summary' {
            publish_dir     = "GenomeBinning/QC"
        }
        'quast_bins' {
            publish_dir     = "GenomeBinning/QC"
        }
        'quast_bins_summary' {
            publish_dir     = "GenomeBinning/QC"
        }
        'cat' {
            publish_by_meta = true
            publish_dir     = "Taxonomy/CAT"
            publish_files   = ['log':'', 'gz':'']
        }
        'cat_db_generate' {
            publish_files   = ['tar.gz':'']
            publish_dir     = "Taxonomy/CAT"
        }
        'gtdbtk_classify' {
            args            = "--extension fa"
            publish_files   = ['log':'', 'tsv':'', 'tree.gz':'', 'fasta':'', 'fasta.gz':'']
            publish_by_meta = true
            publish_dir     = "Taxonomy/GTDB-Tk"
        }
        'gtdbtk_summary' {
            args            = "--extension fa"
            publish_dir     = "Taxonomy/GTDB-Tk"
        }
        'bin_summary' {
            publish_dir     = "GenomeBinning"
        }
        'multiqc' {
            args            = ""
        }
    }
}
