-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnextflow.config
338 lines (296 loc) · 11.3 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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
//working directory for temporary/intermediate files produced in the workflow processes
workDir = "$HOME/temp"
//global parameters
params {
// general options
sample_sheet = "./test_data/test_dataset_sample_sheet.csv"
queue = 'paidq'
project = '207f23bf-acb6-4835-8bfe-142436acb58c'
outdir = "./results/mouse"
peaks_outdir = "${params.outdir}/peak_calls"
publish_dir_mode = 'copy'
//Bowtie params for target genome
build_index = false
fasta = '/gpfs/shared_data/Bowtie2/mm39.fa' // required
index = '/gpfs/shared_data/Bowtie2/mm39_index/' // bowtie2 index path is required unless `build_index = true`
save_unaligned = false
// Bowtie params for spike-in genome
build_spike_index = false
spike_fasta = '/gpfs/shared_data/Bowtie2/GCF_000005845.2_ASM584v2_genomic.fa' //required
spike_index = '/gpfs/shared_data/Bowtie2/ecoli_index' // bowtie2 index path is required unless `build_spike_index = true`
//Optional: Picard module specific parameters
remove_dups = false
//Optional: Samtools view bam filtering parameters
filter_bam = true
mapq = 30 // use additional filters for -F or -f with ext.args in `samtools_filter:SAMTOOLS_VIEW` process config
//SEACR params
threshold = 0 //any value > 0 will use threshold, even if IgG is available in sample sheet
spike_norm = false
chrom_sizes = '/gpfs/shared_data/Bowtie2/mm39.chrom.sizes'
scale_factor_constant = 10000 //scientific notation NOT allowed
//MACS2 params
run_macs2 = true
no_control_macs2 = false // if true, do not use IgG control in peak calling
//MACS2 effective genome size params
gsize = 1.87e9 //default effective genome size for mouse from MACS2
calc_effective_gsize = false //if true, will override the value in gsize parameter
read_length = 150 //if calc_effective_gsize, provide illumina read-length in base pairs
//MultiQC
multiqc_config = './multiqc_config.yml'
extra_multiqc_config = ''
multiqc_logo = ''
}
// Computational resource allocation for the processes run in the workflow
process {
//Bowtie2 aligner process specific parameters
withName: BOWTIE2_ALIGN {
cpus = { 2 * task.attempt }
memory = { 32.GB * task.attempt }
ext.prefix = { "${meta.id}.sort" }
ext.args = '--local --very-sensitive-local --no-unal --no-mixed --no-discordant --phred33 -I 10 -X 700'
ext.args2 = '' //command line arguments for `samtools sort`
}
//SEACR peak calling resources
withName: SEACR_CALLPEAK {
cpus = { 1 * task.attempt }
memory = { 16.GB * task.attempt }
ext.version = '1.4' //version 1.3 and 1.4 supported
ext.args = '--normalize norm --mode stringent --remove yes'
publishDir = [ path: { "${params.peaks_outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
failOnError: true,
]
}
//MACS2 peak calling resources
withName: MACS2_CALLPEAK {
cpus = { 1 * task.attempt }
memory = { 16.GB * task.attempt }
ext.args = '-q 0.01 --keep-dup all --bdg'
publishDir = [ path: { "${params.peaks_outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
failOnError: true,
]
}
//BAMCOVERAGE bigwig file parameters
withName: DEEPTOOLS_BAMCOVERAGE {
cpus = { 4 * task.attempt }
memory = { 16.GB * task.attempt }
ext.args = '--normalizeUsing CPM --centerReads --verbose'
}
//Picard to mark duplicate reads
withName: PICARD_MARKDUPLICATES {
cpus = { 2 * task.attempt }
memory = { 32.GB * task.attempt }
ext.prefix = { "${meta.id}.markedDup" }
ext.args = '--CREATE_MD5_FILE true --CREATE_INDEX true'
}
//Picard to Remove duplicate reads
withName: PICARD_RMDUPLICATES {
cpus = { 2 * task.attempt }
memory = { 32.GB * task.attempt }
ext.prefix = { "${meta.id}.rmDup" }
ext.args = '--REMOVE_DUPLICATES true --CREATE_MD5_FILE true --CREATE_INDEX true'
}
//Samtools to filter the aligned reads
if ( params.filter_bam ){
withName: SAMTOOLS_VIEW {
cpus = { 2 * task.attempt }
memory = { 32.GB * task.attempt }
ext.prefix = { "${input.baseName}.filter" }
ext.args = { "-q $params.mapq" }
}
}
//Samtools sort by read name parameters
withName: SAMTOOLS_NSORT {
cpus = { 1 * task.attempt }
memory = { 32.GB * task.attempt }
ext.prefix = { "${bam.baseName.replaceAll(/.sort/,"")}.nsort" }
ext.args = '-n'
}
//convert bamtobed to bedgraph process specific resources
withName: BAMTOBEDGRAPH {
cpus = { 1 * task.attempt }
memory = { 8.GB * task.attempt }
ext.args = '' //for bedtools bamtobed
ext.args2 = '' //for bedtools genomecov
}
//Samtools sort by coordinate (for bedtools process below)
withName: SAMTOOLS_SORT {
cpus = { 1 * task.attempt }
memory = { 32.GB * task.attempt }
ext.prefix = { "${bam.baseName}.sort" }
ext.args = ''
}
//Samtools sort by coordinate (for bedtools process below)
withName: SAMTOOLS_INDEX {
cpus = { 1 * task.attempt }
memory = { 16.GB * task.attempt }
ext.args = ''
}
withName: SAMTOOLS_STATS {
cpus = { 1 * task.attempt }
memory = { 16.GB * task.attempt }
ext.args = ''
}
if ( params.build_index ){
//Bowtie2 aligner process specific parameters
withName: BOWTIE2_BUILD {
cpus = { 4 * task.attempt }
memory = { 32.GB * task.attempt }
ext.args = '--verbose'
}
}
withName: SAMTOOLS_FAIDX {
cpus = { 1 * task.attempt }
memory = { 16.GB * task.attempt }
ext.args = ''
}
//FASTQC process specific parameters
withName: FASTQC {
cpus = 1
memory = 16.GB
ext.args = ''
}
//FASTQC_TRIM process specific parameters
withName: FASTQC_TRIM {
cpus = 1
memory = 16.GB
ext.args = ''
}
//DEEPTOOLS_MULTIBIGWIGSUMMARY process specific parameters
withName: DEEPTOOLS_MULTIBIGWIGSUMMARY {
cpus = 1
memory = 16.GB
ext.args = ''
}
//DEEPTOOLS_PLOTFINGERPRINT process specific parameters
withName: DEEPTOOLS_PLOTFINGERPRINT {
cpus = 2
memory = 16.GB
ext.args = ''
}
//DEEPTOOLS_PLOTCORRELATION process specific parameters
withName: DEEPTOOLS_PLOTCORRELATION {
cpus = 1
memory = 16.GB
ext.args = '--colorMap turbo --plotNumbers'
}
//DEEPTOOLS_PLOTPCA process specific parameters
withName: DEEPTOOLS_PLOTPCA {
cpus = 1
memory = 16.GB
ext.args = ''
}
withName: 'SEACR_PLOTENRICHMENT|MACS2_PLOTENRICHMENT|MACSPEAKSTOBED' {
cpus = 1
memory = 16.GB
ext.args = ''
publishDir = [ path: { "${params.peaks_outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
failOnError: true,
]
}
//MultiQC process specific parameters
withName: MULTIQC {
cpus = { 1 * task.attempt }
memory = { 16.GB * task.attempt }
ext.args = '--verbose'
}
//Define the output directory name
publishDir = [
path: { "${params.outdir}/${task.process.tokenize(':')[-1].toLowerCase()}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
failOnError: true,
]
errorStrategy = "retry"
maxRetries = 2
}
//Create profiles to easily switch between the different process executors and platforms.
profiles {
//For running on an interactive session on cybertron with singularity module loaded
local_singularity {
process.executor = 'local'
singularity.enabled = true
}
//For executing the jobs on the HPC cluster with singularity containers
PBS_singularity {
process.executor = 'pbspro'
process.queue = "${params.queue}"
process.clusterOptions = "-P ${params.project}"
process.beforeScript = 'module load singularity'
singularity.enabled = true
}
/*
//For executing the jobs on the HPC cluster with apptainer containers
PBS_apptainer {
process.executor = 'pbspro'
process.queue = "${params.queue}"
process.clusterOptions = "-P ${params.project}"
process.beforeScript = 'module load apptainer'
apptainer.enabled = true
}
//For running on cybertron with apptainer module loaded
local_apptainer {
process.executor = 'local'
apptainer.enabled = true
}
//For executing the jobs on the HPC cluster with conda environments.
PBS_conda {
process.executor = 'pbspro'
process.queue = "${params.queue}"
process.clusterOptions = "-P ${params.project}"
conda.enabled = true
}
//For running interactively on local macbook with docker installed.
local_docker {
process.executor = 'local'
docker.enabled = true
}
*/
}
plugins {
id 'nf-validation'
}
// Set default registry for Apptainer, Docker, Podman and Singularity independent of -profile
// Will not be used unless Apptainer / Docker / Podman / Singularity are enabled
// Set to your registry if you have a mirror of containers
// https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/nextflow.config
apptainer.registry = 'quay.io'
docker.registry = 'quay.io'
podman.registry = 'quay.io'
singularity.registry = 'quay.io'
//Configs for singularity containers on cybertron
singularity {
autoMounts = true
engineOptions = '--debug'
cacheDir = "$HOME/singularity_test"
runOptions = '--containall --no-home'
}
//Configs for apptainer containers. Not supported on cybertron
apptainer {
autoMounts = true
ociAutoPull = false
engineOptions = '--debug'
cacheDir = "$HOME/apptainer_test"
runOptions = '--containall --no-home'
}
//Use personal conda environments on cybertron if conda_enabled = true
conda {
cacheDir = "$HOME/nxf_conda/envs/"
}
//Configs for docker containers on local macbook with 64Gb memory
docker {
temp = 'auto'
runOptions = "--platform linux/amd64 --memory=32g --cpus=0.000"
}
//overwrite reports when the workflow is executed again
report {
overwrite = true
}
dag {
overwrite = true
}