Skip to content

Cross-context overlaps consistently labelled as differences (variantgrid_private#3868) - #1933

Open
davmlaw wants to merge 2 commits into
masterfrom
3868_cross_context_overlap_label
Open

davmlaw wants to merge 2 commits into
masterfrom
3868_cross_context_overlap_label

Conversation

@davmlaw

@davmlaw davmlaw commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

🤖 Written by Claude

For SACGF/variantgrid_shariant#321

Cross-context overlaps are meant to be called a (medically significant) difference, never a discordance (agreed 23/07/2026). Overlap.overlap_status_label already followed that rule, but several places worked out the wording themselves:

  • tags/overlap_state.html hardcoded "Discordance" next to the medically significant icon.
  • snippets/overlap_value_cell.html picked "Discordance" or "Difference" from value_type alone, ignoring overlap_type.
  • The "Was : …" max-ever status on the overlap page (overlap_detail.html) and in the overlaps grid used the raw OverlapStatus.label, so a cross-context overlap could show "Was : Medically significant discordance".
  • Overlap.__str__ also used the raw label.

Changes

  • Overlap.disagreement_label returns "Difference" for cross-context and somatic clinical significance overlaps, and "Discordance" otherwise. label_for_status(status) builds the Discordance / Medically significant … labels from it. overlap_status_label and the new overlap_max_ever_status_label both go through it.
  • The two templates use disagreement_label rather than a hardcoded word. The "Was :" lines and __str__ use the model labels.

Review notes

  • On current master, neither of those two templates is reached with a cross-context overlap. overlap_state only shows the icon and short word for single-context onc/path, and the overlaps grid only lists single-context rows. The allele page's cross-context rows already used overlap_status_label. The issue predates the overlaps squash (25ed4f3), so the "discordance" in the screenshot most likely came from older code. This PR removes the duplicated wording so the rule lives in one place.
  • Single-context rendering is unchanged, apart from one case: a single-context somatic clinical significance overlap's "Was :" line now reads "difference", matching its current-status label.
  • The icon plus short word ("Discordance" or "Difference" with the medical icon) is kept, rather than switching those spots to the full "Medically significant …" text.

Verification

  • New classification/tests/models/test_overlap_status_label.py (SimpleTestCase) covers the cross-context, single-context and somatic labels.
  • manage.py test --keepdb classification.tests.models.test_overlap_status_label classification.tests.utils.test_urls variantopedia.tests.test_urls: 14 tests, OK.
  • vg page returns 200 for /classification/overlaps, /classification/overlaps/overlap/<pk> and /variantopedia/view_allele/<pk>. My dev DB has no discordant overlaps, so I also rendered both templates in a shell with unsaved overlaps at status 90:
    • cross-context onc/path: "Difference" in the grid cell, "Medically significant difference" on the overlap page
    • single-context onc/path: "Discordance" in both, the same as before

🤖 Generated with Claude Code

…fference" for cross context and somatic clinical significance overlaps, "Discordance" otherwise, and label_for_status builds the status labels from it. overlap_state, overlap_value_cell and the "Was :" max-ever status on the overlap page and overlaps grid use it instead of hardcoded words or the raw OverlapStatus label SACGF/variantgrid_private#3868
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