de2ccf6d827865f11d3c8edd9ceeb1b6394a7380
lrnassar
  Tue Apr 21 18:22:59 2026 -0700
PrimateAI-3D: label items by nucleotide change, add aaChange field and HTML mouseover.

Variant analysts typically work at the nucleotide level, and the current
item label (amino acid change) collapses distinguishable variants: ~17%
of items share their (chrom, pos, AA-change) tuple with another item
because of codon degeneracy (e.g. three C>A, C>G, C>T at the same
position can all appear as "M>I"). Labeling by nucleotide change makes
every item uniquely distinguishable (0.0% collisions on hg38, 0.1% on
hg19 from overlapping transcripts).

- primateAi.as: field 4 (name) is now "Nucleotide change (e.g. T>C)";
new field aaChange (placed before ref/alt) holds the amino acid
change.
- primateAiToBigBed.py: write name = "{ref}>{alt}", new aaChange column,
and an HTML mouseover with terse labels (Var/AA/Score/Perc/Pred) and
a colored prediction string.
- primateAi.ra: add labelFields name,aaChange and defaultLabelFields
name so users can toggle the on-feature label between nt change
(default) and AA change.
- primateAi.html: expand Display Conventions with the label-convention
rationale and a legend for each mouseover field.

refs #37274

diff --git src/hg/makeDb/scripts/primateai/primateAi.as src/hg/makeDb/scripts/primateai/primateAi.as
index 3ed81a2dd70..6a5236d72cc 100644
--- src/hg/makeDb/scripts/primateai/primateAi.as
+++ src/hg/makeDb/scripts/primateai/primateAi.as
@@ -1,21 +1,22 @@
 table primateAi
 "PrimateAI-3D pathogenicity predictions for all possible missense variants"
     (
     string chrom;        "Chromosome"
     uint chromStart;     "Start position (0-based)"
     uint chromEnd;       "End position"
-    string name;         "Amino acid change (e.g. V>M)"
+    string name;         "Nucleotide change (e.g. T>C)"
     uint score;          "Percentile score (0-1000)"
     char[1] strand;      "Strand"
     uint thickStart;     "Thick start (same as chromStart)"
     uint thickEnd;       "Thick end (same as chromEnd)"
     uint reserved;       "Item RGB color"
+    string aaChange;     "Amino acid change (e.g. Y>C)"
     string ref;          "Reference allele"
     string alt;          "Alternate allele"
     string gene;         "Ensembl transcript ID"
     string refSeq;       "RefSeq transcript ID"
     float scorePAI3D;    "PrimateAI-3D raw score"
     float percentile;    "PrimateAI-3D percentile"
     string prediction;   "Prediction: benign or pathogenic"
     string _mouseOver;   "Mouse over text"
     )