8c8823d9a87b6046094577a808dda4ed4172b416
braney
  Thu Apr 23 11:09:48 2026 -0700
Make quickLifted GENCODE tracks usable: click details, position links, coloring. refs #36059

- Re-vet wgEncodeGencode* in trackHub.c:isVetted() so the quickLift hub
no longer emits `avoidHandler on` for GENCODE children. Without this,
hgc bypasses findNameBasedHandler and doGencodeGene is never reached,
so the details page falls through to the generic showGenePos output.
- In gencodeClick.c doGencodeGene/helpers, use quickLiftDb for the
MySQL connection (the attrs/tag/pubMed/refSeq/uniProt tables live in
the source assembly), use trackHubSkipHubName(tdb->track) for the
genePred table name and the Basic/Comp/PseudoGene/PolyA prefix
dispatch checks, and teach isGrcHuman/isGrcH37Native to consult the
source db — otherwise the page errAborted with
"BUG: gencodeClick on wrong database: hub_NNNNN_hs1".
- Lift the Position values (transcript + gene bounds, 2-way pseudo,
PolyA) through the quickLift chain before printing, so the details
page shows destination-assembly coords and the Position link lands
at a window that actually contains the gene.
- htcDnaNearGene (hgc.c): when quickLifted, lift seqName/winStart/winEnd
back to source coords before hgSeqItemsInRange. The prior code
pointed the query at the source-assembly table but still passed the
destination window, so the "Genomic Sequence from assembly" flow
returned "No results returned from query." No longer reachable from
the GENCODE details page (doGencodeGene writes its own Sequences
table) but still hit by other quickLifted genePred tracks.
- simpleTracks.c genePredItemClassColor: the hTableExists() guard was
checking `database` (the destination hub db like hub_NNNNN_hs1) even
though the MySQL conn was already routed to liftDb; the lookup was
skipped and every item fell back to tg->ixColor, rendering all
black. Check `db` instead so the gClass_* palette (coding / nonCoding
/ pseudo / problem) is applied.

Verified end-to-end on hgwdev-braney: Gerardo's SHH test case
(ENST00000297261.7) and Basic/Comp/PseudoGene/PolyA subtracks; no
regression on the non-quickLifted hg38 click.

diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c
index 8d6825c0e25..1f947a5a936 100644
--- src/hg/lib/trackHub.c
+++ src/hg/lib/trackHub.c
@@ -1570,32 +1570,32 @@
 "ncbiRefSeq",
 "clinvar",
 "clinvarSubLolly",
 "pubs",
 "pubsBlat",
 "pubsMarkerBand",
 "pubsMarkerSnp",
 "pubsMarkerGene",
 "refSeqComposite",
 //"gtexGeneV8",
 };
 
 static boolean isVetted(char *track)
 /* Is this a track that's been tested with quickLift?  If not we don't want to do the special name handling on the track. */
 {
-//if (startsWith("wgEncodeGencode", track))
-    //return TRUE;
+if (startsWith("wgEncodeGencode", track))
+    return TRUE;
 static bool inited = FALSE;
 static struct hash *vettedHash = NULL;
 
 if (!inited)
     {
     vettedHash = newHash(10);
 
     int ii;
     int len = sizeof(vettedTracks) / sizeof(char *);
 
     for(ii = 0; ii < len; ii++)
         hashStore(vettedHash, vettedTracks[ii]);
     }
 
 return hashLookup(vettedHash, track) != NULL;