62ccb95d5c71a3bf7658327e6db2bc35c19d1d71
chmalee
  Wed Oct 11 09:57:36 2023 -0700
Adding back hgvs search support for historical refseq transcripts and
historical refSeq transcripts track. Should be more resilient code this
time.

diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c
index c062d9e..40c02a6 100644
--- src/hg/lib/hdb.c
+++ src/hg/lib/hdb.c
@@ -5835,30 +5835,40 @@
 slNameFreeList(&gencodeTables);
 return tableName;
 }
 
 boolean hDbHasNcbiRefSeq(char *db)
 /* Return TRUE if db has NCBI's RefSeq alignments and annotations. */
 {
 // hTableExists() caches results so this shouldn't make for loads of new SQL queries if called
 // more than once.
 return (hTableExists(db, "ncbiRefSeq") && hTableExists(db, "ncbiRefSeqPsl") &&
         hTableExists(db, "ncbiRefSeqCds") && hTableExists(db, "ncbiRefSeqLink") &&
         hTableExists(db, "ncbiRefSeqPepTable") &&
         hTableExists(db, "seqNcbiRefSeq") && hTableExists(db, "extNcbiRefSeq"));
 }
 
+boolean hDbHasNcbiRefSeqHistorical(char *db)
+/* Return TRUE if db has NCBI's Historical RefSeq alignments and annotations. */
+{
+// hTableExists() caches results so this shouldn't make for loads of new SQL queries if called
+// more than once.
+return (hTableExists(db, "ncbiRefSeqHistorical") && hTableExists(db, "ncbiRefSeqPslHistorical") &&
+        hTableExists(db, "ncbiRefSeqCdsHistorical") && hTableExists(db, "ncbiRefSeqLinkHistorical") &&
+        hTableExists(db, "seqNcbiRefSeqHistorical") && hTableExists(db, "extNcbiRefSeqHistorical"));
+}
+
 char *hRefSeqAccForChrom(char *db, char *chrom)
 /* Return the RefSeq NC_000... accession for chrom if we can find it, else just chrom.
  * db must never change. */
 {
 static char *firstDb = NULL;
 static struct hash *accHash = NULL;
 static boolean checkExistence = TRUE;
 if (firstDb && !sameString(firstDb, db))
     errAbort("hRefSeqAccForChrom: only works for one db.  %s was passed in earlier, now %s.",
              firstDb, db);
 char *seqAcc = NULL;
 if (checkExistence && !trackHubDatabase(db) && hTableExists(db, "chromAlias"))
     // Will there be a chromAlias for hubs someday??
     {
     firstDb = db;