Skip to content

fix(scope): record the --intervals a run used so its report says it is partial - #540

Open
geiresx wants to merge 4 commits into
GeiserX:mainfrom
geiresx:pgp/i411-run-scope-intervals-row
Open

geiresx wants to merge 4 commits into
GeiserX:mainfrom
geiresx:pgp/i411-run-scope-intervals-row

Conversation

@geiresx

@geiresx geiresx commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

A run limited with --intervals (or INTERVALS="..." for run-all.sh) gives callability, polygenic score, ancestry, telomere, ROH and archaic results that read as whole-genome results. #515 added a scope check to og summary collect: it marks those sections partial when the calls miss an autosome, or when run_manifest.tsv has a run intervals row. But no step wrote that row. So a run limited to parts of all 22 autosomes (for example chr1:1-1000000 ... chr22:1-1000000) was never marked partial.

The fix

Output change: run_manifest.tsv gets a new run intervals row on a run limited with --intervals. No row, key or file is renamed or removed.

Decisions:

  • docs/results/quality.md is outside this package's file list. Its line said "No step writes this row yet", which this PR makes false, so I changed that one line. Leaving it would put a doc on main that contradicts the code.
  • docs/run-state.md (in the file list) says nothing about the manifest rows or intervals, so it is unchanged.
  • The Nextflow row has no e2e case of its own: the e2e cases are outside this package's files. tests/test_write_manifest.sh checks it instead: it runs the intervals lines of HTML_REPORT's task script in bash, with the value the module's def hands them, and checks they write the same row as bin/write_manifest.sh, and none without --intervals. The case nextflow-from-fastq-2-nextflow runs the Nextflow leg with --intervals, so it runs the new line end to end.

How it was checked

tests/test_write_manifest.sh (it now carries the og-leg marker, so Guard's og-leg runs it with og built and fails if og is missing):

  • INTERVALS=$' chr1:1-1000000\t chr2:1-1000000\n' writes exactly one row, run intervals chr1:1-1000000 chr2:1-1000000. Unset and blank INTERVALS write none.
  • Red control in the test: a copy of the script without the row line writes no row with INTERVALS set.
  • og summary collect reads the manifest the script wrote, beside a sample VCF with calls on all 22 autosomes: scope.autosomes_covered is 22 and the mark is partial: limited to the run's intervals (chr1:1-1000000 chr2:1-1000000).
  • Red control in the test: the same folder with the row dropped has "mark": null.
  • HTML_REPORT's intervals lines write run\tintervals\tchr1:1-1000000 chr2:1-1000000 for that value, and no row for an empty one.
  • Red control in the test: a copy of the module without the printf line does not write the row.

Red first: the new test run against main's bin/write_manifest.sh (4ee60e6) with an og built from main fails twice:

FAIL INTERVALS set wrote the rows '', want 'run intervals chr1:1-1000000 chr2:1-1000000'
FAIL og summary collect did not mark the run partial from the row:   "mark": null
2 failure(s)

The Nextflow part, run against main's module (HTML_REPORT_MODULE set to it), fails 3 checks: it has no def intervals and no intervals lines to run.

On this branch the same run passes (0 failure(s), 16 PASS lines), with og and without it (the og part is then skipped with a note). ShellCheck reports nothing on both shell files.

CI on head 79c6fbc, the fast checks run on the fork's pool (the upstream runs were cancelled to free runners), all green:

E2E runs on the batch tip. The e2e scope picks every case that lists modules/local/html_report/* or bin/write_manifest.sh. The ones that run the changed lines most directly: followups-nf-1-nf-wiring (the module and its manifest), nextflow-from-fastq-2-nextflow (the Nextflow leg with --intervals), reports-and-pgx-correctness-reports (the bash manifest) and run-all-launcher.

Bead: D14

…ow that og marks partial

tests/test_write_manifest.sh now checks that INTERVALS set writes one
run intervals row and unset or blank writes none, then reads that
manifest with og summary collect beside a VCF on all 22 autosomes and
expects the partial mark. Red on main: no step writes the row.

Bead: D14
…s partial

bin/write_manifest.sh writes run intervals from INTERVALS, and the
Nextflow HTML_REPORT writes the same row from --intervals, so the scope
check og summary collect already does (GeiserX#515) sees a run limited to
intervals. No row for a whole-genome run. The CHANGELOG entry and the
quality guide no longer say the row is never written.

Bead: D14
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 34 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f202c52 and 2c6748e.

Files selected for processing: 3

  • bin/write_manifest.sh
  • modules/local/html_report/main.nf
  • tests/test_write_manifest.sh

No actionable comments were generated in the recent review.

Walkthrough

Bash and Nextflow now record selected intervals in run_manifest.tsv. Summary collection uses the intervals row to mark interval-limited runs as partial, including runs with calls across all 22 autosomes.

Changes: Interval scope in run summaries

Layer / File(s) Summary
Write interval rows
bin/write_manifest.sh, modules/local/html_report/main.nf, tests/test_write_manifest.sh
The Bash writer and Nextflow report record nonempty intervals as a single-space-separated manifest value. Tests cover set, unset, and blank intervals.
Mark interval-limited results
CHANGELOG.md, docs/results/quality.md, modules/local/html_report/main.nf, tests/test_write_manifest.sh
Documentation describes how the intervals row identifies partial runs. Summary collection checks verify that the row marks a run partial even when all 22 autosomes have calls. Removing the row removes that partial mark.

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Possibly related PRs

  • GeiserX/OwnGenome#415: Addresses interval-limited runs being treated as genome-wide and uses partial or unknown scope in downstream calculations and labels.
Merge Risk: Minimal · previous review f202c

Reports for runs limited by --intervals will now record that scope and be marked partial. No concrete merge-blocking risk was found. Adding a test that runs HTML_REPORT with --intervals would be a useful follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the run now records the --intervals it used, so its report marks it as partial. The raw summary confirms that bin/write_manifest.sh and the Nextflow HTML_REPORT module…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: the run now records the --intervals it used, so its report marks it as partial. The raw summary confirms that bin/write_manifest.sh and the Nextflow HTML_REPORT module now write a run intervals row to run_manifest.tsv, and that og summary collect uses that row to mark interval-limited runs as partial. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 4ee60e6 and f202c52.

Files selected for processing: 5

  • CHANGELOG.md
  • bin/write_manifest.sh
  • docs/results/quality.md
  • modules/local/html_report/main.nf
  • tests/test_write_manifest.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@geiresx

geiresx commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

… --intervals

Section 5 of tests/test_write_manifest.sh runs the intervals lines of
HTML_REPORT's task script in bash, with the value its def would hand
them, and checks they write the row write_manifest.sh writes, and no row
without --intervals. Red control: the module without the printf line
does not write the row. Main's module fails 3 of these checks.

Bead: D14
INTERVALS is shared with step 29, where genome means the whole genome and
chip the CHIP genes. With either exported, a hand-run report marked a
whole-genome run partial. write_manifest.sh now writes no row for them.

HTML_REPORT puts --intervals on one line in its task script, as
write_manifest.sh does, and its def only quotes the value. The test now
evaluates that def and runs the task lines with a tab, a newline and a
quote in the value, with red controls for each step.

Bead: D14

This branch has not been deployed

No deployments
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