4ae7d849e69a0c914ba43d7bb38a7491b8d0b366
galt
  Fri May 2 11:00:40 2025 -0700
minor bugfix for rm32750-hgBlat-table-all-alignments-not-available. refs #32750

diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 0c83ee861bb..35db5935b93 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -524,42 +524,48 @@
 return dy->string;
 }
 
 char *hgcPathAndSettings()
 /* Return path with this CGI script and session state variable. */
 {
 static struct dyString *dy = NULL;
 if (dy == NULL)
     {
     dy = dyStringNew(128);
     dyStringPrintf(dy, "%s?%s", hgcName(), cartSidUrlString(cart));
     }
 return dy->string;
 }
 
-void hgcAnchorSomewhere(char *group, char *item, char *other, char *chrom)
+static void hgcAnchorSomewhereExt(char *group, char *item, char *other, char *chrom, int start, int end, char *tbl)
 /* Generate an anchor that calls click processing program with item
  * and other parameters. */
 {
-char *tbl = cgiUsualString("table", cgiString("g"));
 char *itemSafe = cgiEncode(item);
 printf("<A HREF=\"%s&g=%s&i=%s&c=%s&l=%d&r=%d&o=%s&table=%s\">",
-       hgcPathAndSettings(), group, itemSafe, chrom, winStart, winEnd, other,
-       tbl);
+       hgcPathAndSettings(), group, itemSafe, chrom, start, end, other, tbl);
 freeMem(itemSafe);
 }
 
+void hgcAnchorSomewhere(char *group, char *item, char *other, char *chrom)
+/* Generate an anchor that calls click processing program with item
+ * and other parameters. */
+{
+char *tbl = cgiUsualString("table", cgiString("g"));
+hgcAnchorSomewhereExt(group, item, other, chrom, winStart, winEnd, tbl);
+}
+
 void hgcAnchorPosition(char *group, char *item)
 /* Generate an anchor that calls click processing program with item
  * and group parameters. */
 {
 char *tbl = cgiUsualString("table", cgiString("g"));
 printf("<A HREF=\"%s&g=%s&i=%s&table=%s\">",
        hgcPathAndSettings(), group, item, tbl);
 }
 
 void hgcAnchorWindow(char *group, char *item, int thisWinStart,
                      int thisWinEnd, char *other, char *chrom)
 /* Generate an anchor that calls click processing program with item
  * and other parameters, INCLUDING the ability to specify left and
  * right window positions different from the current window*/
 {
@@ -3438,42 +3444,42 @@
 
         // we're assuming that if there are multiple psl's with the same id that
         // they are the same query sequence so we only put out one set of sequences
         if (!hashLookup(seqHash, bedRow[3]) && !isEmpty(seq))    // if there is a query sequence
             {
             if (firstTime)
 		{
 		firstTime = FALSE;
 		printf("<H3>Links to sequence:</H3>\n");
 		printf("<UL>\n");
 		}
 
             if (!isEmpty(cdsStr))  // if we have CDS 
                 {
                 puts("<LI>\n");
-                hgcAnchorSomewhere("htcTranslatedBigPsl", bedRow[3], "translate", seqName);
+                hgcAnchorSomewhereExt("htcTranslatedBigPsl", bedRow[3], "translate", bedRow[0], sqlUnsigned(bedRow[1]), sqlUnsigned(bedRow[2]), tdb->track);
 		if (showEvery)
 		    printf("Translated Amino Acid Sequence</A> from Query Sequence %s\n", bedRow[3]);
 		else
 		    printf("Translated Amino Acid Sequence</A> from Query Sequence\n");
                 puts("</LI>\n");
                 }
 
 	    if (psl->qSize <= MAX_DISPLAY_QUERY_SEQ_SIZE)
 		{
 		puts("<LI>\n");
-		hgcAnchorSomewhere("htcBigPslSequence", bedRow[3], tdb->track, seqName);
+		hgcAnchorSomewhereExt("htcBigPslSequence", bedRow[3], tdb->track, bedRow[0], sqlUnsigned(bedRow[1]), sqlUnsigned(bedRow[2]), tdb->track);
 		if (showEvery)
 		    printf("Query Sequence %s</A> \n", bedRow[3]);
 		else
 		    printf("Query Sequence</A> \n");
 		puts("</LI>\n");
 		}
 
             hashAdd(seqHash, bedRow[3], "");
 	    dyStringPrintf(sequencesText, ">%s\n%s\n\n", bedRow[3], seq);
 	    ++sequencesFound;
 
             }
 	}
     if (!showEvery && !firstTime)
 	break;