4ae34371cb47aaf48f640e0043ec00717092cbd6
braney
  Tue Apr 22 12:34:33 2025 -0700
a few tweaks to get hgGene to work with quickLift

diff --git src/hg/hgGene/hgGene.c src/hg/hgGene/hgGene.c
index 39cc991868f..c2ae503eab7 100644
--- src/hg/hgGene/hgGene.c
+++ src/hg/hgGene/hgGene.c
@@ -718,31 +718,30 @@
 cartWebEnd();
 }
 
 void cartMain(struct cart *theCart)
 /* We got the persistent/CGI variable cart.  Now
  * set up the globals and make a web page. */
 {
 if (issueBotWarning)
     {
     char *ip = getenv("REMOTE_ADDR");
     botDelayMessage(ip, botDelayMillis);
     }
 cart = theCart;
 getDbAndGenome(cart, &database, &genome, oldVars);
 initGenbankTableNames(database);
-getGenomeSettings();
 if (cartVarExists(cart, hggDoKgMethod))
     doKgMethod();
 else if (cartVarExists(cart, hggDoTxInfoDescription))
     doTxInfoDescription();
 else
     {
     struct sqlConnection *conn = NULL;
     char *geneName = cartUsualString(cart, hggGene, NULL);
     if (isEmpty(geneName))
 	{
 	// Silly googlebots.
 	hUserAbort("Error: the hgg_gene parameter is missing from the cart and the CGI params.");
 	}
 
     /* if kgProtMap2 table exists, this means we are doing KG III */
@@ -758,39 +757,43 @@
     
     struct trackDb *tdb = hTrackDbForTrack(database, tableName);
 
     if ((tdb == NULL) && sameString(tableName, "knownGene") && differentString(database, knownDb))
         {
         // if no table or knownGene has been given to us, and knownGene doesn't work, try the default gene track.
         tableName = hdbGetMasterGeneTrack(knownDb);
         tdb = hTrackDbForTrack(database, tableName);
         }
 
     if (tdb == NULL)
 	hUserAbort("Error: cannot open gene track %s.", tableName);
 
     globalTdb = tdb;
     char *externalDb = trackDbSetting(tdb, "externalDb");
+    char *liftDb = trackDbSetting(tdb, "quickLiftDb");
     if (externalDb != NULL)
         conn = hAllocConn(externalDb);
     else
         {
-        char *liftDb = trackDbSetting(tdb, "quickLiftDb");
         if (liftDb)
+            {
             database = liftDb;
+            genome = hGenome(database);
+            }
         conn = hAllocConn(database);
         }
+    getGenomeSettings();
 
     curGeneId = findGeneId(conn, geneName);
     getGenePosition(conn);
     curGenePred = getCurGenePred(conn);
     curGeneName = getGeneName(curGeneId, conn);
     spConn = hAllocConn(UNIPROT_DB_NAME);
     swissProtAcc = getSwissProtAcc(conn, spConn, curGeneId);
 
     if (isRgdGene(conn)) swissProtAcc=getRgdGeneUniProtAcc(curGeneId, conn);
     /* Check command variables, and do the ones that
      * don't want to put up the hot link bar etc. */
     if (cartVarExists(cart, hggDoGetMrnaSeq))
 	doGetMrnaSeq(conn, curGeneId, curGeneName);
     else if (cartVarExists(cart, hggDoWikiTrack))
 	doWikiTrack(conn);