Skip to contents

Define the colormap when coloring points in a DotPlot based on their assigned multiple row/column selection.

Usage

columnSelectionColorMap(x, levels)

rowSelectionColorMap(x, levels)

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 by multiSelectionToFactor on the selection information in row_selected or col_selected.

Value

A named character vector of colors for each level in levels.

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.

Author

Aaron Lun

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"