Define the colormap when coloring points in a DotPlot based on their assigned multiple row/column selection.
Arguments
- x
An ExperimentColorMap object.
- levels
Character vector containing the available levels of a
ColorBy
column derived from a series of multiple selections, usually generated bymultiSelectionToFactor
on the selection information inrow_selected
orcol_selected
.
Details
The "unselected"
level is always assigned the grey color;
colors for all other levels are generated by colDataColorMap(x)
or rowDataColorMap(x)
.
The "active"
level is always assigned the first color from these functions, regardless of whether it is present in levels
.
This aims to provide some consistency in the coloring when the selections change.
Examples
ecm <- ExperimentColorMap()
columnSelectionColorMap(ecm, c("active", "unselected"))
#> active unselected
#> "#F8766D" "grey"
columnSelectionColorMap(ecm, c("active", "saved1", "unselected"))
#> active saved1 unselected
#> "#F8766D" "#00BFC4" "grey"
columnSelectionColorMap(ecm, c("saved1", "unselected"))
#> active saved1 unselected
#> "#F8766D" "#00BFC4" "grey"
columnSelectionColorMap(ecm, c("saved1"))
#> active saved1 unselected
#> "#F8766D" "#00BFC4" "grey"