5dc1d6e658ab009f27314e192340275a6bb70237 max Tue Jun 2 16:20:48 2026 -0700 Add colorFields trackDb setting for bigBed/bigGenePred color scheme switching Adds a new trackDb statement `colorFields` that renders a "Color by:" dropdown in the track controls page, letting users switch among multiple pre-computed color schemes stored as extra bigBed fields containing R,G,B strings. The `default="label"` key renames the standard itemRgb option in the dropdown. Other entries name extra bigBed fields whose R,G,B values override itemRgb when selected. When a non-default scheme is active, a "(Coloring by: label)" suffix appears in the track long label. Changes: - hui.c/hui.h: new colorFieldsCfgUi() rendered inside bedScoreCfgUi() for bigBed - bigBedTrack.c: colorFieldIdx lookup + per-item filterColor override + longLabel suffix - tagTypes.tab: register colorFields for bigBed and bigGenePred - trackDbLibrary.shtml, trackDbDoc.html, trackDbHub.v3.html, changes.html: documentation refs #26253 Co-Authored-By: Claude Sonnet 4.6 diff --git src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml index 1dac1d8f38d..7946fe831a2 100644 --- src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml +++ src/hg/htdocs/goldenPath/help/trackDb/trackDbLibrary.shtml @@ -2139,30 +2139,69 @@ into a table, this field appears as an integer with the RGB values in specific bits of the integer. To observe this field, specify the type as, type bigBed 9, or, type bigBed 9+, for additional non-standard columns, in the trackDb stanza for the bigBed file.

Note that the display of color is affected by the maxItems option. When the track is zoomed to the point that the number of items to display exceeds maxItems, the track is forced into dense mode and the items are drawn from the bigBed summary in the default track color rather than using the itemRgb column.

Example:

   itemRgb on
+
+
+ colorFields default="<label>" <fieldName1>="<label1>" <fieldName2>="<label2>" ... +
+

+ Enables a Color by: dropdown in the track controls that lets the user switch + among multiple pre-computed color schemes without leaving the track display. +

+

+ Each entry is a fieldName="Human Label" pair. The field name must be an + extra bigBed field (defined in the track's .as file) that contains a + pre-computed R,G,B color string — the same format as the standard + itemRgb field. The label in double + quotes is shown in the dropdown; if omitted, a label is derived automatically by + stripping a leading colorBy prefix and replacing underscores with spaces. +

+

+ The special name default (with an optional label) represents the track's + existing itemRgb field (column 9) and is placed first in the dropdown. + When no default= entry is given, an unlabeled "Default" option + is added automatically. +

+

+ Item coloring must be active for colorFields to work. It is active by + default on bigBed tracks with more than 9 fields; it is suppressed only if the track has + an explicit color setting or itemRgb off. The currently + selected scheme is stored in the cart variable <trackName>.colorField. + When a non-default scheme is active, the track long label gains a + (Coloring by: <label>) suffix. +

+

Example:

+
+    colorFields default="Kozak strength" colorByEvidence="Evidence type" colorByHlaClass="HLA class"
+    
+

This creates a three-option dropdown. colorByEvidence and + colorByHlaClass must be extra fields in the bigBed whose values are + R,G,B strings.

+
+
maxItems <integer>

Maximum number of items to display individually in full or pack or squish mode. When the maximum is exceeded, the track switches to coverage mode. Default: 1000. For type bigBed tracks, this setting can never be larger than the hg.conf setting bigBedMaxItems, which by default is 100,000 at UCSC.

bigBedMaxItems is configured globally for a Genome Browser server and sets an upper limit on how many features can be loaded at most from a bigBed file, to avoid a single track making a Genome Browser view unusable at high zoom levels so it the upper limit for all maxItems settings of any tracks shown on a Genome Browser. If you have feedback on these values, please do not hesitate to contact us.

Example: