eb9441d7f6347f6b9ed58aeae694c75ec7b3eb61
galt
  Thu Aug 28 17:03:18 2025 -0700
Improve the column names for single cell output using combined facets and matrix, changed column count to cell count, column val to read count. Also updated the 4 html files with improved notations about those columns, and corrected note about expCount field. Added a new tag for trackDb singleCellColumnNames off to support old default column names. fixes #34628

diff --git src/hg/lib/barChartUi.c src/hg/lib/barChartUi.c
index 82df6211074..d5899209c6c 100644
--- src/hg/lib/barChartUi.c
+++ src/hg/lib/barChartUi.c
@@ -477,37 +477,47 @@
     char *requiredStatsFields[] = {"count",};
     struct fieldedTable *table = fieldedTableFromTabFile(statsFile, statsFile, 
         requiredStatsFields, ArraySize(requiredStatsFields));
 
     /* Update facet selections from users input if any and get selected part of table */
     struct facetedTable *facTab = facetedTableFromTable(table, tdb->track, facets);
     facTab->mergeFacetsOk = trackDbSettingOn(tdb, "barChartMerge");
     facetedTableUpdateOnClick(facTab, cart);
     struct facetField **selectedFf = NULL;
     struct fieldedTable *selected = facetedTableSelect(facTab, cart, &selectedFf);
 
     /* Add wrapper function(s) */
     struct hash *wrapperHash = hashNew(0);
     hashAdd(wrapperHash, "color", wrapColor);
 
+    boolean singleCell = !trackDbSettingOff(tdb, "singleCellColumnNames");
+    if (singleCell)
+	{
+	if (sameString(selected->fields[1], "count"))
+	    selected->fields[1] = cloneString("cell count");
+        }
+
     /* Pick which fields to display.  We'll take the first field whatever it is
      * named, color if possible, and also count, and any faceted fields. */
     struct dyString *displayList = dyStringNew(0);
     int colorIx = fieldedTableFindFieldIx(selected, "color");
     if (colorIx >= 0)
        dyStringPrintf(displayList, "color,");
     dyStringAppend(displayList, selected->fields[0]);
+    if (singleCell)
+	dyStringPrintf(displayList, ",cell count");
+    else
 	dyStringPrintf(displayList, ",count");
     struct slName *facetNameList = slNameListFromComma(facets);
     struct slName *facetName;
     for (facetName = facetNameList; facetName != NULL; facetName = facetName->next)
         {
         if (fieldedTableFindFieldIx(selected, facetName->name))
            dyStringPrintf(displayList, ",%s", facetName->name);
         }
 
     /* Put up facets and table */
     facetedTableWriteHtml(facTab, cart, selected, selectedFf, displayList->string,
         returnUrl->string, 40, wrapperHash, NULL, 7);
 
     /* Clean up and go home. */
     facetedTableFree(&facTab);