Skip to contents

Read the dataset again with every cell, or with exactly count cells chosen by a subsample method; highlights, labels, views and filters are kept for the cells still open.

Usage

cellucid_cells_open(
  viewer,
  mode,
  allocation = "proportional",
  count,
  embedding,
  field,
  method = NULL,
  seed = NULL
)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

mode

One of "all", "subsample". Required.

allocation

Stratified: how the cells are split over the categories. One of "proportional", "balanced". Default "proportional", the viewer's own.

count

Subsample: how many cells. A whole number (at least 1). Left out unless given (the viewer then chooses as its own control does).

embedding

Spatial: the obsm embedding it thins. Text (at least 1 character). Left out unless given (the viewer then chooses as its own control does).

field

Stratified: the categorical column it is stratified by. Text (at least 1 character). Left out unless given (the viewer then chooses as its own control does).

method

Subsample: how the cells are chosen; null for the file's default. One of "uniform", "blocks", "stratified", "spatial", NULL. Default NULL, the viewer's own.

seed

Subsample: its seed; null for the file's. A whole number or NULL (at least 0, at most 4294967295). Default NULL, the viewer's own.

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 its outcome (what it did, as names, counts and ids), or NULL when it had nothing to report; request$step is the history step it made.

Details

The viewer's action cells.open (Data). It changes the viewer's state: one step of the viewer's history, labelled as R's, undone like any other. The state it can change: cells, mapping, field-overlays, gene-sets, views, active-field, filters, colors, visibility, highlights, camera, settings, analysis.

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_cells_open(viewer, mode = "all")
  print(request)
  # cellucid_action_result(request) waits for its outcome.
  cellucid_stop(viewer)
}