214fe5d147954cd0d62f127025f7cb3a59f38085
braney
  Fri Aug 1 15:26:14 2025 -0700
support Genark hubs as fromDb in hgConvert

diff --git src/hg/hgConvert/hgConvert.c src/hg/hgConvert/hgConvert.c
index 6cbbd11331d..e900abde1bb 100644
--- src/hg/hgConvert/hgConvert.c
+++ src/hg/hgConvert/hgConvert.c
@@ -273,31 +273,35 @@
     if (subChain != NULL)
 	slAddHead(&chainList, subChain);
     if (chainToFree != NULL)
         chainFree(&chain);
     }
 slSort(&chainList, chainCmpScore);
 return chainList;
 }
 
 static void doConvert(char *fromPos)
 /* Actually do the conversion */
 {
 struct dbDb *fromDb = hDbDb(trackHubSkipHubName(database)), *toDb = hDbDb(cartString(cart, HGLFT_TODB_VAR));
 
 if (fromDb == NULL)
-    fromDb =  genarkLiftOverDbs(database);
+    {
+    char buffer[4096];
+    safef(buffer, sizeof buffer, "'%s'", trackHubSkipHubName(database));
+    fromDb =  genarkLiftOverDbs(buffer);
+    }
 if (toDb == NULL)
     toDb =  genarkLiftOverDb(cartString(cart, HGLFT_TODB_VAR));
 
 if (!fromDb || !toDb)
     errAbort("Early error - unable to find matching database records in dbDb - please contact support");
 
 cartWebStart(cart, database, "%s %s %s to %s %s", fromDb->organism, fromDb->description,
 	fromPos, toDb->organism, toDb->description);
 
 char *fileName = liftOverChainFile(fromDb->name, toDb->name);
 if (isEmpty(fileName))
     errAbort("Unable to find a chain file from %s to %s - please contact support", fromDb->name, toDb->name);
 
 fileName = hReplaceGbdbMustDownload(fileName);
 char *chrom;
@@ -435,31 +439,31 @@
 
 cart = theCart;
 getDbAndGenome(cart, &database, &organism, oldVars);
 
 // Try to deal with virt chrom position used by hgTracks.
 if (startsWith(    MULTI_REGION_CHROM, cartUsualString(cart, "position", ""))
  || startsWith(OLD_MULTI_REGION_CHROM, cartUsualString(cart, "position", "")))
     cartSetString(cart, "position", cartUsualString(cart, "nonVirtPosition", ""));
 
 if (cartVarExists(cart, HGLFT_DO_CONVERT))
     doConvert(fromPos);
 else
     {
     struct liftOverChain *checkLiftOverList = liftOverChainListForDbFiltered(trackHubSkipHubName(database));
     struct liftOverChain *liftOverList = cleanLiftOverList(checkLiftOverList);
-    struct liftOverChain *choice = defaultChoices(liftOverList, organism, database);
+    struct liftOverChain *choice = defaultChoices(liftOverList, organism, trackHubSkipHubName(database));
     if (choice == NULL)
 	errAbort("Sorry, no conversions available from this assembly.");
     struct dbDb *dbList, *fromDb, *toDb;
     dbList = hDbDbListMaybeCheck(FALSE);
     fromDb = matchingDb(dbList, choice->fromDb);
     toDb = matchingDb(dbList, choice->toDb);
     askForDestination(choice, fromPos, fromDb, toDb);
     liftOverChainFreeList(&liftOverList);
     }
 }
 
 /* Null terminated list of CGI Variables we don't want to save
  * permanently. */
 char *excludeVars[] = { "submit", HGLFT_DO_CONVERT, NULL};