@@ -19,12 +19,12 @@ process {
1919 ]
2020
2121 withName: DOWNLOAD_REFERENCE {
22- storeDir = params.ref_taxonomy_storage ?: false
22+ storeDir = { params.ref_taxonomy_storage ?: false }
2323 }
2424
2525 withName: RENAME_RAW_DATA_FILES {
2626 // copy in case cutadapt is skipped, because the next step (DADA2's filterAndTrim) follows soft links and ignores renamed file names
27- ext.args = params.skip_cutadapt ? 'cp' : 'ln -s'
27+ ext.args = { params.skip_cutadapt ? 'cp' : 'ln -s' }
2828 publishDir = [
2929 path: { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" },
3030 mode: params.publish_dir_mode,
@@ -171,7 +171,7 @@ process {
171171 }
172172
173173 withName: TRUNCLEN {
174- ext.args = "${params.trunc_qmin} ${params.trunc_rmin}"
174+ ext.args = { "${params.trunc_qmin} ${params.trunc_rmin}" }
175175 publishDir = [
176176 path: { "${params.outdir}/dada2" },
177177 mode: params.publish_dir_mode,
@@ -180,7 +180,7 @@ process {
180180 }
181181
182182 withName: DADA2_FILTNTRIM {
183- ext.args = [
183+ ext.args = { [
184184 'maxN = 0, trimRight = 0, minQ = 0, rm.lowcomplex = 0, orient.fwd = NULL, matchIDs = FALSE, id.sep = "\\\\s", id.field = NULL, n = 1e+05, OMP = TRUE',
185185 "qualityType = \"${params.quality_type}\"",
186186 "truncQ = ${params.truncq}",
@@ -189,7 +189,7 @@ process {
189189 params.sequencing_type == "iontorrent" ? "trimLeft = 15" : "trimLeft = 0",
190190 ["pacbio","iontorrent","illumina_se"].contains(params.sequencing_type) ? "maxEE = ${params.max_ee}" : "maxEE = c(${params.max_ee}, ${params.max_ee})",
191191 params.sequencing_type == "pacbio" ? "rm.phix = FALSE" : "rm.phix = TRUE"
192- ].join(',').replaceAll('(,)*$', "")
192+ ].join(',').replaceAll('(,)*$', "") }
193193 publishDir = [
194194 path: { "${params.outdir}/dada2/args" },
195195 mode: params.publish_dir_mode,
@@ -220,16 +220,16 @@ process {
220220 }
221221
222222 withName: DADA2_ERR {
223- ext.seed = "${params.seed}"
223+ ext.seed = { "${params.seed}" }
224224 ext.prefix = { meta.region ? "region-${meta.region}_run-${meta.run}" : "${meta.run}" }
225225 ext.cmd_errfun = { params.binned_quality ? "binnedQualErrfun <- makeBinnedQualErrfun(c(${params.binned_quality}))" : "" }
226- ext.args = [
226+ ext.args = { [
227227 'nbases = 1e8, nreads = NULL, randomize = TRUE, MAX_CONSIST = 10, OMEGA_C = 0',
228228 "qualityType = \"${params.quality_type}\"",
229229 params.binned_quality ? "errorEstimationFunction = binnedQualErrfun" :
230230 params.sequencing_type == "pacbio" ? "errorEstimationFunction = PacBioErrfun" :
231231 "errorEstimationFunction = loessErrfun"
232- ].join(',').replaceAll('(,)*$', "")
232+ ].join(',').replaceAll('(,)*$', "") }
233233 publishDir = [
234234 [
235235 path: { "${params.outdir}/dada2/QC" },
@@ -256,22 +256,22 @@ process {
256256
257257 withName: DADA2_DENOISING {
258258 ext.prefix = { meta.region ? "region-${meta.region}_run-${meta.run}" : "${meta.run}" }
259- ext.quality_type = "${params.quality_type}"
259+ ext.quality_type = { "${params.quality_type}" }
260260 // standard setting can be inspected with getDadaOpt(option = NULL)
261- ext.args = [
261+ ext.args = { [
262262 'selfConsist = FALSE, priors = character(0), DETECT_SINGLETONS = FALSE, GAPLESS = TRUE, GAP_PENALTY = -8, GREEDY = TRUE, KDIST_CUTOFF = 0.42, MATCH = 5, MAX_CLUST = 0, MAX_CONSIST = 10, MIN_ABUNDANCE = 1, MIN_FOLD = 1, MIN_HAMMING = 1, MISMATCH = -4, OMEGA_A = 1e-40, OMEGA_C = 1e-40, OMEGA_P = 1e-4, PSEUDO_ABUNDANCE = Inf, PSEUDO_PREVALENCE = 2, SSE = 2, USE_KMERS = TRUE, USE_QUALS = TRUE, VECTORIZED_ALIGNMENT = TRUE',
263263 params.sequencing_type == "iontorrent" ? "BAND_SIZE = 32, HOMOPOLYMER_GAP_PENALTY = -1" : "BAND_SIZE = 16, HOMOPOLYMER_GAP_PENALTY = NULL",
264264 params.sample_inference == "pseudo" ? "pool = \"pseudo\"" :
265265 params.sample_inference == "pooled" ? "pool = TRUE" : "pool = FALSE"
266- ].join(',').replaceAll('(,)*$', "")
266+ ].join(',').replaceAll('(,)*$', "") }
267267 // setting from https://rdrr.io/bioc/dada2/man/mergePairs.html & https://rdrr.io/bioc/dada2/man/nwalign.html & match = getDadaOpt("MATCH"), mismatch = getDadaOpt("MISMATCH"), gap = getDadaOpt("GAP_PENALTY"), missing from the list below is: 'band = -1'
268- ext.args2 = [
268+ ext.args2 = { [
269269 "homo_gap = NULL, endsfree = TRUE, vec = FALSE, propagateCol = character(0), trimOverhang = FALSE, returnRejects = TRUE",
270270 params.mergepairs_strategy == "consensus" ?
271271 "match = ${params.mergepairs_consensus_match}, mismatch = ${params.mergepairs_consensus_mismatch}, minOverlap = ${params.mergepairs_consensus_minoverlap}, maxMismatch = ${params.mergepairs_consensus_maxmismatch}, gap = ${params.mergepairs_consensus_gap}" :
272272 "justConcatenate = ${params.mergepairs_strategy == 'concatenate' ? 'TRUE' : 'FALSE'}, match = 1, mismatch = -64, gap = -64, minOverlap = 12, maxMismatch = 0"
273- ].join(',').replaceAll('(,)*$', "")
274- ext.quantile = "${params.mergepairs_consensus_percentile_cutoff}"
273+ ].join(',').replaceAll('(,)*$', "") }
274+ ext.quantile = { "${params.mergepairs_consensus_percentile_cutoff}" }
275275 publishDir = [
276276 [
277277 path: { "${params.outdir}/dada2/args" },
@@ -460,7 +460,7 @@ process {
460460 }
461461
462462 withName: DECONTAM {
463- ext.seed = "${params.seed}"
463+ ext.seed = { "${params.seed}" }
464464 ext.args = "detailed=TRUE, normalize=TRUE"
465465 publishDir = [
466466 path: { "${params.outdir}/decontam" },
@@ -506,10 +506,10 @@ process {
506506 }
507507
508508 withName: FILTER_CODONS {
509- ext.args = [params.orf_start ? "-s ${params.orf_start}" : '',
509+ ext.args = { [params.orf_start ? "-s ${params.orf_start}" : '',
510510 params.orf_end ? "-e ${params.orf_end}" : '',
511511 params.stop_codons ? "-x ${params.stop_codons}" : ''
512- ].join(' ')
512+ ].join(' ') }
513513 publishDir = [
514514 path: { "${params.outdir}/codon_filter" },
515515 mode: params.publish_dir_mode,
@@ -526,12 +526,12 @@ process {
526526 }
527527
528528 withName: ITSX_CUTASV {
529- ext.args = [
529+ ext.args = { [
530530 '-t all --preserve T --date F --positions F --graphical F',
531531 params.cut_its == "its1" ? "--save_regions ITS1" :
532532 params.cut_its == "its2" ? "--save_regions ITS2" : "--save_regions none",
533533 params.its_partial != 0 ? "--partial ${params.its_partial}" : ""
534- ].join(' ').trim()
534+ ].join(' ').trim() }
535535 publishDir = [
536536 path: { "${params.outdir}/itsx" },
537537 mode: params.publish_dir_mode,
@@ -540,10 +540,10 @@ process {
540540 }
541541
542542 withName: ITSXRUST_CUTASV {
543- ext.args = [
543+ ext.args = { [
544544 params.sequencing_type == "pacbio" ? '--preset hifi' :
545545 params.sequencing_type == "nanopore" ? '--preset ont' : ''
546- ].join(' ').trim()
546+ ].join(' ').trim() }
547547 publishDir = [
548548 path: { "${params.outdir}/itsx" },
549549 mode: params.publish_dir_mode,
@@ -569,11 +569,11 @@ process {
569569 }
570570
571571 withName: DADA2_TAXONOMY {
572- ext.seed = "${params.seed}"
573- ext.args = [
572+ ext.seed = { "${params.seed}" }
573+ ext.args = { [
574574 "minBoot = ${params.dada_min_boot}",
575575 params.dada_taxonomy_rc ? "tryRC = TRUE" : "tryRC = FALSE"
576- ].join(',').replaceAll('(,)*$', "")
576+ ].join(',').replaceAll('(,)*$', "") }
577577 publishDir = [
578578 [
579579 path: { "${params.outdir}/dada2/args" },
@@ -589,12 +589,12 @@ process {
589589 }
590590
591591 withName: DADA2_ADDSPECIES {
592- ext.seed = "${params.seed}"
593- ext.args = [
592+ ext.seed = { "${params.seed}" }
593+ ext.args = { [
594594 'n = 1e5',
595595 params.dada_addspecies_allowmultiple ? "allowMultiple = TRUE" : "",
596596 params.dada_taxonomy_rc ? "tryRC = TRUE" : "tryRC = FALSE"
597- ].join(',').replaceAll('(,)*$', "")
597+ ].join(',').replaceAll('(,)*$', "") }
598598 publishDir = [
599599 [
600600 path: { "${params.outdir}/dada2/args" },
@@ -618,7 +618,7 @@ process {
618618 }
619619
620620 withName: VSEARCH_SINTAX {
621- ext.args = "--gzip_decompress --sintax_cutoff 0.8 --randseed ${params.seed}"
621+ ext.args = { "--gzip_decompress --sintax_cutoff 0.8 --randseed ${params.seed}" }
622622 cpus = 1
623623 publishDir = [
624624 [
@@ -639,7 +639,7 @@ process {
639639
640640 withName: KRAKEN2_KRAKEN2 {
641641 // "--use-names" is required for downstream processes!
642- ext.args = "--use-names --confidence ${params.kraken2_confidence}"
642+ ext.args = { "--use-names --confidence ${params.kraken2_confidence}" }
643643 publishDir = [
644644 path: { "${params.outdir}/kraken2" },
645645 mode: params.publish_dir_mode,
@@ -667,7 +667,7 @@ process {
667667 }
668668
669669 withName: VSEARCH_USEARCHGLOBAL_LCA {
670- ext.args = "--gzip_decompress --top_hits_only --output_no_hits --maxaccepts ${params.vsearch_lca_maxaccepts} --maxrejects ${params.vsearch_lca_maxrejects} --lca_cutoff ${params.vsearch_lca_lca_cutoff} --query_cov ${params.vsearch_lca_query_cov} --n_mismatch --notrunclabels"
670+ ext.args = { "--gzip_decompress --top_hits_only --output_no_hits --maxaccepts ${params.vsearch_lca_maxaccepts} --maxrejects ${params.vsearch_lca_maxrejects} --lca_cutoff ${params.vsearch_lca_lca_cutoff} --query_cov ${params.vsearch_lca_query_cov} --n_mismatch --notrunclabels" }
671671 publishDir = [
672672 [
673673 path: { "${params.outdir}/vsearch_lca" },
@@ -698,7 +698,7 @@ process {
698698 }
699699
700700 withName: VSEARCH_CLUSTER {
701- ext.args = "--id ${params.vsearch_cluster_id} --usersort --qmask 'none'"
701+ ext.args = { "--id ${params.vsearch_cluster_id} --usersort --qmask 'none'" }
702702 ext.args2 = '--cluster_smallmem'
703703 ext.args3 = '--clusters'
704704 }
@@ -1220,11 +1220,11 @@ process {
12201220 }
12211221
12221222 withName: SBDIEXPORT {
1223- ext.args = [
1223+ ext.args = { [
12241224 params.sequencing_type == "illumina_se" ? 'single' : 'paired',
12251225 "${params.fw_primer}",
12261226 "${params.rv_primer}"
1227- ].join(' ').trim()
1227+ ].join(' ').trim() }
12281228 publishDir = [
12291229 path: { "${params.outdir}/SBDI" },
12301230 mode: params.publish_dir_mode,
0 commit comments