/*
========================================================================================
    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.
        subcommand      = Subcommand for some tools
----------------------------------------------------------------------------------------
*/

params {
    modules {
        'fastqc' {
            args = "--quiet"
        }
        'multiqc' {
            args = ""
        }
        'presto_filterseq' {
            publish_dir   = 'presto/01-filterseq'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_maskprimers' {
            publish_dir   = 'presto/02-maskprimers'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_pairseq' {
            publish_dir   = 'presto/03-pairseq'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_clustersets' {
            publish_dir   = 'presto/04-clustersets'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_parse_clusters' {
            publish_dir   = 'presto/05-parse_clusters'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_buildconsensus' {
            publish_dir   = 'presto/06-buildconsensus'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_postconsensus_pairseq' {
            publish_dir   = 'presto/07-pairseq_postconsensus'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_assemblepairs' {
            publish_dir   = 'presto/08-assemblepairs'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_parseheaders_collapse' {
            publish_dir   = false
            subcommand = "collapse"
            args = "-f CONSCOUNT --act min"
            publish_files = false
        }
        'presto_parseheaders_primers' {
            publish_dir   = false
            publish_files = false
        }
        'presto_parseheaders_metadata' {
            publish_dir   = false
            publish_files = false
        }
        'presto_collapseseq' {
            publish_dir   = 'presto/09-collapseseq'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'presto_splitseq' {
            publish_dir   = 'presto/10-splitseq'
            publish_files = [ 'log':'logs', 'tab':'tabs', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'changeo_assigngenes' {
            publish_dir   = 'changeo/01-assigngenes'
            publish_files = [ 'fasta':'fasta' ]
            publish_by_id = true
        }
        'changeo_makedb' {
            publish_dir   = 'changeo/02-makedb'
            publish_files = [ 'log':'logs', 'tsv':'tab', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'changeo_parsedb_split' {
            publish_dir   = 'changeo/03-parsedb_split'
            publish_files = [ 'log':'logs', 'tsv':'tab', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'changeo_parsedb_select' {
            publish_dir   = 'changeo/04-parsedb_select'
            publish_files = [ 'log':'logs', 'tsv':'tab', 'log.txt':'logs' ]
            publish_by_id = true
        }
        'changeo_convertdb_fasta' {
            publish_dir   = 'changeo/05-convertdb-fasta'
            publish_files = [ 'fasta':'fasta']
            publish_by_id = true
            args = "--if sequence_id --sf sequence_alignment --mf v_call dupcount"
        }
        'merge_tables' {
            publish_dir   = 'shazam/01-merged-tables'
            publish_files = [ 'tsv':'tab']
            publish_by_id = true
        }
        'shazam_tigger_threshold' {
            publish_dir   = 'shazam/02-genotyping'
            publish_files = [ 'tsv':'tab', 'fasta':'genotype', 'genotype.pdf':'genotype', 'threshold.pdf':'plots', 'threshold.txt':'threshold' ]
            publish_by_id = true
        }
        'changeo_defineclones' {
            publish_dir   = 'changeo/06-define-clones'
            publish_files = [ 'tsv':'tab', 'log':'logs' ]
            publish_by_id = true
        }
        'changeo_creategermlines' {
            publish_dir   = 'changeo/07-create-germlines'
            publish_files = [ 'tsv':'tab', 'log':'logs' ]
            publish_by_id = true
        }
        'changeo_buildtrees' {
            publish_dir   = 'changeo/08-build-trees'
            publish_files = [ 'tsv':'tab', 'log':'logs' ]
            publish_by_id = true
        }
        'alakazam_lineage' {
            publish_dir   = 'lineage_reconstruction'
            publish_files = [ 'tsv':'tab', 'log':'logs', 'All_graphs_patient.graphml':'', 'pdf':'' ]
            publish_by_id = true
            args = "population"
        }
        'alakazam_shazam_repertoires' {
            publish_dir   = 'repertoire_analysis'
            publish_files = [ 'repertoire_comparison':'', 'html':'' ]
            publish_by_id = false
            args = "none"
        }
        'fetch_databases' {
            publish_dir   = 'databases'
            publish_files = [:]
            publish_by_id = false
        }
        'parse_logs' {
            publish_dir   = 'parsed_logs'
            publish_files = [ 'tsv':'sequences_table']
            publish_by_id = false
        }
    }
}
