4c1d2a0a761f1afc9da81243357e462ae14c3756
braney
  Thu Dec 15 14:49:26 2022 -0800
add assembly aliasing to hub connection

diff --git src/hg/lib/web.c src/hg/lib/web.c
index 5c4725b..c6adf24 100644
--- src/hg/lib/web.c
+++ src/hg/lib/web.c
@@ -11,30 +11,31 @@
 #include "web.h"
 #include "dupTrack.h"
 #include "hPrint.h"
 #include "hdb.h"
 #include "hui.h"
 #include "hgConfig.h"
 #include "hVarSubst.h"
 #include "cheapcgi.h"
 #include "dbDb.h"
 #include "hgColors.h"
 #include "hubConnect.h"
 #include "search.h"
 #include "geoMirror.h"
 #include "trackHub.h"
 #include "versionInfo.h"
+#include "asmAlias.h"
 
 #ifndef GBROWSE
 #include "axtInfo.h"
 #include "wikiLink.h"
 #include "googleAnalytics.h"
 #include "jsHelper.h"
 #endif /* GBROWSE */
 
 
 /* flag that tell if the CGI header has already been outputed */
 boolean webHeadAlreadyOutputed = FALSE;
 /* flag that tell if text CGI header has been outputed */
 boolean webInTextMode = FALSE;
 
 struct hash *includedResourceFiles = NULL;
@@ -909,52 +910,54 @@
  * was in their cart, unless the Genome doesn't match.
  */
 {
 boolean gotClade = hGotClade();
 *retDb = (dbOveride != NULL) ? dbOveride :  cgiOptionalString(dbCgiName);
 if (*retDb == NULL)  // if db is not in URL, but genome is, use it for db 
     *retDb = cgiOptionalString(hgHubGenome);
 
 *retGenome = cgiOptionalString(orgCgiName);
 *retClade = cgiOptionalString(cladeCgiName);
 
 /* Was the database passed in as a cgi param?
  * If so, it takes precedence and determines the genome. */
 if (*retDb)
     {
+    *retDb = asmAliasFind(*retDb);
     if (hDbExists(*retDb))
         *retGenome = hGenome(*retDb);
     else
         errAbort("No db called %s", *retDb);
     }
 /* If no db was passed in as a cgi param then was the organism (a.k.a. genome)
  * passed in as a cgi param?
  * If so, the we use the proper database for that genome. */
 else if (*retGenome && !sameWord(*retGenome, "0"))
     {
     *retDb = getDbForGenome(*retGenome, cart);
     *retGenome = hGenome(*retDb);
     }
 else if (*retClade && gotClade)
     {
     *retGenome = hDefaultGenomeForClade(*retClade);
     *retDb = getDbForGenome(*retGenome, cart);
     }
 /* If no cgi params passed in then we need to inspect the session */
 else
     {
     *retDb = cartOptionalString(cart, dbCgiName);
+    *retDb = asmAliasFind(*retDb);
     *retGenome = cartOptionalString(cart, orgCgiName);
     *retClade = cartOptionalString(cart, cladeCgiName);
     /* If there was a db found in the session that determines everything. */
     if (*retDb && hDbExists(*retDb))
         {
         *retGenome = hGenome(*retDb);
         }
     else if (*retGenome && !sameWord(*retGenome, "0"))
 	{
 	*retDb = hDefaultDbForGenome(*retGenome);
 	}
     else if (*retClade && gotClade)
 	{
         *retGenome = hDefaultGenomeForClade(*retClade);
 	*retDb = getDbForGenome(*retGenome, cart);