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/hgc/hgc.c src/hg/hgc/hgc.c index 05d2c4ba7bd..af33696c651 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -10217,33 +10217,43 @@ if (isHubTrack(table)) tdb = hubConnectAddHubForTrackAndFindTdb( database, table, NULL, trackHash); else tdb = hashFindVal(trackHash, table); char *bigDataUrl = trackDbSetting(tdb, "bigDataUrl"); if (bigDataUrl) { itemCount = getSeqForBigGene(tdb, geneName); } else { char constraints[256]; sqlSafef(constraints, sizeof(constraints), "name = '%s'", geneName); char *db = database; char *liftDb = cloneString(trackDbSetting(tdb, "quickLiftDb")); + // When quickLifted, the genePred table lives in the source assembly, + // and the click's seqName/winStart/winEnd are in destination coords; + // lift them back to source coords so hgSeqItemsInRange finds rows. + char *querySeq = seqName; + int queryStart = winStart, queryEnd = winEnd; if (liftDb != NULL) + { db = liftDb; - itemCount = hgSeqItemsInRange(db, trackHubSkipHubName(table), seqName, winStart, winEnd, constraints); + quickLiftLiftPos(trackHubSkipHubName(database), liftDb, + seqName, winStart, winEnd, + &querySeq, &queryStart, &queryEnd); + } + itemCount = hgSeqItemsInRange(db, trackHubSkipHubName(table), querySeq, queryStart, queryEnd, constraints); } } if (itemCount == 0) printf("\n# No results returned from query.\n\n"); puts("</PRE>"); } void htcTrackHtml(struct trackDb *tdb) /* Handle click to display track html */ { cartWebStart(cart, database, "%s", tdb->shortLabel); printTrackHtml(tdb); } void doViralProt(struct trackDb *tdb, char *geneName)