forked from BCCDC-PHL/WasteFlow
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextflow.config
More file actions
226 lines (180 loc) · 5.66 KB
/
nextflow.config
File metadata and controls
226 lines (180 loc) · 5.66 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
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
manifest {
name = 'WasteFlow'
author = 'Jessica M Caleta'
homePage = 'https://github.com/j3551ca/WasteFlow'
description = 'Pathogen surveillance in Nextflow'
mainScript = 'main.nf'
version = '2.1.0'
}
//paramater-defining functions:
def robust_path(dir) {
if (dir.toString() =~ /[^\/]$/) {
data_dir = dir.toString() + '/'
}
else {
data_dir = dir.toString()
}
return data_dir
}
def robust_fq(illumina_suffix, fastq_suffix) {
def pe_reads = []
for (pair in illumina_suffix) {
for (ext in fastq_suffix) {
pe_reads.add(params.data_dir.toString() + '*' + \
pair.toString() + ext.toString())
}
}
return pe_reads
}
//if (params.refine){
// def refined = '--lineages'
//}
//pipeline parameters
params {
//help message
help = null
//version number
version = null
//conda env local cache
conda_cache = null
//Bin directory holding scripts and functions
bin = "${projectDir}/bin"
//User-defined directory containing sequences to be analyzed
dir="/mandatory/path/to/data"
//absolute path to data with trailing /
data_dir = robust_path(params.dir)
//WasteFlow results directory to output
out_dir="${params.data_dir}WF_v${manifest.version}_results"
//User-defined directory to write cumulative mutation table
mut_dir = "/mandatory/path/to/summary/"
//Abs pathway to previous mutation tables to aggragate
rerun_mut = null
//Set number of threads used by data.table
dt_threads = 60
//Create annotated, clean, formatted output of mutations per sample in data_dir
annotate_snps = false
//abs path - used to re-call lineages retroactively across all depth and vcf files of past samples after Freyja barcode gets updated in freyja_env
//must be passed in quotation marks from cli
rerun_lins = null
//reference for alignment
ref = "${projectDir}/resources/cov2_ref.fasta"
//input sequences
illumina_suffix = ['*_R{1,2}_001', '*_R{1,2}', '*_{1,2}']
fastq_suffix = ['.fastq.gz', '.fq.gz', '.fastq', '.fq']
pe_reads = robust_fq(params.illumina_suffix, params.fastq_suffix)
//pe_reads = "${params.data_dir}*_{R1,R2}_*.fastq.gz"
//Combined sequencing replicates of the same sample
combine_reps = false
//switch for processing reads with trim galore instead of fastp
trim_galore = false
//switch for aligning reads with bwa-mem instead of minimap2
bwa = false
//additional adapters to include during trimming with fastp
adapters = "${projectDir}/resources/cov2_adapter.fasta"
// this controls primer trimming step. Default is for primers to be trimmed.
skip_trim = false
//primer trimming with iVar
// only needed when skip_trim = false
primers = "${projectDir}/resources/articV5.3.bed"
//additional options for iVar trim
ivar_flags = '-m 30 -q 20 -s 4'
//ivar trim include reads that are outside of primer regions/ no primers (Nextera)
// only needed when skip_trim = false
primerless_reads = false
//ivar trim specify primer pairs tsv file when amplicons are fragmented (Nextera)
primer_pairs = "no_file"
//call variants using Freebayes instead of iVar (used as part of Freyja) default
freebayes = false
//additional options for Freebayes
freeb_flags = '-p 1 --pooled-continuous --min-coverage 5'
//gff v3 file of pathogen for vcf annotation with bcftools
gff3 = "${projectDir}/resources/MN908947.3.gff3"
//minimum read depth to consider sites by freyja demix. May cause previously distinct lineages to
//have the same set of defining mutations and be collapsed into shared phylogeny (*_collapsed_lineages.yml)
demixdepth = 10
//path to custom barcode file
barcode = "no_file"
//activate freyja bootstrap estimates of each lineage (*_lineages.csv) and WHO VOI/VOC (*_summarized.csv)
boot = false
//freyja number of bootstraps to conduct for relative abundances of lineages in samples
bootnum=100
//resolve freyja summary down to lineages
//refine = false
//refined=''
freyja_plot = '--lineages'
}
//seamlessly run pipeline on different execution systems by modifying
//the process section of the config file. ex. AWS, SLURM, sun grid engine:
process {
withName: align_minimap2 {
cpus = 28
}
withName: primer_trim {
conda = "${projectDir}/envs/freyja_env.yml"
}
withName: var_call_freebayes {
conda = "${projectDir}/envs/bcf_free_env.yml"
}
//withName: annotate_bcf {
//conda = "${projectDir}/envs/bcf_free_env.yml"
//}
withName: annotate_snpeff {
conda = "${projectDir}/envs/snpeff_env.yml"
//"/home/jess.cal/.conda/envs/snpeff_env"
}
withName: var_call_freyja {
conda = "${projectDir}/envs/freyja_env.yml"
}
withName: 'lineage_freyja|bootstrap_freyja' {
conda = "${projectDir}/envs/freyja_env.yml"
cpus = 28
}
withName: summarize_freyja {
conda = "${projectDir}/envs/freyja_env.yml"
}
withName: vcf2table {
conda = "${projectDir}/envs/vcf_2_table.yml"
}
withName: collectTables {
conda = "${projectDir}/envs/vcf_2_table.yml"
}
withName: barcode_version {
conda = "${projectDir}/envs/freyja_env.yml"
}
// executor = 'sge'
// queue = 'all.q'
// clusterOptions = '-S /bin/bash'
// penv = 'smp'
}
profiles {
conda {
process.conda = "${projectDir}/envs/wf_env.yml"
conda.useMamba = false
enabled = true
conda.createTimeout = '1 h'
if (params.conda_cache) {
conda.cacheDir = params.conda_cache
}
}
//can add docker here
}
//html displaying breakdown of time taken to execute workflow
timeline {
enabled = true
file = "${params.out_dir}/pipeline_reports/WasteFlow_timeline.html"
}
//html of cpu/mem usage
report {
enabled = true
file = "${params.out_dir}/pipeline_reports/WasteFlow_usage.html"
}
//dag of WF workflow
dag {
enabled = true
file = "${params.out_dir}/pipeline_reports/WasteFlow_dag.html"
}
//track failed samps
trace {
enabled = true
file = "${params.out_dir}/pipeline_reports/WasteFlow_trace.txt"
}