Annotation import loads every transcript version for the build: an 11 minute wait to load one variant's result
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
🤖 Written by Claude
When an annotation run loads its VEP results into the database, the importer first builds a lookup of every transcript version for the build and consortium (annotation/vcf_files/bulk_vep_vcf_annotation_inserter.py:BulkVEPVCFAnnotationInserter.transcript_versions_by_id, which calls genes/models/models_gene.py:TranscriptVersion.transcript_versions_by_id). It does this once per run, whatever the run's size, to turn each transcript accession in the VEP output into a TranscriptVersion pk.
Seen on a test deployment: a GRCh38 run with a single variant took 11 minutes to load its result. The time went on that one query, reading from disk with a cold cache. The same step took 1 minute on GRCh37 and under a second on T2T. Nothing failed, but a classification import that creates one new variant waits that long for its annotation.
Why it is slow
-
It loads far more than it needs. VEP only reports transcripts from the annotation version's gene annotation release, and on the RefSeq builds the release is about a third of the transcript versions we hold:
Build All transcript versions (build + consortium) In the gene annotation release GRCh37 (RefSeq) 201,945 82,466 GRCh38 (RefSeq) 542,377 178,369 T2T (Ensembl) 238,489 236,037 -
Each row needs a read from the
genes_transcriptversiontable itself (about 5 GB, as each row carries its cdot JSON), because no index holdstranscript_id,versionandidtogether. With a cold cache that is one slow disk read per transcript version.
The release is enough. Each VariantAnnotationVersion is tied to one GeneAnnotationRelease, the specific RefSeq or Ensembl release VEP was run with, so VEP's output can only name transcript versions in that release (ReleaseTranscriptVersion). The mitochondrial "fake" transcripts the importer matches (the 13 coding ones, fake-rna-ND4 and so on) are in the release too; the 24 tRNA/rRNA ones are not, and VEP reports nothing the importer links to them.
Ideas to try
Look at the size of the annotation run and pick a strategy to suit. Try a few and measure, cold and warm:
- Very small runs: look up each transcript version as it is needed.
- Medium runs: read a batch of VEP records, collect the transcript accessions in it, and fetch them in one query with
__in=. - Huge runs: load the gene annotation release's transcript versions up front (the fake ones the importer needs are in it).
Index: adding id to the unique (transcript_id, version, genome_build_id) index (INCLUDE (id)) would let all three strategies answer from the index without reading the table. Decide this alongside the strategies, as it may make some of them unnecessary.
The gene lookup next to it (gene_identifiers) loads every gene version for the build the same way, so it is worth a look while there.
- Lingua principale
- Python
- Stelle
- 31
- Fork
- 4
- Merge medio
- 4h 52m
- PR unite (30g)
- 183
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SACGF/variantgrid
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
SACGF/variantgrid#2964 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Genome build now duplicated in "imported as" on allele pageForse già presa @TheMadBug l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
SACGF/variantgrid#2950 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
SACGF/variantgrid#2865 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
SACGF/variantgrid#2647 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
SACGF/variantgrid#2341 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SACGF/variantgrid
Issue simili
-
Test: to_hijri() accepts datetime.datetime and uses only the date partForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertagood first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
polish
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresForse già presa @AshutoshSingh840 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
UKGovernmentBEIS/control-arena#992 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
mvalentsev/awesome-free-ai-coding#70 ·
I maintainer di solito rispondono entro 1 giorno