Launch an interactive gadget for lasso-based cell selection from a spatial Seurat object. Supports Visium, SlideSeq, and Vizgen data. Returns the cell names of the selected subset, suitable for downstream subsetting or analysis.
InteractiveSpatialPlot(
object,
image = NULL,
image.scale = "lowres",
group.by = NULL,
alpha = 1,
pt.size.factor = 1,
overlay_image = TRUE
)A Seurat object with spatial data.
Name of the spatial image stored in the object. If NULL, uses the default image for the object.
Character. Which image scaling factor to use for spatial coordinate transformation ("lowres" by default).
Metadata variable (column name) to use for coloring cell points (e.g., cluster assignment). If NULL, uses "seurat_clusters" if available, otherwise all cells are grouped together.
Numeric transparency value for cell points (default 1.0).
Numeric scaling factor for point size (default 1.0).
Logical; if TRUE, overlays the tissue image in the background of the plot (default TRUE).
A character vector of cell names selected via lasso, which can be used to subset the object.
This function requires the plotly, magrittr, and base64enc packages to be installed. It also requires shiny and miniUI for the interactive UI.
if (FALSE) {
selected_cells <- InteractiveSpatialPlot(object = brain)
selected_cells <- InteractiveSpatialPlot(object = brain, overlay_image = FALSE)
}