Compute and store canonical p.HGVS on ResolvedVariantInfo
- Dominant language
- Python
- Stars
- 30
- Forks
- 3
- Avg merge
- 9h 28m
- Merged PRs (30d)
- 42
Description
Split off from #19. Related: SACGF/variantgrid_private#3557
`ResolvedVariantInfo` has `c_hgvs` computed offline via `HGVSMatcher`, but no equivalent for p.HGVS. Without a single resolved value, front-end tables must pull from unreliable evidence fields or join to annotation.
**Deliverables:**
- Add `p_hgvs` field (and possibly `p_hgvs_short`) to `ResolvedVariantInfo` + migration
- Implement `recalc_p_hgvs()` with a fallback chain:
1. VEP annotation matched to the resolved transcript (`VariantTranscriptAnnotation.hgvs_p`)
2. ClinGen API (`ClinGenAllele.get_p_hgvs()`)
3. Classification evidence (`published_evidence__p_hgvs__value`)
- Normalize all sources into consistent format using the `PHGVS` parser — strip protein accession prefix, produce canonical long-form and short-form
- Hook `recalc_p_hgvs()` into `ResolvedVariantInfo.set_variant_and_save()` alongside `recalc_c_hgvs()`
- Management command to backfill all existing rows
**Open questions:**
- Store `p_hgvs_short` as a field or compute on-the-fly?
- Does p.HGVS need version tracking like `c_hgvs_converter_version`, or just re-derive from annotation?
Once this is done, #19 (display) and variantgrid_private#3557 (mismatch warnings) become straightforward.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.