annotate 0.6.1/conf/modules.config @ 12:c5faadb3386f

"planemo upload"
author kkonganti
date Tue, 05 Sep 2023 11:57:15 -0400
parents 749faef1caa9
children b0a37e88ecb5
rev   line source
kkonganti@11 1 process {
kkonganti@11 2 publishDir = [
kkonganti@11 3 path: {
kkonganti@11 4 "${task.process.tokenize(':')[-1].toLowerCase()}" == "multiqc" ?
kkonganti@11 5 "${params.output}${params.fs}${params.pipeline.toLowerCase()}-${task.process.tokenize(':')[-1].toLowerCase()}" :
kkonganti@11 6 "${params.output}${params.fs}${task.process.tokenize(':')[-1].toLowerCase()}"
kkonganti@11 7 },
kkonganti@11 8 mode: params.publish_dir_mode,
kkonganti@11 9 overwrite: params.publish_dir_overwrite,
kkonganti@11 10 saveAs: { filename -> filename =~ /^versions\.yml|genome_paths\.txt|[bettercallsalbcs].+?_mqc.*/ ? null : filename }
kkonganti@11 11 ]
kkonganti@11 12
kkonganti@11 13 errorStrategy = {
kkonganti@11 14 ![0].contains(task.exitStatus) ? dynamic_retry(task.attempt, 10) : 'finish'
kkonganti@11 15 }
kkonganti@11 16
kkonganti@11 17 maxRetries = 1
kkonganti@11 18
kkonganti@11 19 withLabel: 'process_femto' {
kkonganti@11 20 cpus = { 1 * task.attempt }
kkonganti@11 21 memory = { 1.GB * task.attempt }
kkonganti@11 22 time = { 1.h * task.attempt }
kkonganti@11 23 }
kkonganti@11 24
kkonganti@11 25 withLabel: 'process_pico' {
kkonganti@11 26 cpus = { min_cpus(2) * task.attempt }
kkonganti@11 27 memory = { 4.GB * task.attempt }
kkonganti@11 28 time = { 2.h * task.attempt }
kkonganti@11 29 }
kkonganti@11 30
kkonganti@11 31 withLabel: 'process_nano' {
kkonganti@11 32 cpus = { min_cpus(4) * task.attempt }
kkonganti@11 33 memory = { 8.GB * task.attempt }
kkonganti@11 34 time = { 4.h * task.attempt }
kkonganti@11 35 }
kkonganti@11 36
kkonganti@11 37 withLabel: 'process_micro' {
kkonganti@11 38 cpus = { min_cpus(8) * task.attempt }
kkonganti@11 39 memory = { 16.GB * task.attempt }
kkonganti@11 40 time = { 8.h * task.attempt }
kkonganti@11 41 }
kkonganti@11 42
kkonganti@11 43 withLabel: 'process_only_mem_low' {
kkonganti@11 44 cpus = { 1 * task.attempt }
kkonganti@11 45 memory = { 60.GB * task.attempt }
kkonganti@11 46 time = { 20.h * task.attempt }
kkonganti@11 47 }
kkonganti@11 48
kkonganti@11 49 withLabel: 'process_only_mem_medium' {
kkonganti@11 50 cpus = { 1 * task.attempt }
kkonganti@11 51 memory = { 100.GB * task.attempt }
kkonganti@11 52 time = { 30.h * task.attempt }
kkonganti@11 53 }
kkonganti@11 54
kkonganti@11 55 withLabel: 'process_only_mem_high' {
kkonganti@11 56 cpus = { 1 * task.attempt }
kkonganti@11 57 memory = { 128.GB * task.attempt }
kkonganti@11 58 time = { 60.h * task.attempt }
kkonganti@11 59 }
kkonganti@11 60
kkonganti@11 61 withLabel: 'process_low' {
kkonganti@11 62 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 63 memory = { 60.GB * task.attempt }
kkonganti@11 64 time = { 20.h * task.attempt }
kkonganti@11 65 }
kkonganti@11 66
kkonganti@11 67 withLabel: 'process_medium' {
kkonganti@11 68 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 69 memory = { 100.GB * task.attempt }
kkonganti@11 70 time = { 30.h * task.attempt }
kkonganti@11 71 }
kkonganti@11 72
kkonganti@11 73 withLabel: 'process_high' {
kkonganti@11 74 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 75 memory = { 128.GB * task.attempt }
kkonganti@11 76 time = { 60.h * task.attempt }
kkonganti@11 77 }
kkonganti@11 78
kkonganti@11 79 withLabel: 'process_higher' {
kkonganti@11 80 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 81 memory = { 256.GB * task.attempt }
kkonganti@11 82 time = { 60.h * task.attempt }
kkonganti@11 83 }
kkonganti@11 84
kkonganti@11 85 withLabel: 'process_gigantic' {
kkonganti@11 86 cpus = { min_cpus(10) * task.attempt }
kkonganti@11 87 memory = { 512.GB * task.attempt }
kkonganti@11 88 time = { 60.h * task.attempt }
kkonganti@11 89 }
kkonganti@11 90 }
kkonganti@11 91
kkonganti@11 92 if ( ( ( params.input || params.metadata ) && params.pipeline ) ||
kkonganti@11 93 ( params.pipeline.toString().equalsIgnoreCase('bettercallsal_db') && params.output) ) {
kkonganti@11 94 try {
kkonganti@11 95 includeConfig "${params.workflowsconf}${params.fs}process${params.fs}${params.pipeline}.process.config"
kkonganti@11 96 } catch (Exception e) {
kkonganti@11 97 System.err.println('-'.multiply(params.linewidth) + "\n" +
kkonganti@11 98 "\033[0;31m${params.cfsanpipename} - ERROR\033[0m\n" +
kkonganti@11 99 '-'.multiply(params.linewidth) + "\n" + "\033[0;31mCould not load " +
kkonganti@11 100 "default pipeline's process configuration. Please provide a pipeline \n" +
kkonganti@11 101 "name using the --pipeline option.\n\033[0m" + '-'.multiply(params.linewidth) + "\n")
kkonganti@11 102 System.exit(1)
kkonganti@11 103 }
kkonganti@11 104 }
kkonganti@11 105
kkonganti@11 106 // Function will return after sleeping for some time.
kkonganti@11 107 // Sleep time increases exponentially by task attempt.
kkonganti@11 108 def dynamic_retry(task_retry_num, factor_by) {
kkonganti@11 109 // sleep(Math.pow(2, task_retry_num.toInteger()) * factor_by.toInteger() as long)
kkonganti@11 110 sleep(Math.pow(1.27, task_retry_num.toInteger()) as long)
kkonganti@11 111 return 'retry'
kkonganti@11 112 }
kkonganti@11 113
kkonganti@11 114 // Function that will adjust the minimum number of CPU
kkonganti@11 115 // cores depending as requested by the user.
kkonganti@11 116 def min_cpus(cores) {
kkonganti@11 117 return Math.min(cores as int, "${params.max_cpus}" as int)
kkonganti@11 118 }