Gene page: classification summary counts
- Dominant language
- Python
- Stars
- 30
- Forks
- 3
- Avg merge
- 9h 28m
- Merged PRs (30d)
- 42
Description
🤖 Written by Claude
Add pathogenicity summary counts (B / LB / VUS / LP / P) above the existing classification groupings datatable on the gene symbol page.
### Why
The full classification grid is already on the gene page (`genes/templates/genes/view_gene_symbol.html:447`, via `{% classification_groupings %}`), so labs can see every classified variant for a symbol. What's missing is the at-a-glance answer to "how many pathogenic variants do we have for BRCA2?" — right now that means scrolling a potentially long table. A scientist opening the gene page to curate a new variant wants that number immediately.
### What already exists
- `ClassificationClassificationBucket` (`classification/models/classification_grouping.py:45`) — BENIGN / VUS / PATHOGENIC / ONCOGENIC / OTHER / CONFLICTING / NO_DATA, plus `bucket_for_classification()` mapping clinical significance values
- `ClassificationGrouping.filter_for_user()` — share-level-aware permission filtering, already used by the datatable
- `ClassificationGroupingSearchTerm` with `GENE_SYMBOL` term type — the gene symbol → grouping link (see `ClassificationGrouping.gene_symbols()`)
- `GeneSymbolViewInfo` (`genes/views/views.py:179`) — `cached_property` pattern, a natural home for the count query
- The allele origin (germline / somatic) filter already exists on this page
### What needs building
- A count query on `GeneSymbolViewInfo`, grouped by clinical significance bucket, scoped through `ClassificationGrouping.filter_for_user()` so users only see what they're allowed to
- A small summary row rendered above the datatable, e.g. `Pathogenic: 12 · Likely Pathogenic: 8 · VUS: 34 · Likely Benign: 5 · Benign: 11`
- Optionally split by allele origin bucket, to match the filter already on the page
### Open question
`ClassificationGrouping` doesn't store a classification bucket field directly (it's commented out in the model), so counts would need to derive from `latest_classification_modification` clinical significance, or count the underlying `Classification` records. Worth deciding which before implementing — one grouping can cover multiple classifications from the same lab.
### Notes
Effort: small — the query is straightforward and the rendering is a few lines of template. Permission scoping is the part to get right.
From `claude/new_feature_ideas.md` idea #6.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in genes/views/views.py at GeneSymbolViewInfo and inspect genes/templates/genes/view_gene_symbol.html around line 447, then trace ClassificationGrouping.filter_for_user() and the gene-symbol search term. Decide how latest clinical significance maps to the requested buckets and whether allele-origin splitting is included. Done means a permission-scoped summary row appears above the existing classification groupings datatable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- full-stack
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100