7120a354ec4870b3bc2112c384bdb0af837ed44e
braney
  Thu Apr 23 14:12:36 2026 -0700
hgc: make quickLifted NCBI RefSeq / UCSC RefSeq click details work. refs #36125

- trackHub.c isVetted(): accept refGene, ncbiRefSeq* subtracks, and ncbiOrtho
so the generated quickLift hub.txt doesn't emit 'avoidHandler on' for them.
Without this, hgc skips findNameBasedHandler and the detail click falls
through to genericClickHandler, showing none of the rich RefSeq fields.
- hgc.c findNameBasedHandler: when the tdb has 'quickLifted on', strip the
hub_NNN_ prefix from the dispatch table before comparisons so refGene /
ncbiRefSeq* match their native handlers.
- doNcbiRefSeq / doRefGene: route hAllocConn to quickLiftDb (source), use
trackHubSkipHubName for track/table name comparisons, and pass srcDb into
replaceInUrl, hTableExists, AceView / MGIid / jaxOrtholog / hg-prefix
checks -- otherwise these paths errAborted with "Unknown database
hub_NNN_<db>" on a quickLifted click.
- printRefSeqInfo / prRefGeneInfo / gbCdnaGetVersion: use sqlGetDatabase(conn)
rather than the global `database` for host-db checks.
- Predicted Protein / Predicted mRNA links for quickLifted tracks now point
at htcTranslatedPredMRna / htcGeneMrna so the sequences come from the
destination genome at the lifted exon coordinates, rather than the
NCBI-authored refPep / seqNcbiRefSeq extFiles on the source. Native
behavior is unchanged.
- showGenePos: fetch via quickLiftSql + calcLiftOverGenePreds when the track
is quickLifted so the Position line is in destination coordinates. The
swapped chainHash comes from the track's quickLiftUrl bigChain, matching
the pattern getGenePredForPositionSql already uses.
- Suppress the mRNA/Genomic Alignments block and its trailing <hr> for
quickLifted refGene / ncbiRefSeq* clicks. The PSLs come back in source
coords and the htcCdnaAli links don't line up with the destination window.
- getAlignmentsTName: use sqlGetDatabase(conn) rather than global `database`
so split-table resolution looks up the right db.
- printGeneCards: take a db argument; callers pass srcDb so the GeneCards
link renders on quickLifted pages (the "startsWith hg" check was matching
hub_NNN_hs1 as false).
- geneReviewsClick.c prGRShortRefGene: take a struct sqlConnection * rather
than opening its own on `database` (hub_NNN_hs1 -> Unknown database abort).
Callers in prRefGeneInfo and doOmimGene2 pass their existing source-db
conn, so the Related GeneReviews line now shows on both native and
quickLifted refGene pages.

Verified end-to-end on hgwdev-braney with hg38 -> hs1 quickLift of the
refSeqComposite: ncbiRefSeqCurated and refGene clicks on SHH now render
the full doNcbiRefSeq / doRefGene details (RefSeq / Status / Description
/ Synonyms / OMIM / Protein / HGNC / Entrez Gene / GeneCards / AceView /
Summary / Position / Gene Symbol); Predicted mRNA and Predicted Protein
links return destination-derived sequences; Genomic Sequence reaches the
Get-DNA-in-window page; Ctrl/Cmd+drag zoom no longer ends up with an
HTML error page inside the zoom dialog. Non-quickLifted hg38 refSeq
details are unchanged (alignments still shown, GeneReviews still present).

The duplicate-subtracks symptom from the ticket's step (i) is not
addressed here -- it's an architectural consequence of the shared
`refSeqComposite` cart key applying to both the destination's native
composite and the quickLift hub's composite, and needs cart-scoping
work in quickLift v2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

diff --git src/hg/hgc/hgc.h src/hg/hgc/hgc.h
index 89c4449b279..ab1236687dc 100644
--- src/hg/hgc/hgc.h
+++ src/hg/hgc/hgc.h
@@ -486,31 +486,31 @@
 void doBedDetail(struct trackDb *tdb, struct customTrack *ct, char *itemName);
 /* generate the detail page for a custom track of bedDetail type */
 
 void doPgSnp(struct trackDb *tdb, char *itemName, struct customTrack *ct);
 /* print detail page for personal genome track (pgSnp) */
 
 void doGvf(struct trackDb *tdb, char *item);
 /* Show details for variants represented as GVF, stored in a bed8Attrs table */
 
 void doGeneReviews(struct trackDb *tdb, char *itemName);
 /* generate the detail page for geneReviews */
 
 void prGeneReviews(struct sqlConnection *conn, char *itemName);
 /* print GeneReviews associated to this item */
 
-void prGRShortRefGene(char *itemName);
+void prGRShortRefGene(struct sqlConnection *conn, char *itemName);
 /* print GeneReviews short label associated to this refGene item */
 
 void doLrg(struct trackDb *tdb, char *item);
 /* Locus Reference Genomic (LRG) info. */
 
 void doLrgTranscriptPsl(struct trackDb *tdb, char *item);
 /* Locus Reference Genomic (LRG) transcript mapping and sequences. */
 
 void htcLrgCdna(char *item);
 /* Serve up LRG transcript cdna seq */
 
 void doPeptideAtlas(struct trackDb *tdb, char *item);
 /* Details for PeptideAtlas peptide mapping */
 
 void doGtexGeneExpr(struct trackDb *tdb, char *item);