-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnextflow.config
76 lines (71 loc) · 2.25 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
params {
input = null // input path: absolute file path
outdir = null
tracedir = "${outdir}/pipeline_info"
mode = null // flye assembly mode: pacbio-raw, pacbio-corr, pacbio-hifi, nano-raw, nano-corr, nano-hq
reference = null
gff = null
// Default resources
max_memory = '256.GB'
max_cpus = 32
max_time = '240.h'
}
profiles {
mamba {
conda.enabled = true
conda.useMamba = true
docker.enabled = false
}
docker {
conda.enabled = false
conda.useMamba = false
docker.enabled = true
//docker.sudo = true
}
}
def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss')
timeline {
enabled = true
file = "${params.tracedir}/execution_timeline_${trace_timestamp}.html"
}
report {
enabled = true
file = "${params.tracedir}/execution_report_${trace_timestamp}.html"
}
trace {
enabled = true
file = "${params.tracedir}/execution_trace_${trace_timestamp}.txt"
}
dag {
enabled = true
file = "${params.tracedir}/pipeline_dag_${trace_timestamp}.html"
}
includeConfig 'conf/modules.config'
includeConfig 'conf/base.config'
def check_max(obj, type) {
switch (type) {
case 'memory':
try {
return (obj.compareTo(params.max_memory as nextflow.util.MemoryUnit) == 1) ? params.max_memory as nextflow.util.MemoryUnit : obj
} catch (all) {
println "ERROR: Max memory '${params.max_memory}' is not valid! Using default value: $obj"
return obj
}
case 'time':
try {
return (obj.compareTo(params.max_time as nextflow.util.Duration) == 1) ? params.max_time as nextflow.util.Duration : obj
} catch (all) {
println "ERROR: Max time '${params.max_time}' is not valid! Using default value: $obj"
return obj
}
case 'cpus':
try {
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
}
default:
throw new IllegalArgumentException("Invalid type: $type")
}
}