ggpLayerGroupOutline.Rd
Highlights groups of barcode-spots by encircling them.
Depending on the plot_type
this can be added to a surface plot
or a dimensional reduction plot.
ggpLayerGroupOutline(
object,
grouping,
group_subset = NULL,
plot_type = "surface",
line_alpha = 1,
line_color = "black",
line_size = 1,
line_type = "solid",
alpha = 0,
fill = NA,
incl_edge = FALSE,
merdge_edge = FALSE,
incr_vert = FALSE,
bcsp_rm = character(0),
outlier_rm = TRUE,
eps = recDbscanEps(object),
minPts = recDbscanMinPts(object),
concavity = NULL,
expand_outline = 0,
...
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character value. The grouping variable of interest. Use
getGroupingOptions()
to obtain all valid input options.
Character value or NULL
. If character,
specifies the exact groups that are outlined. If NULL
, all groups
are encircled.
Character value. Either 'surface' or the name of a conducted dimensional reduction.
Numeric. Affects alpha of main lines of the plot.
Character. Affects color of the main lines of the plot.
Numeric. Affects size of the main lines of the plot.
Character. The line type. One of 'blank', 'solid', 'dashed', 'dotted', 'dotdash', 'longdash' and 'twodash'.
Logical. If TRUE
, include tissue section outline. See examples of getTissueOutlineDf()
.
Logical value. If TRUE
, the number of vertices of the polygon
to be plotted is increased by linear interpolation. This can lead to smoother
visualization but also to increased runtime.
Character vector or NULL.
If character, specifies barcode-spots that
are removed before analysis or plotting. (Deprecated in favor of bcs_rm
).
Logical. If TRUE
, spatial outlier of the group to outline
are removed from the outline via dbscan::dbscan(..., minPts = minPts
). Ignored
if plot_type
is not 'surface'.
Distance measure. Given to eps
of dbscan::dbscan()
. Determines
the size (radius) of the epsilon neighborhood.
Numeric value. Given to argument concavity
of
concaveman::concaveman()
. Determines the relative measure of concavity.
1 results in a relatively detailed shape, Infinity results in a convex hull.
You can use values lower than 1, but they can produce pretty crazy shapes.
Distance measure with which to expand the outline. Must be provided in pixel units!
Additional arguments given to ggforce::geom_polygon()
. Affects
the encircling.
ggpLayer*()
-functions return lists of ggproto
objects
that can be added to ggplots via the +
operator. In most of the cases
they are supposed to be added to plots created with the plotSurface*()
family.
library(SPATA2)
library(tidyverse)
data("example_data")
object <- loadExampleObject("UKF275T", meta = TRUE)
plotSurface(object, color_by = "bayes_space") +
ggpLayerGroupOutline(object, grouping = "bayes_space", group_subset = c("B1", "B2"))