Skip to contents

Each category of a categorical field with its cells, the cells shown in the active view, its colour and whether it is shown.

Usage

cellucid_field_categories(viewer, field)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

field

A field by name: source "obs" for a column of the cells, "var" for a gene; key is the name as shown. A named list. Required.

source

"obs" for a column of the cells, "var" for a gene. One of "obs", "var". Required.

Value

A cellucid_action_request, at once and invisibly: the action is sent now, or when the viewer's channel opens. cellucid_action_result(request) returns what it read: a list of categories, field, missing (Open cells without a category), view (The view the colours and shown counts are of (the selected one), named as actions name views ("View N")). Cells in it are original positions (0-based rows of the dataset's obs).

Details

The viewer's action field.categories (Dataset). It reads, and changes nothing: it makes no step of the history.

See also

cellucid_act() sends any action by its type, and cellucid_action_result() collects its answer.

Examples

if (interactive() && requireNamespace("SeuratObject", quietly = TRUE)) {
  data("pbmc_small", package = "SeuratObject")
  viewer <- cellucid_view(SeuratObject::UpdateSeuratObject(pbmc_small))
  request <- cellucid_field_categories(viewer, field = list(key = "cell_type",
      source = "obs"))
  print(request)
  # cellucid_action_result(request) waits for what it read.
  cellucid_stop(viewer)
}