forked from bactopia/bactopia
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextflow.config
More file actions
102 lines (91 loc) · 2.86 KB
/
nextflow.config
File metadata and controls
102 lines (91 loc) · 2.86 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
// main script name
manifest {
author = 'Robert A. Petit III'
name = 'bactopia'
homePage = 'https://github.com/bactopia/bactopia'
description = 'An extensive workflow for processing Illumina sequencing of bacterial genomes.'
mainScript = 'main.nf'
version = '1.4.11'
nextflowVersion = '>=19'
}
// Set container/conda env version
container_version = '1.4.x'
// Includes
includeConfig "${baseDir}/conf/params.config"
includeConfig "${baseDir}/conf/base.config"
includeConfig "${baseDir}/conf/profiles.config"
if (params.nfconfig) {
includeConfig check_path(params.nfconfig)
}
if (!params.conda_help) {
// Reporting configuration
timeline {
enabled = true
file = "${params.infodir}/bactopia-timeline.html"
}
report {
enabled = true
file = "${params.infodir}/bactopia-report.html"
}
trace {
enabled = true
file = "${params.infodir}/bactopia-trace.txt"
fields = 'task_id,hash,native_id,process,tag,name,status,exit,module,container,cpus,time,disk,memory,attempt,start,complete,duration,realtime,queue,%cpu,%mem,rss,vmem'
}
}
// Process configuration
process.ext.template = {"${task.process}.sh"}
// Function to ensure that resource requirements don't go beyond a maximum limit
// Source: https://github.com/nf-core/rnaseq/blob/master/nextflow.config
def check_max(obj, max, type) {
if (type == 'memory') {
try {
if (obj > max)
return max
else
return obj
} catch (all) {
println "ERROR - Max memory '${params.max_memory} GB' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'time') {
try {
max_time = (params.max_time).m
if (obj > max)
return max
else
return obj
} catch (all) {
println "ERROR - Max time '${params.max_time} minutes' is not valid! Using default value: $obj"
return obj
}
} else if (type == 'cpus') {
try {
if (obj == 'request') {
return max
} else {
return Math.min(obj, max)
}
} catch (all) {
println "ERROR - Max cpus '${Math.min(obj, max)}' is not valid! Using default value: ${max}"
return obj
}
}
}
def check_path(file_path) {
// Try relative first
launchDir = System.properties['user.dir']
relative_path = "${launchDir}/${file_path}"
File file_obj = new File(relative_path)
if (file_obj.exists()) {
return relative_path
} else {
// Try as absolute path
file_obj = new File(file_path)
if (file_obj.exists()) {
return file_path
} else {
println "ERROR - Unable to locate '${params.nfconfig}' please check it exists"
}
}
}