-
Notifications
You must be signed in to change notification settings - Fork 2
/
nextflow.config
322 lines (294 loc) · 10.1 KB
/
nextflow.config
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
/*
* -------------------------------------------------
* nanowgs Nextflow config file
* -------------------------------------------------
* Default config options for all environments.
*/
/*
* pipeline input parameters
*/
params {
genomeref = "/staging/leuven/stg_00002/lcb/jdemeul/reference/chm13_v2.0_maskedY.rCRS/indexes/minimap2-ont/genome.fa"
// genomerefindex = "${file(params.genomeref).getParent()}/${file(params.genomeref).getBaseName()}_map-ont.mmi"
// fastqs = "/staging/leuven/stg_00002/lcb/jdemeul/projects/2020_fiberseq/data/20210503_S2_2folddilser_100kto3k_nano-gTag/20210503_1530_MN34250_AGI654_ad1ed051/fastq_pass/barcode06/"
ont_base_dir = "/staging/leuven/stg_00002/lcb/jdemeul/projects/2021_ASAP/data/raw/testsample/20210719_ASA_Edin_BA24_14_18/"
basecall_dir = ""
guppy_gpu = true
min_read_qscore = 10
sampleid = "ASA_Edin_BA24_14_18_chr20"
outdir = "./nanowgs_out_${params.sampleid}"
tracedir = "${params.outdir}/pipeline_info"
sv_min_support = 3
sv_min_mapq = 1
sv_min_size = 30
tandem_repeats = "/staging/leuven/stg_00002/lcb/jdemeul/reference/chm13_v2.0_maskedY.rCRS/annotation/trf.bed"
sv_merge_max_dist = 1000
megalodon_model = "res_dna_r941_min_modbases-all-context_v001.cfg"
// megalodon_model = "res_dna_r941_min_modbases_5mC_v001.cfg"
medaka_snp_model = "r941_prom_sup_snp_g507"
medaka_polish_model = "r941_prom_sup_g507"
guppy_config = "/staging/leuven/stg_00002/lcb/jdemeul/projects/2021_ASAP/data/20211227_Bonito_0.5.0_FiberSeq_training/6ma5mc_dna_r9.4.1_e8_sup_v3.3.cfg"
// guppy_config = "dna_r9.4.1_450bps_sup.cfg" and even dna_r9.4.1_450bps_modbases_5mc_cg_sup.cfg for Guppy 6.1.1
// rerio_base = "/staging/leuven/stg_00002/lcb/jdemeul/software/rerio/"
megalodon_recall = true
megalodon_dir = ""
megalodon_modmotif = 'Y A 0'
megalodon_modmotif2 = 'Z CG 0'
// megalodon_modmotif = 'm CG 0' # note, use 'none' for modmotif2 if wanting to call only 5mC
// guppy_barcode_kit = "/staging/leuven/stg_00002/lcb/jdemeul/software/rerio/basecall_models/"
with_gpu = true
deepvariant_with_gpu = false
gpu_devices = "cuda:all"
rebasecall = false
processed_reads = ""
aligned_sam = ""
aligned_bam = ""
shasta_config = "Nanopore-Oct2021.conf"
shasta_minreadlength = ""
karyotype = "xx"
subset_calls = ""
}
// Global default params, used in configs
workDir = '/scratch/leuven/302/vsc30235/nextflow'
// Process parameters
params.max_memory = 160.GB
params.max_cpus = 36
params.max_time = 168.h
// 160 GB 36 cores 168h are max on VSC
// Profiles
profiles {
// debug { process.beforeScript = 'echo $HOSTNAME' }
docker {
enabled = true
runOptions = '-u \$(id -u):\$(id -g)'
}
standard {
process.executor = 'local'
}
singularity {
singularity.enabled = true
singularity.autoMounts = true
singularity.cacheDir = "/staging/leuven/stg_00002/lcb/jdemeul/software/singularity_images/"
singularity.runOptions = '--cleanenv -H $PWD -B /lustre1,/staging,/data,${VSC_SCRATCH},${TMPDIR},${VSC_SCRATCH}/tmp:/tmp'
}
qsub {
process.clusterOptions = "-A lp_symbiosys"
process.executor = 'pbs'
}
debug {
process.clusterOptions = "-A lp_symbiosys -l qos=debugging"
}
}
// executor {
// $pbs {
// pollInterval = '30min'
// dumpInterval = '30min'
// }
// }
// Manifest info
manifest {
name = 'nanowgs'
author = 'Jonas Demeulemeester'
homePage = 'https://github.com/jdemeul/nanowgs'
description = 'A pipeline to analyse Nanopore WGS data'
mainScript = 'main.nf'
nextflowVersion = '>=19.10.0'
version = '0.0.1'
}
process {
// cpus = { check_max( 8 * task.attempt, 'cpus' ) }
// memory = { check_max( 32.GB * task.attempt, 'memory' ) }
// time = { check_max( 1.h * task.attempt, 'time' ) }
errorStrategy = { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' }
maxRetries = 1
maxErrors = '-1'
// Process-specific resource requirements
withLabel: cpu_low {
cpus = { check_max( 8 * task.attempt, 'cpus' ) }
}
withLabel: cpu_mid {
cpus = { check_max( 18 * task.attempt, 'cpus' ) }
}
withLabel: cpu_high {
cpus = { check_max( 36 * task.attempt, 'cpus' ) }
}
withLabel: mem_low {
memory = { check_max( 32.GB * task.attempt, 'memory' ) }
}
withLabel: mem_mid {
memory = { check_max( 64.GB * task.attempt, 'memory' ) }
}
withLabel: mem_high {
memory = { check_max( 160.GB * task.attempt, 'memory' ) }
}
withLabel: time_low {
time = { check_max( 1.h * task.attempt, 'time' ) }
}
withLabel: time_mid {
time = { check_max( 24.h * task.attempt, 'time' ) }
}
withLabel: time_high {
time = { check_max( 168.h * task.attempt, 'time' ) }
}
withLabel: with_gpus {
clusterOptions = '-l nodes=1:ppn=18:gpus=2:skylake -l partition=gpu -l pmem=5gb -A lp_symbiosys -l walltime=168:00:00'
maxForks = 1
containerOptions = { workflow.containerEngine == "singularity" ? '--nv':
( workflow.containerEngine == "docker" ? '--gpus all': null ) }
}
withLabel: with_v100 {
clusterOptions = '-l nodes=1:ppn=4:gpus=1:cascadelake -l partition=gpu -l pmem=20gb -A lp_symbiosys -l walltime=24:00:00'
maxForks = 1
containerOptions = { workflow.containerEngine == "singularity" ? '--nv':
( workflow.containerEngine == "docker" ? '--gpus all': null ) }
}
withLabel: with_p100node {
clusterOptions = '-l nodes=1:ppn=36:gpus=4:skylake -l partition=gpu -l pmem=5gb -A lp_symbiosys -l walltime=168:00:00'
maxForks = 1
containerOptions = { workflow.containerEngine == "singularity" ? '--nv':
( workflow.containerEngine == "docker" ? '--gpus all': null ) }
}
withLabel: with_p100 {
clusterOptions = '-l nodes=1:ppn=9:gpus=1:skylake -l partition=gpu -l pmem=5gb -A lp_symbiosys -l walltime=168:00:00'
maxForks = 1
containerOptions = { workflow.containerEngine == "singularity" ? '--nv':
( workflow.containerEngine == "docker" ? '--gpus all': null ) }
}
withLabel: gpu_debug {
clusterOptions = '-l nodes=1:ppn=36:gpus=4 -l partition=gpu -l qos=debugging -A lp_symbiosys -l walltime=00:30:00'
maxForks = 1
containerOptions = { workflow.containerEngine == "singularity" ? '--nv':
( workflow.containerEngine == "docker" ? '--gpus all': null ) }
}
withLabel: cpu_debug {
clusterOptions = '-l nodes=1:ppn=36 -l qos=debugging -A lp_symbiosys -l walltime=00:30:00'
maxForks = 1
}
withLabel: bigmem {
// numanodes = 2
// lprocs = numanodes * 14
// numthreads = lprocs * 4
clusterOptions = '-L tasks=1:lprocs=42:place=numanode=3 -l walltime=24:00:00 -l partition=superdome -q qsuperdome -A lp_symbiosys'
// queue = "qsuperdome"
maxForks = 1
}
withLabel: bigmemnode {
clusterOptions = 'qsub -l nodes=1:ppn=36 -l pmem=20gb -l partition=bigmem -A lp_symbiosys -l walltime=24:00:00'
maxForks = 1
}
withLabel:minimap {
container = 'zeunas/minimap2:2.24'
}
withLabel:samtools {
container = 'zeunas/samtools:1.14'
}
withLabel:lra {
container = 'zeunas/lra:1.3.3'
}
withLabel:cutesv {
container = 'zeunas/cutesv:1.0.13'
}
withLabel:sniffles {
container = 'zeunas/sniffles:2.0.3'
}
withLabel:svim {
container = 'zeunas/svim:2.0.0'
}
withLabel:survivor {
container = 'zeunas/survivor:ed1ca51'
}
withLabel:hapdup {
container = 'zeunas/hapdup:0.6-nano-hq'
}
withLabel:dipdiff {
container = 'zeunas/dipdiff:0.3-c773070-minimap2.24'
}
// withLabel:deepvariant {
// container = 'kishwars/pepper_deepvariant:r0.5-gpu'
// }
// withLabel:pepper {
// container = 'kishwars/pepper_deepvariant:r0.4.1'
// }
withLabel:shasta {
container = 'zeunas/shasta:0.9.0'
// container = 'zeunas/shasta-docker:latest'
}
withLabel:quast {
container = 'zeunas/quast:5.1.0rc1'
}
withLabel:megalodon {
container = 'zeunas/guppy-5.0.16-megalodon_v2.4.2-rerio'
}
withLabel:medaka {
container = 'zeunas/medaka:1.6.0'
}
withLabel:bcftools {
container = 'zeunas/bcftools:1.14'
}
withLabel:guppy {
container = 'zeunas/guppy-6.1.1'
}
withLabel:fastp {
container = 'zeunas/fastp:0.23.2'
}
withLabel:pigz {
container = 'zeunas/pigz-ng:2.6-2.0.5'
}
withLabel:racon {
container = 'zeunas/racon:v1.4.21-b591b12'
}
withLabel:modbam2bed {
container = 'zeunas/modbam2bed:0.5.1'
}
withLabel:longphase {
container = 'zeunas/longphase:1.1'
}
withLabel:seqtk {
container = 'zeunas/seqtk:7c04ce7'
}
withLabel:flye {
container = 'zeunas/flye:2.9'
}
withLabel:crossstitch {
container = 'zeunas/crossstitch:e49527b'
}
withLabel:haptagtransfer {
container = 'zeunas/haptagtransfer:0.1'
}
withLabel:mummer {
container = 'zeunas/mummer:4.0.0rc1'
}
}
// Function to ensure that resource requirements don't go beyond
// a maximum limit
def check_max(obj, type) {
if (type == 'memory') {
try {
if (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1)
return params.max_memory as nextflow.util.MemoryUnit
else
return obj
} catch (all) {
println " ### ERROR ### Max memory '${params.max_memory}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'time') {
try {
if (obj.compareTo(params.max_time as nextflow.util.Duration) == 1)
return params.max_time as nextflow.util.Duration
else
return obj
} catch (all) {
println " ### ERROR ### Max time '${params.max_time}' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'cpus') {
try {
// return params.max_cpus as int
return Math.min( obj, params.max_cpus as int )
} catch (all) {
println " ### ERROR ### Max cpus '${params.max_cpus}' is not valid! Using default value: $obj"
return obj
}
}
}