0781f49ccdacd52dd75b0f12dab183e4b4cd25fc
hiram
  Tue Mar 21 15:04:48 2023 -0700
extend the chromAlias function to the getSequence operation refs #30544

diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c
index e9cc0b4..df7fb2d 100644
--- src/hg/hubApi/apiUtils.c
+++ src/hg/hubApi/apiUtils.c
@@ -662,15 +662,32 @@
     {
 /*
     not sure if the 'curated' hub situation has been solved yet
     if (sameString("hs1", db)) {
       chromAliasSetup("hub_25359_hs1");
     } else {
       chromAliasSetup(db);
     }
 */
     chrom = chromAliasFindNative(chrom);
     }
 if (isEmpty(chrom))	// can't find it here, return the name from the cart
     chrom = cartChr;
 return chrom;
 }
+struct trackHubGenome *hubGenome = NULL;
+
+void hubAliasSetup(struct trackHubGenome *hubGenome)
+/* see if this hub has an alias file and run chromAliasSetupBb() for it */
+{
+if (hubGenome->settingsHash)
+    {
+    char *aliasFile = hashFindVal(hubGenome->settingsHash, "chromAliasBb");
+    char *absFileName = NULL;
+    if (aliasFile)
+       absFileName = trackHubRelativeUrl((hubGenome->trackHub)->url, aliasFile);
+    if (absFileName)
+        {
+        chromAliasSetupBb(NULL, absFileName);
+        }
+    }
+}