Skip to contents

The labels suggested for the categories of a field by the community annotation of the dataset shown (its connected GitHub repository), with their votes, the person's own vote and each category's consensus, as the voting dialog and the legend show them; whether the field is open for voting, and when this browser last pulled. One page holds what fits a tool result; next starts the following one.

Usage

cellucid_annotation_suggestions(viewer, field, category, cursor)

Arguments

viewer

A viewer cellucid_view() or cellucid_serve() returned.

field

A categorical column of the cells by name (source "obs"). A named list. Required.

source

Categories belong to columns of the cells. Exactly "obs". Required.

category

One category; every category of the field when left out. Text (at least 1 character). Left out unless given (the viewer then chooses as its own control does).

cursor

Where the page starts: the next of the last page; the first page when left out. A whole number (at least 0). Left out unless given (the viewer then chooses as its own control does).

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 annotated (The field is open to community annotation), categories, closed (Voting on the field is closed (only its authors still vote)), next (The cursor of the next page; null on the last), pulled_at (When this browser last pulled from it (an ISO instant), null before the first Pull: votes made since are not here), repository (The GitHub repository it is kept in), repository_field (The field's name in the repository, when the person renamed it here), total_categories (Categories on every page). Cells in it are original positions (0-based rows of the dataset's obs).

Details

The viewer's action annotation.suggestions (Community annotation). 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_annotation_suggestions(viewer,
      field = list(key = "cell_type", source = "obs"))
  print(request)
  # cellucid_action_result(request) waits for what it read.
  cellucid_stop(viewer)
}