Launch GateLabR with the canonical GateLab React interface
Source:R/launch_react.R
launchReactGateLab.RdStarts the shared GateLab TypeScript/React application with a thin Shiny
adapter for a SingleCellExperiment. This is the interface started by
launchGatingApp, which is the single supported entry point.
Usage
launchReactGateLab(
sce = NULL,
sample_column = NULL,
port = NULL,
launch.browser = TRUE,
sce_name = NULL,
agent = NULL,
blocking = NULL
)Arguments
- sce
A
SingleCellExperiment, or a flowWorkspaceGatingSet, which is served from the object itself: its samples with thepData()columns as metadata, each sample's values read from its cytoframe as the app asks for them and put back to linear through the channel's inverse transform, and the hierarchy it holds opened as the app's gates, each in the transformed space the object evaluates it in. The app's axes take the object's transforms (a logicle as the object's own, an arcsinh at its cofactor). The workspace is kept as the keywordGATELAB_WORKSPACEon every sample's cytoframe, whichsave_gs()keeps, and "Save to GatingSet" writes every population of the tree back to the hierarchy in place: as a flowWorkspace gate where the space allows (a rectangle under any transforms; a polygon or ellipse when the app's space is the object's) and as the exact per-sample membership otherwise. IfNULL, the first SCE in the global environment is used, else the first GatingSet.- sample_column
Optional
colDatacolumn defining samples. When omitted, common sample columns such assample_idare detected.- port
Port for Shiny. By default the app is served on one port from session to session (
getOption("gatelabr.port", 4283)), because the browser keeps what the app remembers on its own account (the language, the gate edge mode, snapping) per address, and a port chosen afresh in each R session loses it. When that port is in use, for instance by a second GateLabR session, Shiny chooses one and a message says so.options(gatelabr.port = FALSE)always leaves the choice to Shiny.- launch.browser
Whether to open a browser window (default:
TRUE).- sce_name
Optional name of the global-environment variable that gates, populations and
colDataare written back to. Defaults to the symbol the caller passed assce. Delegating wrappers must forward the user's symbol explicitly, becausesubstitute()would otherwise resolve to the wrapper's own parameter name.- agent
Open the tab connected to an agent's relay:
TRUEreads the address the relay recorded in~/.gatelab/agent-relay.json, or give thews://address itself. The agent then reads the gating as you see it and proposes gates, which appear in the tab with a badge; saving stays yours.NULL(the default) opens the tab as usual; the Agent menu in the header can connect it later.- blocking
Whether the call returns only when the app stops.
NULL(the default) returns at once when the installed Shiny can run an app in the background (shiny::startApp(), Shiny 1.14 and later) and otherwise blocks as before, saying so.FALSEinsists on returning at once and is an error with an older Shiny;TRUEblocks.
Value
Invisibly the running app's handle when the call returns at once (its
$stop() stops the app, as does gatelabStop), otherwise
invisibly NULL once the app has stopped. The app is serviced while R
is idle at the prompt, so a long computation pauses it until the prompt
returns. While it runs, the console may change the object it was launched
on: the app then refuses to save over that change until
gatelabSync hands it the console's object. When the app
stops with no population memberships stored in the object, or with
memberships older than the workspace, a warning says so: the readers
(gatelabPopulations, gatelabHierarchy) need an
explicit "Save to SCE", which autosaves do not replace.