diff 0.6.1/conf/modules.config @ 11:749faef1caa9

"planemo upload"
author kkonganti
date Tue, 05 Sep 2023 11:51:40 -0400
parents
children b0a37e88ecb5
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/0.6.1/conf/modules.config	Tue Sep 05 11:51:40 2023 -0400
@@ -0,0 +1,118 @@
+process {
+    publishDir = [
+        path: { 
+            "${task.process.tokenize(':')[-1].toLowerCase()}" == "multiqc" ?
+                "${params.output}${params.fs}${params.pipeline.toLowerCase()}-${task.process.tokenize(':')[-1].toLowerCase()}" :
+                "${params.output}${params.fs}${task.process.tokenize(':')[-1].toLowerCase()}"
+        },
+        mode: params.publish_dir_mode,
+        overwrite: params.publish_dir_overwrite,
+        saveAs: { filename -> filename =~ /^versions\.yml|genome_paths\.txt|[bettercallsalbcs].+?_mqc.*/ ? null : filename }
+    ]
+
+    errorStrategy = {
+        ![0].contains(task.exitStatus) ? dynamic_retry(task.attempt, 10) : 'finish'
+    }
+
+    maxRetries = 1
+
+    withLabel: 'process_femto' {
+        cpus = { 1 * task.attempt }
+        memory = { 1.GB * task.attempt }
+        time = { 1.h * task.attempt }
+    }
+
+    withLabel: 'process_pico' {
+        cpus = { min_cpus(2) * task.attempt }
+        memory = { 4.GB * task.attempt }
+        time = { 2.h * task.attempt }
+    }
+
+    withLabel: 'process_nano' {
+        cpus = { min_cpus(4) * task.attempt }
+        memory = { 8.GB * task.attempt }
+        time = { 4.h * task.attempt }
+    }
+
+    withLabel: 'process_micro' {
+        cpus = { min_cpus(8) * task.attempt }
+        memory = { 16.GB * task.attempt }
+        time = { 8.h * task.attempt }
+    }
+
+    withLabel: 'process_only_mem_low' {
+        cpus = { 1 * task.attempt }
+        memory = { 60.GB * task.attempt }
+        time = { 20.h * task.attempt }
+    }
+
+    withLabel: 'process_only_mem_medium' {
+        cpus = { 1 * task.attempt }
+        memory = { 100.GB * task.attempt }
+        time = { 30.h * task.attempt }
+    }
+
+    withLabel: 'process_only_mem_high' {
+        cpus = { 1 * task.attempt }
+        memory = { 128.GB * task.attempt }
+        time = { 60.h * task.attempt }
+    }
+
+    withLabel: 'process_low' {
+        cpus = { min_cpus(10) * task.attempt }
+        memory = { 60.GB * task.attempt }
+        time = { 20.h * task.attempt }
+    }
+
+    withLabel: 'process_medium' {
+        cpus = { min_cpus(10) * task.attempt }
+        memory = { 100.GB * task.attempt }
+        time = { 30.h * task.attempt }
+    }
+
+    withLabel: 'process_high' {
+        cpus = { min_cpus(10) * task.attempt }
+        memory = { 128.GB * task.attempt }
+        time = { 60.h * task.attempt }
+    }
+
+    withLabel: 'process_higher' {
+        cpus = { min_cpus(10) * task.attempt }
+        memory = { 256.GB * task.attempt }
+        time = { 60.h * task.attempt }
+    }
+
+    withLabel: 'process_gigantic' {
+        cpus = { min_cpus(10) * task.attempt }
+        memory = { 512.GB * task.attempt }
+        time = { 60.h * task.attempt }
+    }
+}
+
+if ( ( ( params.input || params.metadata ) && params.pipeline ) ||
+    ( params.pipeline.toString().equalsIgnoreCase('bettercallsal_db') && params.output) ) {
+    try {
+        includeConfig "${params.workflowsconf}${params.fs}process${params.fs}${params.pipeline}.process.config"
+    } catch (Exception e) {
+        System.err.println('-'.multiply(params.linewidth) + "\n" +
+            "\033[0;31m${params.cfsanpipename} - ERROR\033[0m\n" +
+            '-'.multiply(params.linewidth) + "\n" + "\033[0;31mCould not load " +
+            "default pipeline's process configuration. Please provide a pipeline \n" +
+            "name using the --pipeline option.\n\033[0m" + '-'.multiply(params.linewidth) + "\n")
+        System.exit(1)
+    }
+}
+
+// Function will return after sleeping for some time. 
+// Sleep time increases exponentially by task attempt.
+def dynamic_retry(task_retry_num, factor_by) {
+    // sleep(Math.pow(2, task_retry_num.toInteger()) * factor_by.toInteger() as long)
+    sleep(Math.pow(1.27, task_retry_num.toInteger()) as long)
+    return 'retry'
+}
+
+// Function that will adjust the minimum number of CPU
+// cores depending as requested by the user.
+def min_cpus(cores) {
+    return Math.min(cores as int, "${params.max_cpus}" as int)
+}