Search preview HGVS code: variant HGVS row to annotation, resolved c.HGVS lookup onto ImportedAlleleInfo
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Read classification/signals/classification_search.py, annotation/canonical_annotation.py, and the ImportedAlleleInfo model near column_name_for_build; trace the preview receivers and the existing tests in classification/tests/test_classification_search.py. Move the annotation helpers and tests, put the resolved HGVS lookup and build cache guard on the model, then split the preview receivers as described. Done when the existing search preview tests pass unchanged, including the T2T case.
Written by the indexing model from the issue text.
Description
🤖 Written by Claude
Came out of reviewing #2824 (for #2821). classification/signals/classification_search.py holds the classification search receiver, the search-preview receivers for Allele / Variant / OntologyTerm, and the HGVS code those previews use. Two pieces of that HGVS code have a better home. No behaviour change intended.
1. The variant's own HGVS row belongs in annotation
_variant_hgvs_extra and _variant_location_summary read only annotation data: the canonical c.HGVS, the g.HGVS, and consequence / distance / symbol for the "3709bp upstream of X" line. They sit in the classification file because the classification preview falls back to them when no classification supplies a c.HGVS.
- Move them beside
annotation/canonical_annotation.py:get_canonical_c_hgvs, which they already call. - Keep them as a plain helper the classification receiver calls.
PreviewData._summary_external(library/preview_request.py) concatenates every receiver's rows, so a separatepreview_extra_signalreceiver inannotationcould not tell that the classification receiver had already supplied c.HGVS rows, and the fallback would become duplicate rows. - The
_variant_location_summarytests inclassification/tests/test_classification_search.pymove with it.
2. The resolved c.HGVS / p.HGVS lookup belongs on the model
_allele_preview_classifications_extra builds the distinct (c_hgvs, p_hgvs) pairs for a build from the cached ResolvedVariantInfo columns. That is a query about resolved HGVS per build: a method next to ImportedAlleleInfo.column_name_for_build that returns an empty list for a build with no cached columns would leave the receiver to format rows only.
It would also give the "is this build cached?" guard one home. It is currently written three ways:
classification/views/classification_datatables.py(render_hgvs) catches theValueErrorfromcolumn_name_for_build.classification/views/classification_grouping_datatables.py(genome_build_prefs) filters byImportedAlleleInfo.supported_genome_builds().- The search preview checks
in ImportedAlleleInfo.supported_genome_builds()inline (#2824).
One place to change when #1973 widens the supported builds.
3. Smaller, same file
classification_qs_to_extrasis imported bygenes/signals/gene_symbol_search.py, sogenesimports fromclassification.signals, which is above it in the app layering. The GeneSymbol preview receiver that needs it could live inclassification/signals/.- Split the preview receivers out of the search file, following
snpdb/signals/variant_zygosity_preview_extra.py(e.g.classification/signals/classification_preview_extra.py).
Testing
Refactor only: existing search preview tests pass unchanged, including the T2T case added in #2824.
- Dominant language
- Python
- Stars
- 31
- Forks
- 4
- Avg merge
- 4h 52m
- Merged PRs (30d)
- 183
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SACGF/variantgrid
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
SACGF/variantgrid#2964 · 1 comment ·
Maintainers usually reply within 1 day
-
Genome build now duplicated in "imported as" on allele pagePossibly taken @TheMadBug claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
SACGF/variantgrid#2950 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
SACGF/variantgrid#2865 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SACGF/variantgrid#2647 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
SACGF/variantgrid#2341 · 3 comments ·
Maintainers usually reply within 1 day
All issues in SACGF/variantgrid
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day