-
Notifications
You must be signed in to change notification settings - Fork 1
/
nextflow.config
329 lines (315 loc) · 12.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
/* RatesTools version 1.2.4
Michael G. Campana and Ellie E. Armstrong, 2020-2024
Smithsonian Institution and Stanford University
CC0: To the extent possible under law, the Smithsonian Institution and Stanford
University have waived all copyright and related or neighboring rights to RatesTools;
this work is published from the United States. You should have received a copy of the
CC0 legal code along with this work. If not, see
<http://creativecommons.org/publicdomain/zero/1.0/>.
We politely request that this work be cited as:
Armstrong, E.E. & M.G. Campana. 2023. RatesTools: a Nextflow pipeline for detecting
de novo germline mutations in pedigree sequence data. Bioinformatics. 39: btac784.
doi: 10.1093/bioinformatics/btac784. */
manifest {
name = 'RatesTools'
author = 'Michael G. Campana, Ellie E. Armstrong'
homePage = 'https://github.com/campanam/RatesTools'
description = 'Pipeline to calculate de novo mutation rates'
mainScript = 'ratestools.nf'
version = '1.2.4'
nextflowVersion = '>=23.10.0'
}
params {
refseq = "$launchDir/ref.fa" // Reference sequence
libraries = "$launchDir/data.csv" // File detailing sample reads
readDir = "$launchDir/RawData/" // Path to reads
bwa_alg = "" // algorithm for BWA index. Value "" permits BWA to infer algorithm
markDuplicates = "picard" // Choice of "picard", "samtools" or "sambamba" for markDuplicates
picard_conda = false // Install Picard via Nextflow Conda handling
picard = "$launchDir/picard.jar" // Path for Picard jar file. Ignore if using Conda-installed Picard.
picard_java = "" // Java options for Picard
gatk_conda = false // Install GATK via Nextflow Conda handling
gatk_build = 3 // Major version number of GATK. Currently supported values are 3 and 4.
gatk = "$launchDir/GenomeAnalysisTK.jar" // Path for GATK jar file. Ignore if using Conda-installed GATK.
gatk_java = "" // Java options for GATK
filter_bams = false // Filter BAM alignments before genotyping
phase = true // Phase haplotypes using WhatsHap trio-phasing
whatshap_opts = "" // Additional options for whatshap phase command
region_filter = true // Remove low-mappability/low-quality regions
gm_tmpdir = '/tmp' // Scratch directory for GenMap indexing
gm_opts = '-K 30 -E 2' // Options for GenMap mapping (except threading)
rm_species = "Felidae" // Species name for RepeatMasker
rm_mask_opts = '-gccalc -nolow -xsmall' // Options for RepeatMasker (except threading)
rm_model_opts = '' // Options for RepeatModeler (except threading and -lib)
indelpad = 5 // Number of bases to remove on each side of an indel
prefix = "test" // Prefix for final datasets
outdir = "test_results" // Directory for final results
dam = "SRR" // Sample name for dam
sire = "SRR2" // Sample name for sire
vcftools_site_filters = "--minDP 30 --minGQ 65 --maxDP 250 --max-missing 1 --min-alleles 1 --max-alleles 2" // Site filters to pass to VCFtools. Set to "NULL" to ignore this filter.
gatk_site_filters = '--filterName "filter" --filterExpression "QUAL < 30.0 || QD < 2.0 || FS > 60.0 || MQ < 40.0 || SOR > 3.0 || ReadPosRankSum < -3 || ReadPosRankSum > 3 || MQRankSum < -12.5"' // Site filters to pass to GATK. Set to 'NULL' to ignore this filter.
chr_file = "$launchDir/chr.txt" // File listing chromosomes to keep in analysis. Set to "NULL" to ignore this filter.
min_contig_length = 1 // Minimum length of contig (before filtering) to retain in analysis
min_filt_contig_length = 1 // Minimum length of contig (after filtering) to retain in analysis
dnm_opts = "-b 100 -M 10 -w 100000 -l 100000 -S 50000 --parhom" // options for calc_denovo_mutation_rate
dnm_clump = 100 // Number of bases to consider a DNM candidate clump. 0 does not removed clumps.
email = "NULL" // Email to send completion status to. Set to "NULL" for no email.
}
modules {
// List of Modules required for each executable. Set to "" for null value
samtools = ""
bcftools = ""
bwa = ""
java = ""
sambamba = ""
gzip = ""
genmap = ""
ruby = ""
whatshap = ""
RepeatMasker = ""
RepeatModeler = ""
vcftools = ""
bedtools = ""
bgzip = ""
tabix = ""
awk = ""
R = ""
}
conda.enabled = true
conda.useMamba = true // Install Conda environments using Mamba manager
picardCondaVer = { params.gatk_build == 3 ? 'bioconda::picard=2.23.8' : 'bioconda::picard=3.1.0 conda-forge::openjdk=17.0.9' } // Get appropriate version of Picard for GATK build
profiles {
standard {
process {
executor = 'local'
errorStrategy = { task.attempt < 4 ? 'retry' : 'finish' }
maxRetries = 3
// Setting modules for each process separately to minimize dependency incompatibilities
withName: 'prepareRef|alignSeqs' {
module = [modules.samtools, modules.bwa].minus("")
}
withName: markDuplicates {
if ( params.picard_conda ) {
conda = picardCondaVer
module = [modules.sambamba, modules.samtools].minus("")
} else {
module = [modules.java, modules.sambamba, modules.samtools].minus("")
}
}
withName: mergeLibraries {
module = [modules.samtools].minus("")
}
withName: fixMate {
if ( params.picard_conda ) {
conda = picardCondaVer
} else {
module = [modules.java].minus("")
}
}
withName: 'realignIndels|callVariants' {
if ( params.gatk_conda && params.picard_conda ) {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8 bioconda::picard=2.23.8'
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 bioconda::picard=3.1.0 conda-forge::openjdk=17.0.9'
}
} else if ( params.picard_conda ) {
conda = picardCondaVer
} else if ( params.gatk_conda ) {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8'
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 conda-forge::openjdk=17.0.9'
}
} else {
module = [modules.java].minus("")
}
}
withName: filterBAMs {
if ( params.gatk_conda ) {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8'
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 conda-forge::openjdk=17.0.9'
}
} else {
module = [modules.java].minus("")
}
}
withName: genotypegVCFs {
if ( params.gatk_conda ) {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8'
module = [modules.gzip].minus("")
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 conda-forge::openjdk=17.0.9'
module = [modules.gzip].minus("")
}
} else {
module = [modules.java,modules.gzip].minus("")
}
}
withName: genMapIndex {
module = [modules.genmap].minus("")
}
withName: genMapMap {
module = [modules.genmap,modules.ruby].minus("")
}
withName: repeatMask {
module = [modules.RepeatMasker].minus("")
}
withName: repeatModeler {
module = [modules.RepeatModeler].minus("")
cpus = 2
}
withName: repeatMaskRM {
module = [modules.RepeatMasker,modules.ruby].minus("")
}
withName: 'maskIndels|calcDNMRate|generateSummaryStats' {
module = [modules.ruby].minus("")
}
withName: simplifyBed {
module = [modules.bedtools].minus("")
}
withName: filterChr {
module = [modules.vcftools,modules.gzip,modules.awk,modules.bcftools].minus("")
}
withName: 'phaseTrio' {
module= [modules.whatshap,modules.gzip].minus("")
}
withName: splitTrios {
module = [modules.vcftools,modules.gzip,modules.bcftools].minus("")
}
withName: pullDPGQ {
module = [modules.bcftools].minus("")
}
withName: plotDPGQ {
module = [modules.R].minus("")
}
withName: splitVCFs {
module = [modules.ruby,modules.bgzip].minus("")
}
withName: vcftoolsFilterSites {
module = [modules.vcftools,modules.bgzip,modules.bcftools].minus("")
}
withName: gatkFilterSites {
if ( params.gatk_conda ) {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8'
module = [modules.tabix,modules.vcftools,modules.bcftools].minus("")
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 conda-forge::openjdk=17.0.9'
module = [modules.tabix,modules.vcftools,modules.bcftools].minus("")
}
} else {
module = [modules.java,modules.tabix,modules.vcftools,modules.bcftools].minus("")
}
}
withName: filterRegions {
module = [modules.bedtools,modules.vcftools,modules.gzip,modules.bcftools].minus("")
}
withName: summarizeDNM {
module = [modules.ruby,modules.gzip,modules.bcftools].minus("")
}
withName: 'sanityCheckLogs' {
module = [modules.gzip].minus("")
}
}
}
conda {
params {
picard_conda = true
gatk_conda = true
}
process {
executor = 'local'
errorStrategy = { task.attempt < 4 ? 'retry' : 'finish' }
maxRetries = 3
// Setting modules for each process separately to minimize dependency incompatibilities
withName: 'prepareRef|alignSeqs' {
conda = 'bioconda::bwa=0.7.17 bioconda::samtools=1.18 conda-forge::libzlib=1.2.13'
}
withName: markDuplicates {
if ( params.markDuplicates == "picard" ) {
conda = picardCondaVer
} else if (params.markDuplicates == 'samtools') {
conda = 'bioconda::samtools=1.18 conda-forge::libzlib=1.2.13'
} else {
conda = 'bioconda::sambamba=0.8.2 conda-forge::libzlib=1.2.13'
}
}
withName: mergeLibraries {
conda = 'bioconda::samtools=1.18 conda-forge::libzlib=1.2.13'
}
withName: fixMate {
conda = picardCondaVer
}
withName: 'realignIndels|callVariants' {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8 bioconda::picard=2.23.8'
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 bioconda::picard=3.1.0 conda-forge::openjdk=17.0.9'
}
}
withName: 'filterBAMs|genotypegVCFs' {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8 conda-forge::gzip'
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 conda-forge::openjdk=17.0.9 conda-forge::gzip'
}
}
withName: 'genMapIndex|genMapMap' {
conda = 'bioconda::genmap=1.2.0 conda-forge::ruby=3.2.2'
}
withName: 'repeatMask|repeatMaskRM' {
conda = 'bioconda::repeatmasker=4.1.5 conda-forge::ruby=3.2.2'
}
withName: repeatModeler {
conda = 'bioconda::repeatmodeler=2.0.5 conda-forge::perl-text-soundex conda-forge::libgcc-ng conda-forge::zstd'
}
withName: 'maskIndels' {
conda = 'conda-forge::ruby=3.2.2'
}
withName: simplifyBed {
conda = 'bioconda::bedtools=2.31.0 conda-forge::libzlib=1.2.13'
}
withName: 'filterChr|splitTrios' {
conda = 'bioconda::vcftools=0.1.16 conda-forge::gzip conda-forge::gawk bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13'
}
withName: 'phaseTrio' {
conda = 'bioconda::whatshap=2.1 conda-forge::libgcc-ng=13.2.0 conda-forge::gzip'
}
withName: pullDPGQ {
conda = 'bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13'
}
withName: plotDPGQ {
conda = 'conda-forge::r-tidyverse=1.3.1 conda-forge::r-data.table=1.14.2'
}
withName: splitVCFs {
conda = 'conda-forge::ruby=3.2.2 bioconda::htslib=1.18 conda-forge::libzlib=1.2.13'
}
withName: vcftoolsFilterSites {
conda = 'bioconda::vcftools=0.1.16 bioconda::htslib=1.18 bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13'
}
withName: gatkFilterSites {
if ( params.gatk_build == 3 ) {
conda = 'bioconda::gatk=3.8 bioconda::htslib=1.18 bioconda::vcftools=0.1.16 bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13'
} else if ( params.gatk_build == 4 ) {
conda = 'bioconda::gatk4=4.4.0.0 conda-forge::openjdk=17.0.9 bioconda::htslib=1.18 bioconda::vcftools=0.1.16 bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13'
}
}
withName: filterRegions {
conda = 'bioconda::bedtools=2.31.0 bioconda::vcftools=0.1.16 conda-forge::gzip bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13'
}
withName: summarizeDNM {
conda = 'conda-forge::ruby=3.2.2 conda-forge::gzip bioconda::bcftools=1.18 conda-forge::gsl=2.7 conda-forge::libzlib=1.2.13 conda-forge::r-hmisc=5.1_1'
}
withName: 'generateSummaryStats|calcDNMRate' {
conda = 'conda-forge::ruby=3.2.2 bioconda::vcftools=0.1.16 conda-forge::gzip conda-forge::r-hmisc=5.1_1'
}
withName: sanityCheckLogs {
conda = 'conda-forge::gzip bioconda::bcftools=1.18 conda-forge::libzlib=1.2.13'
}
}
}
}