Skip to content

Apply Nextflow 25 strict syntax fixes#1677

Merged
pinin4fjords merged 7 commits into
devfrom
strict-syntax-fixes
Jan 21, 2026
Merged

Apply Nextflow 25 strict syntax fixes#1677
pinin4fjords merged 7 commits into
devfrom
strict-syntax-fixes

Conversation

@pinin4fjords
Copy link
Copy Markdown
Member

@pinin4fjords pinin4fjords commented Jan 19, 2026

Summary

Apply Nextflow 25 strict syntax fixes and update nf-core components for compliance.

Commits

  1. refactor: Apply strict syntax to local files (ba7caae) - Channelchannel, explicit closure params, def declarations, move file declarations inside main:, remove top-level config conditionals

  2. chore: Update nf-core modules/subworkflows (e192000) - Updates for strict syntax compliance

  3. fix: BBMAP versions + Sentieon config (6da25a0) - Remove invalid version reference, create standalone sentieon.config files

  4. test: Update snapshots (e806fa9)

  5. ci: Add strict syntax lint workflow (01d18d3)

  6. docs: Fix RSEM output docs (f79417a) - Fix star_rsem/log/ nesting, correct log file patterns

  7. docs: Update CHANGELOG (24d1d32)

Side effects explained

Changes arose from: (1) removing conditional config wrappers for strict syntax, (2) updating modules to strict-syntax-compliant versions.

RSEM BAM input (bam_input.nf.test.snap)

  • rsem/star_rsem/, *.transcript.bam no longer published
  • Why: Removing if (!params.skip_alignment && ...) wrapper now applies config consistently
  • Deliberate fix: Outputs now match docs/output.md; input BAMs no longer redundantly re-published

fastp naming ⚠️ BREAKING

  • *_1.fastp.fastq.gz*_R1.fastp.fastq.gz (same for _2/_R2)
  • Why: Upstream module change in strict-syntax-compliant version

RSeQC TIN naming

  • test.paired_end.sorted.summary.txttest.summary.txt
  • Why: Module now uses ext.prefix for cleaner naming

Module snapshot changes (topic-based versions)

  • Large changes in module test snapshots (e.g., sentieon/staralign +230 lines)
  • Why: Modules now emit version tuples instead of versions.yml files, changing snapshot structure significantly

Version reporting fix

  • python: nullpython: "3.12.2" in pipeline snapshots
  • Why: Topic-based reporting now correctly captures previously-missed versions

References

PR checklist

  • Description with reasons
  • CHANGELOG.md updated
  • docs/output.md updated

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 19, 2026

nf-core pipelines lint overall result: Passed ✅ ⚠️

Posted for pipeline commit f79417a

+| ✅ 201 tests passed       |+
#| ❔   9 tests were ignored |#
#| ❔   1 tests had warnings |#
!| ❗   9 tests had warnings |!
Details

❗ Test warnings:

  • files_exist - File not found: assets/multiqc_config.yml
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in awsfulltest.yml: You can customise AWS full pipeline tests as required
  • pipeline_todos - TODO string in methods_description_template.yml: #Update the HTML below to your preferred methods description, e.g. add publication citation for this pipeline
  • pipeline_todos - TODO string in main.nf: Optionally add in-text citation tools to this list.
  • pipeline_todos - TODO string in main.nf: Optionally add bibliographic entries to this list.
  • pipeline_todos - TODO string in main.nf: Only uncomment below if logic in toolCitationText/toolBibliographyText has been filled!
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_if_empty_null - ifEmpty(null) found in /home/runner/work/rnaseq/rnaseq/subworkflows/local/prepare_genome/main.nf: _ versions = ch_versions.ifEmpty(null) // channel: [ versions.yml ]
    _

❔ Tests ignored:

❔ Tests fixed:

✅ Tests passed:

Run details

  • nf-core/tools version 3.5.1
  • Run at 2026-01-21 14:27:09

@pinin4fjords pinin4fjords changed the title Apply Nextflow 25 strict syntax fixes to local files Apply Nextflow 25 strict syntax fixes Jan 20, 2026
pinin4fjords and others added 6 commits January 21, 2026 13:47
Changes to comply with Nextflow strict syntax requirements:

Local workflow files (main.nf, subworkflows/local/*, modules/local/*):
- Convert `Channel` to `channel` (lowercase) throughout
- Replace implicit closure parameter `it` with explicit names
- Add `def` keyword to implicit variable declarations
- Prefix unused parameters with underscore (_key, _idx, etc.)
- Rename variables that shadow input parameters
- Move file declarations inside workflow main: blocks
- Replace `for` loops with `.each()` functional iteration

Config files:
- Remove top-level `if (!params.skip_*)` wrappers (strict syntax prohibits
  top-level conditionals in config files)
- Replace implicit closure parameter `it` with explicit `filename`
- Convert conditional env assignments to ternary operators

See: https://nextflow.io/docs/latest/strict-syntax.html

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update nf-core components to ensure Nextflow 25 strict syntax compliance.

Module changes:
- Convert Channel.empty() to channel.empty()
- Replace implicit `it` with explicit parameter names
- Add `def` to implicit variable declarations
- Prefix unused variables with underscore
- Many modules switch to topic-based version reporting

Modules updated:
- bbmap/bbsplit, bracken/bracken, cat/fastq, custom/catadditionalfasta
- fastp, gffread, gunzip, hisat2/extractsplicesites, kraken2/kraken2
- rsem/preparereference, rseqc/readdistribution, rseqc/tin
- salmon/quant, sentieon/*, sortmerna, sylph/profile
- trimgalore, ucsc/bedclip, ucsc/bedgraphtobigwig

Subworkflows updated:
- bam_dedup_*, bam_markduplicates_picard, bam_sort_stats_samtools
- bam_stats_samtools, bedgraph_bedclip_bedgraphtobigwig
- fastq_align_hisat2, fastq_fastqc_umitools_*, fastq_qc_trim_filter_*
- fastq_remove_rrna, fastq_subsample_fq_salmon, quantify_pseudo_alignment

Notable changes from upstream master:
- bbmap/bbsplit: topic-based version reporting
- fastp: output naming changed from _1/_2 to _R1/_R2 suffix
- rseqc/tin: now uses ext.prefix for output naming
- sentieon configs: env block syntax for environment variables

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BBMAP_BBSPLIT changes:
- Remove invalid BBMAP_BBSPLIT.out.versions reference (now uses topic
  channel for versions, collected automatically at workflow level)

Sentieon test configuration:
- Use null instead of empty string for optional Sentieon env vars to
  prevent Nextflow warnings about empty environment variable values
- Use env block syntax for Sentieon env vars (aligns with nf-core module
  convention and handles null values from System.getenv() properly)
- Create standalone sentieon.config files for each Sentieon test directory
  with all required settings (process config + env vars) since nf-test
  doesn't support multiple config files
- Remove Sentieon env vars from general test configs to prevent empty
  env var warnings in non-Sentieon tests

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update nf-test snapshots to reflect changes from strict syntax updates:

- Topic-based version reporting changes output structure
  (versions now reported via topic channel rather than versions.yml)
- Python version now correctly reported in CUSTOM_CATADDITIONALFASTA stub
- RSEM outputs directory changed to ${params.aligner} for consistency
- New RSEM merged output files (merged_genes_long, merged_isoforms_long)
- CUSTOM_CATADDITIONALFASTA now outputs GTF file
- fastp output naming changed from _1/_2 to _R1/_R2 suffix
- rseqc/tin uses ext.prefix for output naming

Module and subworkflow test snapshots updated for all components
modified in previous commits.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `nextflow lint` to CI to prevent regressions in strict syntax compliance.

Changes:
- Create separate nextflow-lint.yml workflow for strict syntax validation
- Update nf-test.config to use strict syntax (add `=` for assignments)
  so it no longer needs to be excluded from linting
- Disable nf_test_content lint check in .nf-core.yml for strict syntax
  compatibility (nf-core linting conflicts with some strict syntax patterns)

The lint workflow runs on all Nextflow files in the repository.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@maxulysse maxulysse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just concerned about tests/bam_input.nf.test.snap

- Fix incorrect nesting of star_rsem/log/ under star_rsem/<SAMPLE>.stat/
- Update log file patterns to match actual STAR output files:
  - *.SJ.out.tab (splice junctions)
  - *.Log.final.out (alignment summary)
  - *.Log.out and *.Log.progress.out (detailed logs)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pinin4fjords
Copy link
Copy Markdown
Member Author

just concerned about tests/bam_input.nf.test.snap

Thanks @maxulysse ! This is because I fixed something (updated the PR description).

The bam_input.nf.test.snap changes are from removing the conditional wrapper around the RSEM publishDir config:

Before: if (!params.skip_alignment && ...) meant the config was skipped when skip_alignment=true (BAM input mode). Outputs went to undocumented rsem/ directory.

After: Config always applies. Outputs go to star_rsem/ which matches docs/output.md.

Changes:

  • rsem/*.resultsstar_rsem/*.results
  • *.transcript.bam no longer published (config only publishes *.{stat,results})

This is a bug fix - the old behavior was incorrect.

@pinin4fjords pinin4fjords merged commit 5bc823a into dev Jan 21, 2026
65 checks passed
@pinin4fjords pinin4fjords deleted the strict-syntax-fixes branch January 21, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants