-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnextflow.config
executable file
·170 lines (147 loc) · 4.35 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
/*
Main configuration file:
Contains the following sections
- Shell handling
- External configuration files to include
- Parameters
- Profiles
- Workflow introspection
- Manifest
- Resource requirement function
*/
/*
################################################################################
Shell handling
-e: Exit immediately when command fails
-u: Exit if variable is unset
-o pipefail: prevents piping from causing a non-zero exit status
################################################################################
*/
process.shell = ['/bin/bash', '-euo', 'pipefail']
/*
################################################################################
Pipeline configuration files
################################################################################
*/
includeConfig 'conf/genome.config'
includeConfig 'conf/base.config'
/*
################################################################################
Parameters
################################################################################
*/
params {
// Help message
help = false
// Main parameters
library_type = false // Paired or single
library_ext = false // Can be false
samplesheet = false // Can be false
genome = false // HG38 or GRCH37
outdir = 'outdir' // Default outdir name in current dir
email = false // Required
path_bcl = false // Can remain false if samplesheet provided
index = false // single, paired or umi
umi_ext = false // Required if 'index = umi'
// Multiplexed data
// multiplex = false
// barcodes = false
// Umi specific
// with_umi = false
// Optional arguments
// sabre_optional_args = false
fastp_optional_args = false
umiadd_optional_args = false
umitools_optional_args = false
star_optional_args = false
featurecounts_optional_args = false
fastqc_optional_args = false
// SLURM specific: Defaults only, expecting to be overwritten
max_memory = 128.GB
max_cpus = 16
max_time = 120.h
partition = false
node_list = false
}
/*
################################################################################
Profiles
################################################################################
*/
profiles {
standard{
process.executor = 'local'
}
slurm {
executor.name = 'slurm'
executor.queueSize = 10
process.executor = 'slurm'
process.queue = params.partition
process.clusterOptions = "--mail-user=$params.email --mail-type=FAIL --nodelist=$params.node_list"
}
conda {
process.conda = "$projectDir/lib/conda.yml"
conda.cacheDir = "${HOME}/nf-condaEnv"
}
}
/*
################################################################################
Workflow introspection
################################################################################
*/
report {
enabled = true
file = "${params.outdir}/reports/report.html"
}
timeline {
enabled = true
file = "${params.outdir}/reports/timeline.html"
}
dag {
enabled = true
file = "${params.outdir}/reports/DAG.svg"
}
trace {
enabled = true
fields = 'process,task_id,hash,name,attempt,status,exit,realtime,cpus,memory,%cpu,vmem,rss,submit,start,complete,duration,realtime,rchar,wchar'
file = "${params.outdir}/reports/trace.txt"
}
/*
################################################################################
Check requested resources
################################################################################
*/
def check_resources(val, max){
// Check CPU value doesn't exceed the node limit
if( val instanceof Integer ) {
try {
return Math.min( val, max as int)
}
catch( all ) {
println "WARNING: Max cpus '${max}' is not valid. Using default value: ${val}"
return val
}
}
// Check the memory value does exceed the memory limit
if(val instanceof nextflow.util.MemoryUnit){
try{
def other = max as nextflow.util.MemoryUnit
return val.compareTo(other) == 1 ? other : val
}
catch(all){
println "WARNING: Max memory '${max}' is not valid. Using default value ${val}"
return val
}
}
// Check that the time duration does not exceed walltime limits
if( val instanceof nextflow.util.Duration ) {
try {
def other = max as nextflow.util.Duration
return val.compareTo(other) == 1 ? other : val
}
catch( all ) {
println "WARNING: Max time '${max}' is not valid. Using default value: ${val}"
return val
}
}
}