d2482e22232f8a2296fcc6706b2630f5499f7a83
braney
  Wed Jul 17 13:45:02 2024 -0700
change chroms to chromAuthority names in hgBlat and hgPcr

diff --git src/hg/hgPcr/hgPcr.c src/hg/hgPcr/hgPcr.c
index 9d0bf7f..6272169 100644
--- src/hg/hgPcr/hgPcr.c
+++ src/hg/hgPcr/hgPcr.c
@@ -20,30 +20,31 @@
 #include "htmshell.h"
 #include "hdb.h"
 #include "hui.h"
 #include "cart.h"
 #include "dbDb.h"
 #include "blatServers.h"
 #include "targetDb.h"
 #include "pcrResult.h"
 #include "trashDir.h"
 #include "web.h"
 #include "botDelay.h"
 #include "oligoTm.h"
 #include "trackHub.h"
 #include "hubConnect.h"
 #include "obscure.h"
+#include "chromAlias.h"
 
 
 struct cart *cart;	/* The user's ui state. */
 struct hash *oldVars = NULL;
 
 /* for earlyBotCheck() function at the beginning of main() */
 #define delayFraction   1.0     /* standard penalty for most CGIs */
 static boolean issueBotWarning = FALSE;
 
 void usage()
 /* Explain usage and exit. */
 {
 errAbort(
   "hgPcr - In-silico PCR CGI for UCSC\n"
   "usage:\n"
@@ -619,30 +620,37 @@
         printf("<A target=_blank HREF=\"../FAQ/FAQdownloads#download10\">What is chrom_random?</A><BR>");
     if (isChrUn)
         printf("<A target=_blank HREF=\"../FAQ/FAQdownloads#download11\">What is a chrUn sequence?</A><BR>");
 }
 
 void doQuery(struct pcrServer *server, struct gfPcrInput *gpi,
 	     int maxSize, int minPerfect, int minGood, boolean appendToResults)
 /* Send a query to a genomic assembly PCR server and print the results. */
 {
 struct gfConnection *conn = gfConnect(server->host, server->port,
                                       trackHubDatabaseToGenome(server->db), server->genomeDataDir);
 struct gfPcrOutput *gpoList =
     gfPcrViaNet(conn, server->seqDir, gpi,
 		maxSize, minPerfect, minGood);
 
+// translate native names to chromAuthority names
+struct gfPcrOutput *gpo;
+for(gpo = gpoList ; gpo; gpo = gpo->next)
+    {
+    char *displayChromName = cloneString(chromAliasGetDisplayChrom(server->db, cart, gpo->seqName));
+    gpo->seqName = displayChromName;
+    }
 
 if (gpoList != NULL)
     {
     char urlFormat[2048];
     safef(urlFormat, sizeof(urlFormat), "%s?%s&db=%s&position=%%s:%%d-%%d"
 	  "&hgPcrResult=pack", 
 	  hgTracksName(), cartSidUrlString(cart), server->db);
     printf("<TT><PRE>");
     gfPcrOutputWriteAll(gpoList, "fa", urlFormat, "stdout");
     printf("</PRE></TT>");
     
     printHelpLinks(gpoList);
     writePcrResultTrack(gpoList, server->db, NULL, appendToResults);
     }
 else
@@ -755,30 +763,31 @@
 
 void dispatch()
 /* Look at input variables and figure out which page to show. */
 {
 char *db, *organism;
 int maxSize = 4000;
 int minPerfect = 15;
 int minGood = 15;
 char *fPrimer = cartUsualString(cart, "wp_f", "");
 char *rPrimer = cartUsualString(cart, "wp_r", "");
 boolean flipReverse = cartUsualBoolean(cart, "wp_flipReverse", FALSE);
 boolean appendToResults = cartUsualBoolean(cart, "wp_append", TRUE);
 struct pcrServer *serverList = getServerList();
 
 getDbAndGenome(cart, &db, &organism, oldVars);
+chromAliasSetup(db);
 
 /* Get variables. */
 maxSize = cartUsualInt(cart, "wp_size", maxSize);
 minPerfect = cartUsualInt(cart, "wp_perfect", minPerfect);
 minGood = cartUsualInt(cart, "wp_good", minGood);
 if (minPerfect < 15)
      minPerfect = 15;
 if (minGood < minPerfect)
      minGood = minPerfect;
 
 /* Decide based on transient variables what page to put up. 
  * By default put up get primer page. */
 if (isNotEmpty(fPrimer) && isNotEmpty(rPrimer) &&
 	!cartVarExists(cart, "wp_showPage"))
     {