spatialAnnotationToGrouping | R Documentation |
Converts one or more spatial annotations to a binary segmentation variable in the feature data.frame.
spatialAnnotationToGrouping(
object,
ids,
grouping_name,
inside = "inside",
outside = "outside",
overwrite = FALSE
)
object |
An object of class |
ids |
Character vector. Specifies the spatial annotation(s) of interest.
data points that fall into the area of these annotations are labeled
with the input for argument |
grouping_name |
Character value. The name of the new segmentation variable. |
inside |
Character value. The group name for the data points that are located inside the area of the spatial annotation(s). |
outside |
Character value. The group name for the data points that are located outside the area of the spatial annotation(s). |
overwrite |
Logical. Set to TRUE to overwrite existing variables with the same name. |
The updated input object, containing the added, removed or computed results.
library(SPATA2)
library(patchwork)
data("example_data")
object <- example_data$object_UKF313T_diet
ids <- getSpatAnnIds(object, tags = c("necrotic", "compr"), test = "all")
plotSpatialAnnotations(object, ids = ids)
object <-
spatialAnnotationToGrouping(
object = object,
ids = ids,
grouping_name = "histology",
inside = "necrotic",
outside = "vivid"
)
plotSurface(object, color_by = "histology", clrp_adjust = c("necrotic" = "black", "vivid" = "forest_green"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.