Skip to content

test: add nf-test for RustQC bigWig coverage tracks - #28

Open
ewels wants to merge 5 commits into
mainfrom
cursor/bigwig-nf-test-09a4
Open

ewels wants to merge 5 commits into
mainfrom
cursor/bigwig-nf-test-09a4

Conversation

@ewels

@ewels ewels commented Jun 16, 2026 •

Copy link
Copy Markdown
Member

Merge after the RustQC release that contains RustQC #114 is published and ghcr.io/seqeralabs/rustqc:dev is rebuilt. Until then the two bigWig tests fail on the default image (by design, see below).

Summary

Adds tests/rna/rustqc/bigwig.nf.test, which checks the bigWig coverage tracks that rustqc rna writes since RustQC #114. For a stranded library RustQC writes the three files that nf-core/rnaseq makes with bedtools genomecov → bedClip → bedGraphToBigWig:

  • bigwig/{sample}.bigWig: -split -bg
  • bigwig/{sample}.forward.bigWig / .reverse.bigWig: -split -du -strand ± (the strands swap for a reverse-stranded library)

bigWig bytes differ between writers, so the tests decode each track to bedGraph with bigWigToBedGraph (host binary if on PATH, else quay.io/biocontainers/ucsc-bigwigtobedgraph via docker run) and compare the intervals. The decode runs in the nf-test then block, not in a Nextflow process.

  • Regression (tag: regression)
    • Snapshot of line count and MD5 of the decoded bedGraph per track.
  • Crosscheck (tag: crosscheck)
    • Exact comparison of the decoded intervals with the committed bedtools genomecov v2.31.1 + UCSC bedClip references in snapshots/rna/small/bigwig/.

Changes

  • tests/rna/rustqc/bigwig.nf.test and .snap
    • Tags rustqc, rna, bigwig, small; the test input is small/test.bam as a paired, reverse-stranded library.
    • Loads rustqc_extra_args.config, so RUSTQC_IMAGE selects the RustQC image, as for split_bam and featurecounts_mo.
    • Fails with "does the RustQC image include bigWig support? (requires RustQC #114)" if the files are missing.
  • tests/lib/checks/CompareUtils.groovy
    • bedGraphFromBigWig, bedGraphMatch, md5BedGraphLines. They moved here from tests/lib/CompareUtils.groovy, which is now an alias on main.
    • The decoder writes to stdout, so the Docker fallback mounts only the bigWig's directory (read-only).
  • snapshots/rna/small/bigwig/test.{combined,forward,reverse}.bedGraph, test-data/rna/small/chr6.chrom.sizes
    • bedtools v2.31.1 + bedClip references (nf-core/rnaseq parameters), unchanged from the first commit.
  • modules/local/rustqc_rna.nf
    • Stub creates the three bigwig/ files. The script needs no change: it already passes --paired and --stranded forward|reverse|unstranded, and bigWig output is on by default in #114.
  • tests/rna/rustqc/rustqc_extra_args.config, tests/README.md, CHANGELOG.md
    • Docs for the bigWig tests, the RUSTQC_IMAGE override and the new helpers.

Testing status

Both tests pass against an image built from RustQC #114 at 0462f37 (repo Dockerfile, linux/arm64, nf-test 0.9.5, Nextflow 26.11.0-edge):

RUSTQC_IMAGE=docker.io/library/rustqc:pr114-0462f37 nf-test test tests/rna/rustqc/bigwig.nf.test

  Test [7ef90cee] 'bigwig - regression' PASSED (34.02s)
  Test [260ea441] 'bigwig - crosscheck vs bedtools' PASSED (32.748s)

SUCCESS: Executed 2 tests in 66.786s

The decoded tracks are byte-identical to the references:

Track Lines MD5 (decoded = reference)
combined 54615 ad5370cc6ef150d20cff064879f6881b
forward 24961 20d27ec2a436abedf7f157b251eb945a
reverse 29656 fd64f43bdd33a977c07f8e18a920713b

The regression snapshot was made in that run with --update-snapshot, as tests/README.md describes. Against the current ghcr.io/seqeralabs/rustqc:dev the tests fail with the "requires RustQC #114" message, because that image has no bigWig output yet.

For a local image, give the full name (docker.io/library/...), because nextflow.config sets docker.registry = 'quay.io'.

Follow-up after the release

  • tests/default.nf.test.snap
    • It lists the published files, so it will need --update-snapshot once :dev writes rustqc/bigwig/. That is not part of this PR, because the snapshot would fail on the current image.

🤖 Generated with Claude Code

ewels and others added 3 commits June 16, 2026 23:24
Add tests/rna/rustqc/bigwig.nf.test validating the nf-core/rnaseq-compatible
bigWig tracks from `rustqc rna` (RustQC #114): combined, forward and reverse.

Binary .bigWig files are not bit-identical to UCSC output, so the tests decode
each track to bedGraph intervals (host bigWigToBedGraph, Docker fallback) and:
- regression (tag: regression): snapshot line counts + MD5 of bedGraph content
- crosscheck (tag: crosscheck): compare decoded intervals exactly against
  committed bedtools genomecov + bedClip references

References under snapshots/rna/small/bigwig/ generated with bedtools v2.31.1 +
UCSC bedClip (nf-core/rnaseq params); MD5s and line counts verified, and the
full decode/compare path validated end-to-end via a bigWig round-trip.

Also: CompareUtils bigWig helpers (bedGraphFromBigWig, bedGraphMatch,
md5BedGraphLines), RUSTQC_RNA stub bigWig outputs, RUSTQC_IMAGE override in
tests/nextflow.config, README + CHANGELOG updates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Current ghcr.io/seqeralabs/rustqc:dev rejects the numeric --stranded 2/1/0
form with "invalid value '2' ... [possible values: unstranded, forward,
reverse]". Pass meta.strandedness ('unstranded'/'forward'/'reverse') straight
through to --stranded in both RUSTQC_RNA and RUSTQC_RNA_PROFILE.

Verified: bam_stat regression passes against rustqc:dev
(sha256:8dcaf3dc...) with the string form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-09a4

# Conflicts:
#	modules/local/rustqc_rna.nf
#	modules/local/rustqc_rna_profile.nf
ewels and others added 2 commits December 3, 2026 15:19
Resolve conflicts with main's test-library and README changes:
- CompareUtils.groovy is now an alias for checks.CompareUtils, so the
  bigWig helpers (bedGraphFromBigWig, bedGraphMatch, md5BedGraphLines)
  move to tests/lib/checks/CompareUtils.groovy.
- tests/nextflow.config takes main's version; the RUSTQC_IMAGE override
  now comes from tests/rna/rustqc/rustqc_extra_args.config.
- tests/README.md takes main's version, with the bigWig notes moved to
  their own section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Pass nf-test paths straight to bedGraphFromBigWig (they are already
  java.nio Paths; the .toPath() calls failed with MissingMethodException).
- Load rustqc_extra_args.config so RUSTQC_IMAGE selects the RustQC image,
  as split_bam and featurecounts_mo do.
- Add the regression snapshot, generated against an image built from
  RustQC #114 (0462f37); the crosscheck passed in the same run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ewels
ewels marked this pull request as ready for review December 3, 2026 14:20
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

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

Posted for pipeline commit 1cf398b

+| ✅ 157 tests passed       |+
#| ❔  51 tests were ignored |#
!| ❗  14 tests had warnings |!
Details

❗ Test warnings:

  • files_exist - File not found: ro-crate-metadata.json
  • nextflow_config - Config variable not found: manifest.diagram
  • files_unchanged - LICENSE does not match the template
  • readme - README did not have a Nextflow minimum version badge.
  • readme - README did not have an nf-core template version badge.
  • pipeline_todos - TODO string in nextflow.config: Update the field with the details of the contributors to your pipeline. New with Nextflow version 24.10.0
  • pipeline_todos - TODO string in base.config: Check the defaults for all processes
  • pipeline_todos - TODO string in base.config: Customise requirements for specific processes.
  • pipeline_todos - TODO string in nextflow.config: Specify any additional parameters here
  • pipeline_name_conventions - Naming does not adhere to nf-core conventions: Contains non alphanumeric characters
  • schema_lint - Parameter input not found in schema
  • system_exit - System.exit in FullsizeCompare.groovy: System.exit(run(id, new File(rustqc), new File(upstream), new File(report))) [line 27]
  • local_component_structure - rustqc_rna_profile.nf in modules/local should be moved to a TOOL/SUBTOOL/main.nf structure
  • local_component_structure - rustqc_rna.nf in modules/local should be moved to a TOOL/SUBTOOL/main.nf structure

❔ Tests ignored:

  • files_exist - File is ignored: conf/igenomes.config
  • files_exist - File is ignored: conf/igenomes_ignored.config
  • files_exist - File is ignored: assets/email_template.html
  • files_exist - File is ignored: assets/sendmail_template.txt
  • files_exist - File is ignored: assets/email_template.txt
  • files_exist - File is ignored: assets/multiqc_config.yml
  • files_exist - File is ignored: CITATIONS.md
  • files_exist - File is ignored: CODE_OF_CONDUCT.md
  • files_exist - File is ignored: assets/nf-core-rustqc-benchmarks_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-rustqc-benchmarks_logo_light.png
  • files_exist - File is ignored: docs/images/nf-core-rustqc-benchmarks_logo_dark.png
  • files_exist - File is ignored: .github/ISSUE_TEMPLATE/config.yml
  • files_exist - File is ignored: .github/workflows/awstest.yml
  • files_exist - File is ignored: .github/workflows/awsfulltest.yml
  • files_exist - File is ignored: .github/workflows/branch.yml
  • files_exist - File is ignored: conf/igenomes.config
  • files_exist - File is ignored: .github/workflows/linting_comment.yml
  • files_exist - File is ignored: .github/CONTRIBUTING.md
  • files_exist - File is ignored: docs/CONTRIBUTING.md
  • files_exist - File is ignored: docs/README.md
  • files_exist - File is ignored: docs/output.md
  • files_exist - File is ignored: docs/usage.md
  • nextflow_config - Config variable ignored: manifest.name
  • nextflow_config - Config variable ignored: manifest.homePage
  • nextflow_config - Config variable ignored: process.cpus
  • nextflow_config - Config variable ignored: process.memory
  • nextflow_config - Config variable ignored: process.time
  • nextflow_config - Config variable ignored: params.input
  • files_unchanged - File ignored due to lint config: CODE_OF_CONDUCT.md
  • files_unchanged - File ignored due to lint config: .github/ISSUE_TEMPLATE/bug_report.yml
  • files_unchanged - File does not exist: .github/ISSUE_TEMPLATE/config.yml
  • files_unchanged - File ignored due to lint config: .github/PULL_REQUEST_TEMPLATE.md
  • files_unchanged - File does not exist: .github/workflows/branch.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/pr-comment.yml
  • files_unchanged - File ignored due to lint config: .github/workflows/linting.yml
  • files_unchanged - File does not exist: assets/email_template.html
  • files_unchanged - File ignored due to lint config: assets/email_template.txt
  • files_unchanged - File ignored due to lint config: assets/sendmail_template.txt
  • files_unchanged - File ignored due to lint config: assets/nf-core-rustqc-benchmarks_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-rustqc-benchmarks_logo_light.png
  • files_unchanged - File ignored due to lint config: docs/images/nf-core-rustqc-benchmarks_logo_dark.png
  • files_unchanged - File ignored due to lint config: docs/README.md
  • files_unchanged - File ignored due to lint config: .gitignore or .prettierignore
  • actions_awstest - 'awstest.yml' workflow not found: /home/runner/work/RustQC-benchmarks/RustQC-benchmarks/.github/workflows/awstest.yml
  • template_strings - Ignoring Jinja template strings in file /home/runner/work/RustQC-benchmarks/RustQC-benchmarks/test-data/rna/small/test.name_sorted.bam
  • merge_markers - Ignoring file /home/runner/work/RustQC-benchmarks/RustQC-benchmarks/snapshots/rna/small/qualimap/rnaseq_qc_results.txt
  • merge_markers - Ignoring file /home/runner/work/RustQC-benchmarks/RustQC-benchmarks/snapshots/rna/small/rustqc/qualimap/rnaseq_qc_results.txt
  • multiqc_config - multiqc_config
  • rocrate_readme_sync - ro-crate-metadata.json not found
  • container_configs - container_configs
  • included_configs - included_configs

✅ Tests passed:

Run details

  • nf-core/tools version 4.2.2
  • Run at 2026-12-03 14:21:53

@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

❌ nf-test failed with latest Nextflow version

Note

Tests with Nextflow's latest version failed but it will not cause a CI workflow failure.
Please check if the failure is expected with newer (edge-)releases of Nextflow or if it needs fixing.

  • ❌ docker | latest-everything | Shard 1/7

See the full run for details.

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.

1 participant