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