e0db353cfefb9bde9cce31d6a2c2d2762dc1de4a
kate
  Wed Sep 12 17:19:14 2018 -0700
IMplement fieldName> expansion in trackDb url setting. refs #22078

diff --git src/hg/hgc/bigBedClick.c src/hg/hgc/bigBedClick.c
index c07211a..9a4986cb 100644
--- src/hg/hgc/bigBedClick.c
+++ src/hg/hgc/bigBedClick.c
@@ -337,31 +337,30 @@
 if (start == end)
     {
     // item is an insertion; expand the search range from 0 bases to 2 so we catch it:
     ivStart = max(0, start-1);
     ivEnd++;
     }
 struct bigBedInterval *bbList = bigBedIntervalQuery(bbi, chrom, ivStart, ivEnd, 0, lm);
 
 /* Get bedSize if it's not already defined. */
 if (bedSize == 0)
     {
     bedSize = bbi->definedFieldCount;
     showUrl = TRUE;
     }
 
-
 char *scoreFilter = cartOrTdbString(cart, tdb, "scoreFilter", NULL);
 int minScore = 0;
 if (scoreFilter)
     minScore = atoi(scoreFilter);
 
 /* Find particular item in list - matching start, and item if possible. */
 boolean found = FALSE;
 boolean firstTime = TRUE;
 struct bigBedInterval *bb;
 for (bb = bbList; bb != NULL; bb = bb->next)
     {
     if (!(bb->start == start && bb->end == end))
 	continue;
     if (bedSize > 3)
 	{
@@ -399,64 +398,58 @@
 
     // display seq1 and seq2
     if (seq1Seq2 && bedSize+seq1Seq2Fields == 8)
         printf("<table><tr><th>Sequence 1</th><th>Sequence 2</th></tr>"
 	       "<tr><td> %s </td><td> %s </td></tr></table>", fields[6], fields[7]);
     else if (isNotEmpty(rest))
 	{
 	char *restFields[256];
 	int restCount = chopTabs(rest, restFields);
 	int restBedFields = bedSize - 3;
 	if (restCount > restBedFields)
 	    {
             char **extraFields = (restFields + restBedFields);
             int extraFieldCount = restCount - restBedFields;
             int printCount = extraFieldsPrint(tdb,NULL,extraFields, extraFieldCount);
-
             struct slPair* extraFieldPairs = getExtraFields(tdb, extraFields, extraFieldCount);
             printAllExternalExtraFields(tdb, extraFieldPairs);
 
             if (printCount == 0)
                 {
                 int i;
                 char label[20];
                 safef(label, sizeof(label), "nonBedFieldsLabel");
                 printf("<B>%s&nbsp;</B>",
                        trackDbSettingOrDefault(tdb, label, "Non-BED fields:"));
                 for (i = restBedFields;  i < restCount;  i++)
                     printf("%s%s", (i > 0 ? "\t" : ""), restFields[i]);
                 printf("<BR>\n");
                 }
 	    }
 	if (sameString(tdb->type, "bigGenePred"))
 	    bigGenePredLinks(tdb->track, item);
 	}
-
-
     if (isCustomTrack(tdb->track))
 	{
 	time_t timep = bbiUpdateTime(bbi);
 	printBbiUpdateTime(&timep);
 	}
-
     }
-
 if (!found)
     {
     printf("No item %s starting at %d\n", emptyForNull(item), start);
     }
-
 lmCleanup(&lm);
 bbiFileClose(&bbi);
 }
 
 void genericBigBedClick(struct sqlConnection *conn, struct trackDb *tdb,
                      char *item, int start, int end, int bedSize)
 /* Handle click in generic bigBed track. */
 {
 char *fileName = bbiNameFromSettingOrTable(tdb, conn, tdb->table);
 bigBedClick(fileName, tdb, item, start, end, bedSize);
 }
 
 void bigBedCustomClick(struct trackDb *tdb)
 /* Display details for BigWig custom tracks. */
 {