Repository navigation
Expand file tree
/
Copy pathnextflow.config
More file actions
290 lines (247 loc) · 9.64 KB
/
Copy pathnextflow.config
File metadata and controls
290 lines (247 loc) · 9.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
// Pipeline parameters
params {
// General defaults
errorStrategy = 'ignore'
monochrome_logs = null
prefix = null
readQualityScore = 20
help = null
force = null
// Directory defaults
omnition {
outputDir = "${launchDir}/results"
resultsDir = "${omnition.outputDir}/Sample_Files"
reportsDir = "${omnition.outputDir}/report"
assetsDir = "${projectDir}/assets"
modulesDir = "${projectDir}/modules"
workflowsDir = "${projectDir}/workflows"
}
// Assay defaults
core = null
do_merging = null
rna = null
atac = null
catac = null
cytometry = null
preset {
rna {
includeConfig "${projectDir}/configs/public/rna_preset.config"
}
atac {
includeConfig "${projectDir}/configs/public/atac_preset.config"
}
cytometry{
includeConfig "${projectDir}/configs/public/cytometry_preset.config"
}
do_merging{
includeConfig "${projectDir}/configs/public/do_merging_preset.config"
}
}
// Container stage suffix appended to every container repo name.
// Driven by the release flow: "" for public releases, "-test" for test
// releases, "-dev" for default/dev work. Updated by CI on tag deploys.
container_stage = ""
container_image {
r_public = "bioraddbg/omnition-r${params.container_stage}"
core_public = "bioraddbg/omnition-core${params.container_stage}"
dbg_public = "bioraddbg/omnition-dbg${params.container_stage}"
cytometry_public = "bioraddbg/omnition-cytometry${params.container_stage}"
customer_report_public = "bioraddbg/omnition-report${params.container_stage}"
archr_public = "bioraddbg/omnition-archr${params.container_stage}"
}
// Barcode defaults
barcode.force = null
// Resource defaults
maxCpus = 64
maxMemory = '500.GB'
maxTime = '12h'
}
manifest {
name = 'BioRadOpenSource/omnition'
description = 'Bio-Rad Omnition analysis software for single-cell data.'
defaultBranch = 'main'
mainScript = 'main.nf'
nextflowVersion = '!>=23.10.0, <=24.10.5'
version = 'v1.2.0-beta.2'
recurseSubmodules = true
}
// Process management settings
process {
// Cache based on contents
cache = 'lenient'
withName: SINGULARITY_PULL {
cache = false
}
// Setting error strategy
// 134 = Program aborted
// 104, 137, 143 = Out of memory
// 139 = Segfault
errorStrategy = { task.exitStatus in [104,134,137,139,143] ? 'retry' : params.errorStrategy }
maxRetries = 2
maxErrors = -1
// Dynamic resource configurations
withLabel: memory_xxsmall {
memory = { check_max( 0.9375.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max(12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_xsmall {
memory = { check_max( 3.75.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max(12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_small {
memory = { check_max( 7.5.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_medium {
memory = { check_max( 15.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_large {
memory = { check_max( 30.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_xlarge {
memory = { check_max( 60.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_xxlarge {
memory = { check_max( 120.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: memory_xxxlarge {
memory = { check_max( 250.GB * ( 2 ** ( task.attempt - 1 ) ), 'memory' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_xsmall {
cpus = { check_max( 1 ,'cpus' ) }
time = { check_max(12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_small {
cpus = { check_max( 2 ,'cpus' ) }
time = { check_max(12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_medium {
cpus = { check_max( 4 ,'cpus' ) }
time = { check_max(12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_large {
cpus = { check_max( 8, 'cpus' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_xlarge {
cpus = { check_max( 16, 'cpus' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_xxlarge {
cpus = { check_max( 32, 'cpus' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withLabel: cpu_xxxlarge {
cpus = { check_max( 64, 'cpus' ) }
time = { check_max( 12.h * ( 2 ** ( task.attempt - 1 ) ), 'time' ) }
}
withName: UMI_TOOLS_COUNT {
time = '30h'
}
withName: AGGREGATE_METRICS {
time = '30h'
}
withName: REANNOTATE_FRAGMENTS {
errorStrategy = 'ignore'
}
}
includeConfig "${projectDir}/configs/public/test.config"
// Execution profiles for defining container system settings
profiles {
standard {
singularity.enabled = true
singularity.autoMounts = true
singularity.cacheDir = "${projectDir}/singularity/"
// Singularity/Apptainer run options to fix home directory and binding issues
singularity.runOptions = '-B $PWD -B /tmp'
}
docker {
docker.enabled = true
docker.fixOwnership = true
docker.runOptions = "--shm-size 16g"
}
awsbatch {
includeConfig "${projectDir}/configs/public/aws.config"
}
tower {
includeConfig "${projectDir}/configs/public/tower.config"
}
}
plugins {
id 'nf-schema@2.2.0'
}
params.omnition.resultsDir = "${params.omnition.outputDir}/Sample_Files/"
params.omnition.reportsDir = "${params.omnition.outputDir}/report/"
// load into total_params what ever params.{assay} is not null
// [params.rna, params.atac, params.catac, params.cytometry]
def assays = [params.rna, params.cytometry, params.atac, params.catac]
def total_params = assays.findAll { it }.collectEntries { it }
// If total_params is not empty, then set params.core equal to it
if ((total_params) && ((params.rna && !params.cytometry) || ((params.rna && params.cytometry)) || (params.cytometry && !params.rna))) { // groovylint-disable-line
params.core = total_params
params.do_merging = params.core
} else if ((total_params) && ((params.atac) || (params.catac))) { // groovylint-disable-line
params.core = total_params
}
// Grab CLI params-file info
// Accessing parsed parameters variable via nextflow
// https://github.com/nextflow-io/nextflow/blob/master/modules/nextflow/src/main/groovy/nextflow/config/ConfigParser.groovy#L98
params.omnition.paramsFile = paramVars
def trace_timestamp = new java.util.Date().format( 'yyyyMMdd-HHmmss')
report {
enabled = true
file = params.prefix ? "${params.omnition.outputDir}/pipeline_info/${params.prefix}-omnition-execution_report-${trace_timestamp}.html" : "${params.omnition.outputDir}/pipeline_info/omnition-execution_report-${trace_timestamp}.html"
}
timeline {
enabled = true
file = params.prefix ? "${params.omnition.outputDir}/pipeline_info/${params.prefix}-omnition-timeline-${trace_timestamp}.html" : "${params.omnition.outputDir}/pipeline_info/omnition-timeline-${trace_timestamp}.html"
}
trace {
enabled = true
fields = "task_id,hash,native_id,name,status,exit,submit,duration,realtime,cpus,%cpu,peak_rss,peak_vmem,rchar,wchar"
file = params.prefix ? "${params.omnition.outputDir}/pipeline_info/${params.prefix}-omnition-trace-${trace_timestamp}.txt" : "${params.omnition.outputDir}/pipeline_info/omnition-trace-${trace_timestamp}.txt"
}
dag {
enabled = true
file = params.prefix ? "${params.omnition.outputDir}/pipeline_info/${params.prefix}-omnition-dag-${trace_timestamp}.html" : "${params.omnition.outputDir}/pipeline_info/omnition-dag-${trace_timestamp}.html"
}
// Function for comparing resource requests to available resources
def check_max(obj, type) {
if (type == 'cpus') {
try {
return Math.min( obj, params.maxCpus as int )
} catch (all) {
println "[ERROR] Max cpus '${params.maxCpus}' is not valid. Using default value: $obj"
return obj
}
} else if (type == 'memory') {
try {
if (obj.compareTo(params.maxMemory as nextflow.util.MemoryUnit) == 1)
return params.maxMemory as nextflow.util.MemoryUnit
else
return obj
} catch (all) {
println "[ERROR] Max memory '${params.maxMemory}' is not valid. Using default value: $obj"
return obj
}
} else if (type == 'time') {
try {
if (obj.compareTo(params.maxTime as nextflow.util.Duration) == 1)
return params.maxTime as nextflow.util.Duration
else
return obj
} catch (all) {
println "[ERROR] Max time '${params.maxTime}' is not valid. Using default value: $obj"
return obj
}
}
}
// This allows R scripts to access other scripts in bin dir
env {
SCRIPT_PATH = "${projectDir}/bin"
}