a582c17ed7b4049895cdfa148458173dae6f6cdc
max
  Wed Nov 6 07:31:59 2024 -0800
Revert "forgot closing parentheses in previous commit"

This reverts commit 5d977ca7c6fef8eaa84f3289bffa3405bf4e0209.

diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 940949e..914d456 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -1874,32 +1874,30 @@
         {
 	slAddHead(&oldList, el);
 	}
     }
 slReverse(&newList);
 if (color)
    {
    slReverse(&oldList);
    /* Draw stuff that passes filter first in full mode, last in dense. */
    if (vis == tvDense)
        newList = slCat(oldList, newList);
    else
        newList = slCat(newList, oldList);
    }
 tg->items = newList;
-
-filterItemsOnNames(tg);
 }
 
 int getFilterColor(char *type, int colorIx)
 /* Get color corresponding to type - MG_RED for "red" etc. */
 {
 if (sameString(type, "red"))
     colorIx = MG_RED;
 else if (sameString(type, "green"))
     colorIx = MG_GREEN;
 else if (sameString(type, "blue"))
     colorIx = MG_BLUE;
 return colorIx;
 }
 
 struct track *trackNew()
@@ -5299,31 +5297,30 @@
 color = colorFromCart(tg, color);
 
 if (tg->items == NULL && vis == tvDense && canDrawBigBedDense(tg))
     {
     bigBedDrawDense(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color);
     }
 else
     {
     if (vis == tvDense && tg->colorShades)
 	slSort(&tg->items, cmpLfWhiteToBlack);
     genericDrawItems(tg, seqStart, seqEnd, hvg, xOff, yOff, width,
 	    font, color, vis);
     }
 
 // put up the color key for the gnomAD pLI track
-// make sure to adapt hgTracks.js:hideTracks if you change this (when a track is hidden, the legend is removed by the javascript)
 if (startsWith("pliBy", tg->track))
     doPliColors = TRUE;
 }
 
 void incRange(UBYTE *start, int size)
 /* Add one to range of bytes, taking care to not overflow. */
 {
 int i;
 UBYTE b;
 for (i=0; i<size; ++i)
     {
     b = start[i];
     if (b < 254)
 	start[i] = b+2;
     }
@@ -6922,30 +6919,32 @@
 char *bigGenePred = trackDbSetting(tdb, "bigGeneDataUrl");
 struct udcFile *file;
 boolean isBigGenePred = FALSE;
 
 if ((bigGenePred != NULL) && ((file = udcFileMayOpen(bigGenePred, udcDefaultDir())) != NULL))
     {
     isBigGenePred = TRUE;
     udcFileClose(&file);
     loadKnownBigGenePred(tg, isGencode);
     }
 else if (!isGencode)
     loadGenePredWithName2(tg);
 else
     loadKnownGencode(tg);
 
+filterItemsOnNames(tg);
+
 char varName[SMALLBUF];
 safef(varName, sizeof(varName), "%s.show.noncoding", tdb->track);
 boolean showNoncoding = cartUsualBoolean(cart, varName, TRUE);
 safef(varName, sizeof(varName), "%s.show.spliceVariants", tdb->track);
 boolean showSpliceVariants = cartUsualBoolean(cart, varName, TRUE);
 if (!showNoncoding)
     tg->items = stripShortLinkedFeatures(tg->items);
 if (!showSpliceVariants)
     {
     if (isBigGenePred)
         {
         tg->items = stripLinkedFeaturesWithoutBitInScore(tg->items,  BIT_CANON);
         }
     else
         {