Get LRG / RefSeqGene data from cdot, remove the LRG_RefSeqGene download

Open
#2,947 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
databases

Research direction

Start with genes/cached_web_resource/lrg_ref_seq_gene.py, LRGRefSeqGene, the cdot import path for TranscriptVersion.data, DjangoTranscriptDataProvider, and library/vg/inspect/transcript.py. Read how HGVSMatcher currently resolves LRG transcripts and RefSeqGene contigs, then trace cdot's refseqgene import and provider hooks. Done when transcript and genomic LRG/NG_ lookups use cdot and the old download, model, task, and ClinGen LRG fallback are removed.

Written by the indexing model from the issue text.

Description

Biocommons HGVS HGVS Refactoring rework

🤖 By Claude Opus 5.5

Low priority. The aim is fewer annotation files and downloads for VG to manage, with LRG data coming through cdot like the rest of the transcript data.

Now

VG downloads NCBI's LRG_RefSeqGene as a CachedWebResource (CACHED_WEB_RESOURCE_LRG_REF_SEQ_GENE, genes/cached_web_resource/lrg_ref_seq_gene.py) into the LRGRefSeqGene table. HGVSMatcher uses it to swap an LRG transcript (LRG_1097t3) for its RefSeq transcript before converting, and falls back to the ClinGen Allele Registry when VG doesn't have that transcript. Genomic LRGs and RefSeqGenes (LRG_292:g., NG_005905.2:g.) only go through ClinGen.

cdot now has this

From cdot data 0.2.38 (SACGF/cdot#259) and client 0.2.39, built from the same NCBI LRG_RefSeqGene file plus NCBI's RefSeqGene alignments:

  • Each RefSeq transcript that is an LRG transcript has lrg (eg LRG_1097t3) and lrg_protein (eg LRG_1097p3), so these end up in TranscriptVersion.data on import.
  • RefSeq transcripts inside an NG_ have that alignment in genome_builds[build]["alt_alignments"]["NG_..."].
  • A new top-level refseqgene table: {"NG_011340.1": {"lrg": "LRG_1097", "genome_builds": {...}}}.
  • LocalDataProvider (which DjangoTranscriptDataProvider extends) handles LRG transcripts and NG_/LRG contigs. A subclass only has to return the transcript for an LRG name from _get_transcript, and implement _get_refseqgene_for_lrg(lrg) (LRG -> NG_ accession).

Change

  • Requires cdot data >= 0.2.38 and client >= 0.2.39.
  • Look up LRG transcripts from TranscriptVersion.data["lrg"] (needs a way to query it, eg an indexed field set on import) instead of LRGRefSeqGene.
  • Import the refseqgene table with the cdot data, and implement DjangoTranscriptDataProvider._get_refseqgene_for_lrg. This gives LRG_/NG_ g. HGVS without ClinGen.
  • Remove the LRGRefSeqGene model, its CachedWebResource and task, and update library/vg/inspect/transcript.py.
  • The ClinGen fallback for LRGs can then go too. Today it relies on ClinGen's reference bases.
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SACGF/variantgrid

All issues in SACGF/variantgrid

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.