SACGF / SACGF/variantgrid

TSO 500 case report: manual pass over the printed document (HTML/PDF)

Open
#1,873 0 comments 0 reactions 1 assignee Claimed by @davmlaw View on GitHub
Dominant language
Python
Stars
30
Forks
3
Avg merge
9h 22m
Merged PRs (30d)
40

Description

🤖 Written by Claude.

The printed case report (HTML preview + PDF) has had seven content changes land against #444 with unit
coverage over synthetic contexts only. Everything below is visible by building **one** case report and
reading it — the Word file off the same build is #1874, the JSON is
SACGF/variantgrid_sapath#448.

All of it comes off one `ReportContext` (`classification/report/case_report_context.py`), so a content
bug here shows in the JSON too — check the document, and let the JSON issue check the contract.

Test against the **SA Path TSO 500 template** — it is the only user of multi-variant reporting, so there is
no need to exercise the generic template.

Build one, then: `/classification/case_report/` for the preview, `.../download/pdf` for the PDF.

## Results Summary

- [ ] A gene-level `` / copy number loss prints in its own **Copy Number Losses** table, not beside
the gains in Copy Number Changes. Both tables print even when empty ("None detected") — all five
kinds are always in `kind_groups`, so a skipped kind never reads as "not looked for".
- [ ] Within Copy Number Losses, **fewest copies first** (CN 0 above CN 1) — a loss's biggest finding is
the lowest count. Within Copy Number Changes, most copies first, as before.
- [ ] A call with no copy number at all sorts behind the ones that have one, in both tables.
- [ ] VAF prints as a whole percent rounded **half up**: a 12.5% VAF is **13%**, not 12. (Python's own
rounding is half-to-even and would give 12; the value is rounded once, in `vaf_percent_whole`.)

## Splice note

The sentence above Variant Interpretation, generated rather than typed.

- [ ] One reported small variant with protein designation `p.(?)` → "Note that the **X** variant with
protein designation p.(?) is an intronic variant that is predicted to disrupt splicing, see below."
- [ ] Two or more → "...the **X, Y and Z** variants ... **are** intronic variants ..." (comma list, "and"
before the last).
- [ ] **TERT is excluded**: a case whose only `p.(?)` variant is TERT produces *no* note — its promoter
variants are non-coding for a different reason.
- [ ] A not-reported `p.(?)` variant does not put its gene in the note.
- [ ] Cross-check: the genes named in the note match the genes the curator named in the JSON's
`Mutations Comment`. These are **not** fed from each other — the note is generated, the comment is a
typed case value — so if they disagree in practice we need to decide which wins.

## Tier sections

Behaviour change: a tier is now dropped on having nothing **reported**, where it used to be dropped on
having nothing in it at all.

- [ ] Tier I, Tier II and Tier III print even when empty (`ALWAYS_PRINTED_TIERS`).
- [ ] **A case with a Tier IV variant shows no Tier IV heading.** A Tier IV variant is a not-reported
record, so the section would otherwise be a heading over "no reportable variants detected" on every
case that has one. This is the main thing to confirm with the lab.
- [ ] Same for "Tier I or II" and "Not tiered" — heading only when something in them is reported.
- [ ] `unreported_count` on a printed tier still counts the records held back.

## Gene-level gene symbol

- [ ] A gene-level CNV row prints the **approved** symbol — a caller's `MYCL1` reports as `MYCL`
(see the `SEGID=MYCL1` check on SACGF/variantgrid_sapath#446).
- [ ] A fusion prints its **anchor** (first) gene as the symbol, matching the representative annotation.
- [ ] Small variants are unaffected — their symbol still comes off the transcript.

## DRAFT watermark (PDF)

- [ ] A preview and any non-finalised report carries DRAFT.
- [ ] **xhtml2pdf implements neither `transform` nor `position`**, so the PDF's DRAFT sits in the document
flow rather than rotated behind the text. Confirm the lab accepts that, since it's a design call we
can't fix in xhtml2pdf.
- [ ] After finalise, the stored `pdf_file` has **no** watermark — `finalise_case_report` now re-renders
the documents. Download the PDF again after finalising rather than trusting the preview.
- [ ] "Rebuild documents" on a still-draft report **keeps** the watermark.
- [ ] Finalise re-renders over the stored snapshot, so no number the report already quoted moves.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.