b622d147b7dbac52dbf3ba26928cd18e02d42bd8
braney
  Sat Feb 26 12:34:37 2022 -0800
add support for using a bigBed as the chromAlias file

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index a6b29d6..53922b5 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -186,53 +186,41 @@
 
 static struct chromInfo *mustGetChromInfo(char *db, char *chrom)
 /* Get chromInfo for named chrom from primary database or
  * die trying. */
 {
 struct chromInfo *ci = hGetChromInfo(db, chrom);
 if (ci == NULL)
     errAbort("Couldn't find chromosome/scaffold %s in database", chrom);
 return ci;
 }
 
 char *hgOfficialChromName(char *db, char *name)
 /* Returns "canonical" name of chromosome or NULL
  * if not a chromosome. (Case-insensitive search w/sameWord()) */
 {
-/* aliasHash will be initialized if chromAlias table exists
- *   or track chromAlias file exists
- *  hash key is alias name, hash value is chromosome name
- */
-static struct hash *aliasHash = NULL;
-
 if (strlen(name) > HDB_MAX_CHROM_STRING)
     return NULL;
 struct chromInfo *ci = NULL;
 char buf[HDB_MAX_CHROM_STRING];
 strncpy(buf, name, HDB_MAX_CHROM_STRING);
 buf[HDB_MAX_CHROM_STRING-1] = 0;
 ci = hGetChromInfo(db, buf);
 if (ci != NULL)
     return cloneString(ci->chrom);
-aliasHash = chromAliasAliasToChromHash(db);
-if (aliasHash)
-    {
-    char *chrom = (char *)hashFindVal(aliasHash, name);
-    if (isNotEmpty(chrom))
-        return cloneString(chrom);
-    }
-return NULL;
+
+return chromAliasFindNative(name);
 }	/*	char *hgOfficialChromName(char *db, char *name)	*/
 
 boolean hgIsOfficialChromName(char *db, char *name)
 /* Determine if name is exact (case-sensitive) match with
  * a chromosome in the given assembly */
 {
 char *chrom;
 return ((chrom = hgOfficialChromName(db, name)) != NULL &&
 	sameString(name, chrom));
 }
 
 static boolean minLen = 0;
 
 void setMinIndexLengthForTrashCleaner()
 /* set the minimum index size so trash cleaner will not die