Skip to content

Commit b068220

Browse files
bentshermanfamosab
andauthored
Fix strict syntax errors (#2159)
Fixing strict syntax errors so that I can test with Nextflow 26.04 The main change is removing if statements from config. You should be able to just remove them without generating tons of false warnings, since the strict syntax can validate process selectors against conditional processes as well. I was able to run the `test` profile with these changes on 26.03.0-edge --------- Co-authored-by: Famke Bäuerle <45968370+famosab@users.noreply.github.com> Co-authored-by: Famke Bäuerle <famke.baeuerle@gmail.com>
1 parent 38515df commit b068220

43 files changed

Lines changed: 99 additions & 205 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5050
- [#2087](https://github.com/nf-core/sarek/pull/2087) - Move parabricks config into its own, adhere to strict syntax, swap to topics
5151
- [#2139](https://github.com/nf-core/sarek/pull/2139) - Back to dev (3.9.0dev)
5252
- [#2141](https://github.com/nf-core/sarek/pull/2141) - Update vcf_annotate_snpeff subworkflow, swap tabix/bgziptabix and snpeff to topics, strict syntax
53+
- [#2159](https://github.com/nf-core/sarek/pull/2159) - Fix strict syntax errors
5354

5455
#### Fixed
5556

conf/modules/aligner.config

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
process {
1717

18-
if (params.step == 'mapping') {
1918
withName: 'BWAMEM1_MEM' {
2019
ext.when = { params.aligner == 'bwa-mem' }
2120
}
@@ -73,8 +72,6 @@ process {
7372
ext.prefix = { params.split_fastq > 1 ? bam.name.replaceFirst(/\.bam$/, '_umi_extracted') : "${meta.id}_umi_extracted" }
7473
}
7574

76-
}
77-
7875
withName: 'MERGE_BAM|INDEX_MERGE_BAM' {
7976
publishDir = [
8077
mode: params.publish_dir_mode,

conf/modules/annotate.config

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
process {
1717

1818
// SNPEFF
19-
if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) {
2019
withName: 'SNPEFF_SNPEFF' {
2120
ext.args = { '-nodownload -canon -v' }
2221
ext.prefix = { meta.variantcaller == 'consensus' ? "${meta.id}.consensus_snpEff" : vcf.baseName - '.vcf' + '_snpEff' }
@@ -29,10 +28,8 @@ process {
2928
]
3029
]
3130
}
32-
}
3331

3432
// VEP
35-
if (params.tools && (params.tools.split(',').contains('vep') || params.tools.split(',').contains('merge'))) {
3633
withName: 'ENSEMBLVEP_VEP' {
3734
ext.args = { ["--stats_file ",
3835
meta.variantcaller == 'consensus' ? "${meta.id}.consensus_VEP.ann.summary.html" : vcf.baseName - '.vcf' + '_VEP.ann.summary.html',
@@ -62,10 +59,8 @@ process {
6259
]
6360
]
6461
}
65-
}
6662

6763
// BCFTOOLS ANNOTATE
68-
if (params.tools && params.tools.split(',').contains('bcfann')) {
6964
withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:BCFTOOLS_ANNOTATE' {
7065
ext.args = { '--output-type z --write-index=tbi' }
7166
ext.prefix = { meta.variantcaller == 'consensus' ? "${meta.id}.consensus_BCF.ann" : input.baseName - '.vcf' + '_BCF.ann' }
@@ -75,7 +70,6 @@ process {
7570
pattern: "*{gz,gz.tbi}"
7671
]
7772
}
78-
}
7973

8074
// SNPSIFT ANNOTATE
8175
withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:SNPSIFT_ANNMEM' {
@@ -96,7 +90,6 @@ process {
9690
}
9791

9892
// SNPEFF THEN VEP
99-
if (params.tools && params.tools.split(',').contains('merge')) {
10093
withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_MERGE' {
10194
ext.args = { [
10295
"--stats_file ${meta.variantcaller == 'consensus' ? "${meta.id}.consensus_snpEff_VEP.ann" : vcf.baseName - '.ann.vcf' + '_VEP.ann'}.summary.html",
@@ -114,10 +107,8 @@ process {
114107
// If merge: Output file will have format *_snpEff_VEP.ann.vcf, *_snpEff_VEP.ann.json or *_snpEff_VEP.ann.tab
115108
ext.prefix = { meta.variantcaller == 'consensus' ? "${meta.id}.consensus_snpEff_VEP.ann" : vcf.baseName - '.ann.vcf' + '_VEP.ann' }
116109
}
117-
}
118110

119111
// ALL ANNOTATION TOOLS
120-
if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge') || params.tools.split(',').contains('bcfann'))) {
121112
withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:.*:(TABIX_BGZIPTABIX|TABIX_TABIX)' {
122113
ext.prefix = { input.name - '.vcf' }
123114
publishDir = [
@@ -126,9 +117,7 @@ process {
126117
pattern: "*{gz.tbi}"
127118
]
128119
}
129-
}
130120

131-
if (params.tools && (params.tools.split(',').contains('snpeff') || params.tools.split(',').contains('merge'))) {
132121
withName: 'NFCORE_SAREK:SAREK:VCF_ANNOTATE_ALL:VCF_ANNOTATE_SNPEFF:TABIX_BGZIPTABIX' {
133122
publishDir = [
134123
mode: params.publish_dir_mode,
@@ -137,5 +126,4 @@ process {
137126
saveAs: { params.tools.split(',').contains('snpeff') ? it : null }
138127
]
139128
}
140-
}
141129
}

conf/modules/freebayes.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ process {
7171
}
7272

7373
// PAIR_VARIANT_CALLING
74-
if (params.tools && params.tools.split(',').contains('freebayes')) {
7574
withName: '.*:BAM_VARIANT_CALLING_SOMATIC_ALL:BAM_VARIANT_CALLING_FREEBAYES:FREEBAYES' {
7675
ext.args = { "--pooled-continuous \
7776
--pooled-discrete \
@@ -82,5 +81,4 @@ process {
8281
--min-repeat-entropy 1 \
8382
--min-alternate-count 2 " }
8483
}
85-
}
8684
}

conf/modules/haplotypecaller.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ process {
5656
]
5757
}
5858

59-
if (params.tools && params.tools.split(',').contains('haplotypecaller')) {
6059
withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_VARIANT_CALLING_HAPLOTYPECALLER:BAM_MERGE_INDEX_SAMTOOLS:(MERGE_BAM|INDEX_MERGE_BAM)' {
6160
ext.prefix = { "${meta.id}.realigned" }
6261
publishDir = [
@@ -66,5 +65,4 @@ process {
6665
pattern: "*{bam,bai}"
6766
]
6867
}
69-
}
7068
}

conf/modules/joint_germline.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,12 @@ process {
3232
]
3333
}
3434

35-
if (params.tools && params.tools.contains('haplotypecaller') && params.joint_germline) {
3635
withName: 'NFCORE_SAREK:SAREK:BAM_VARIANT_CALLING_GERMLINE_ALL:BAM_JOINT_CALLING_GERMLINE_GATK:BCFTOOLS_SORT' {
3736
ext.prefix = { vcf.baseName - ".vcf" + ".sort" }
3837
publishDir = [
3938
enabled: false
4039
]
4140
}
42-
}
4341

4442
withName: 'MERGE_GENOTYPEGVCFS' {
4543
ext.prefix = { 'joint_germline' }

conf/modules/lofreq.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
//LOFREQ
1515

1616
process {
17-
if (params.tools && params.tools.split(',').contains('lofreq')) {
1817

1918
withName: "LOFREQ_CALLPARALLEL" {
2019
ext.args = { "--call-indels" }
@@ -40,6 +39,5 @@ process {
4039
pattern: "*{vcf.gz,vcf.gz.tbi}"
4140
]
4241
}
43-
}
4442

4543
}

conf/modules/manta.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
// MANTA
1515

1616
process {
17-
if (params.tools && params.tools.split(',').contains('manta')) {
1817
withName: 'MANTA_GERMLINE|MANTA_TUMORONLY|MANTA_SOMATIC' {
1918
ext.args = { params.wes ? "--exome" : '' }
2019
ext.prefix = { "${meta.id}.manta" }
@@ -24,5 +23,4 @@ process {
2423
pattern: "*{diploid_sv,tumor_sv,somatic_sv}.{vcf.gz,vcf.gz.tbi}"
2524
]
2625
}
27-
}
2826
}

conf/modules/markduplicates.config

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,21 @@ process {
119119

120120
withName: 'NFCORE_SAREK:SAREK:FASTQ_PREPROCESS_GATK:CRAM_TO_BAM' {
121121
ext.when = { params.save_output_as_bam }
122-
if (params.tools && params.tools.split(',').contains('sentieon_dedup')) {
123-
ext.prefix = { "${meta.id}.dedup" }
124-
publishDir = [
122+
ext.prefix = { (params.tools && params.tools.split(',').contains('sentieon_dedup'))
123+
? "${meta.id}.dedup"
124+
: "${meta.id}.md" }
125+
publishDir = (params.tools && params.tools.split(',').contains('sentieon_dedup'))
126+
? [
125127
mode: params.publish_dir_mode,
126128
path: { "${params.outdir}/preprocessing/sentieon_dedup/${meta.id}/" },
127129
pattern: "*{dedup.bam,dedup.bam.bai}",
128130
saveAs: { params.save_output_as_bam ? it : null }
129131
]
130-
} else {
131-
ext.prefix = { "${meta.id}.md" }
132-
publishDir = [
132+
: [
133133
mode: params.publish_dir_mode,
134134
path: { "${params.outdir}/preprocessing/markduplicates/${meta.id}/" },
135135
pattern: "*{md.bam,md.bam.bai}",
136136
saveAs: { params.save_output_as_bam ? it : null }
137137
]
138-
}
139138
}
140139
}

conf/modules/modules.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ process {
7474
]
7575
}
7676

77-
if (!(params.skip_tools && params.skip_tools.split(',').contains('baserecalibrator'))) {
7877
withName: 'NFCORE_SAREK:SAREK:CRAM_SAMPLEQC:CRAM_QC_RECAL:MOSDEPTH' {
7978
ext.prefix = { "${meta.id}.recal" }
8079
}
@@ -88,7 +87,6 @@ process {
8887
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
8988
]
9089
}
91-
}
9290

9391
// VCF
9492
withName: 'BCFTOOLS_STATS' {

0 commit comments

Comments
 (0)