Check what works between R and an open Cellucid viewer
cellucid_debug_connection.RdThe report cellucid-python's AnnDataViewer.debug_connection() gives,
for a viewer of this R session: whether the server answers its routes,
whether the store is read with byte ranges, and whether the viewer's
channel (a WebSocket) carries a command and its answer. It is the first
thing to look at when a viewer stays blank or does not react, for example
behind a proxy that does not pass WebSockets.
Arguments
- viewer
A viewer
cellucid_view()orcellucid_serve()returned.- timeout
Seconds to wait for each answer.
Value
A list: viewer_id, viewer_url, server_url,
server_running, channel_connected, web_ui (the web
build's folder, and whether it is served), state (the viewer's
ready event and its last command_error); the server's own
server_health, server_info and server_datasets documents
(or server_health_error and so on); anndata_store_probe, the
store's HEAD answer (status, Content-Length,
Accept-Ranges, ETag) and its first byte asked with
Range; and frontend_roundtrip and
frontend_debug_snapshot, each list(ok, answer) or
list(ok = FALSE, error): a ping answered by a pong, and
the viewer's own view of its address, origin and connection.
Details
The server is asked over HTTP from this R session, through R's event loop,
which is where it answers; nothing leaves the machine. Without an open
channel the two frontend_ entries say so instead of waiting.
Examples
if (interactive() && requireNamespace("SeuratObject", quietly = TRUE)) {
data("pbmc_small", package = "SeuratObject")
viewer <- cellucid_view(SeuratObject::UpdateSeuratObject(pbmc_small))
str(cellucid_debug_connection(viewer))
cellucid_stop(viewer)
}