493af97abf810db9f4e3158710eef4822b8be56b
kate
  Mon Aug 31 20:26:30 2020 -0700
Show count of items filtered on lolly track. refs #23413

diff --git src/hg/hgTracks/lollyTrack.c src/hg/hgTracks/lollyTrack.c
index 61fecad..924520c 100644
--- src/hg/hgTracks/lollyTrack.c
+++ src/hg/hgTracks/lollyTrack.c
@@ -233,37 +233,41 @@
 char *mouseOverField = cartOrTdbString(cart, tg->tdb, "mouseOverField", NULL);
 int mouseOverIdx = bbExtraFieldIndex(bbi, mouseOverField) ;
 
 char *mouseOverPattern = NULL;
 char **fieldNames = NULL;
 if (!mouseOverIdx)
     {
     mouseOverPattern = cartOrTdbString(cart, tg->tdb, "mouseOver", NULL);
     AllocArray(fieldNames, bbi->fieldCount);
     struct slName *field = NULL, *fields = bbFieldNames(bbi);
     int i =  0;
     for (field = fields; field != NULL; field = field->next)
         fieldNames[i++] = field->name;
     }
                     
+int filtered = 0;
 for (bb = bbList; bb != NULL; bb = bb->next)
     {
     bigBedIntervalToRow(bb, chromName, startBuf, endBuf, bedRow, ArraySize(bedRow));
 
     // throw away items that don't pass the filters
     if (!bigBedFilterInterval(bedRow, filters))
+        {
+        filtered++;
         continue;
+        }
 
     // clip out lollies that aren't in our display range
     double val = atof(bedRow[lollyField - 1]);
     if (!((lollyCart->autoScale == wiggleScaleAuto) ||  ((val >= lollyCart->minY) && (val <= lollyCart->maxY) )))
         continue;
 
     // don't draw lollies off the screen
     if (atoi(bedRow[1]) < winStart)
         continue;
 
     AllocVar(pop);
     slAddHead(&popList, pop);
     pop->val = val;
     pop->start = atoi(bedRow[1]);
     pop->end = atoi(bedRow[2]);
@@ -279,30 +283,32 @@
     pop->mouseOver = pop->name;
     extern char* restField(struct bigBedInterval *bb, int fieldIdx) ;
     if (mouseOverIdx > 0)
         pop->mouseOver   = restField(bb, mouseOverIdx);
     else if (mouseOverPattern)
         pop->mouseOver = replaceFieldInPattern(mouseOverPattern, bbi->fieldCount, fieldNames, bedRow);
 
     if (bbi->fieldCount > 8)
         pop->color = itemRgbColumn(bedRow[8]);
     count++;
     if (val > maxVal)
         maxVal = val;
     if (val < minVal)
         minVal = val;
     }
+if (filtered)
+   labelTrackAsFilteredNumber(tg, filtered);
 
 if (count == 0)
     lollyCart->upperLimit = lollyCart->lowerLimit = NAN; // no lollies in range
 else if (lollyCart->autoScale == wiggleScaleAuto)
     {
     lollyCart->upperLimit = maxVal;
     lollyCart->lowerLimit = minVal;
     }
 
 double range = lollyCart->upperLimit - lollyCart->lowerLimit;
 int fontHeight = tl.fontHeight+1;
 double usableHeight = trackHeight - LOLLY_DIAMETER - fontHeight; 
 for(pop = popList; pop; pop = pop->next)
     {
     if (pop->radius == -1)