ggpLayerPoints | R Documentation |
Adds the data points (beads, cells, spots, etc.) of the object
to the plot. This function is actually the working horse of plotSurface()
.
ggpLayerPoints(object, ...)
## S4 method for signature 'SPATA2'
ggpLayerPoints(
object,
alpha_by = NULL,
color_by = NULL,
pt_alpha = 0.9,
pt_clr = "lightgrey",
pt_size = NULL,
scale_pt_size = TRUE,
clrp = NULL,
clrp_adjust = NULL,
clrsp = NULL,
smooth = FALSE,
smooth_span = 0.2,
normalize = NULL,
transform_with = NULL,
xrange = NULL,
yrange = NULL,
outline = FALSE,
outline_fct = c(1.75, 2.75),
unit = NULL,
breaks = NULL,
expand = TRUE,
scale_fct = 1,
use_scattermore = FALSE,
sctm_pixels = c(1024, 1024),
add_labs = FALSE,
bcs_rm = NULL,
na_rm = FALSE,
geom = "point",
verbose = NULL,
...
)
## S4 method for signature 'SpatialData'
ggpLayerPoints(
object,
img_name = activeImage(object),
alpha_by = NULL,
color_by = NULL,
pt_alpha = 0.9,
pt_clr = "lightgrey",
pt_size = 1,
clrp = "sifre",
clrp_adjust = NULL,
clrsp = "inferno",
scale_pt_size = TRUE,
xrange = NULL,
yrange = NULL,
unit = NULL,
breaks = NULL,
expand = TRUE,
bcs_rm = NULL,
outline = FALSE,
outline_fct = c(1.75, 2.75),
na_rm = FALSE,
scale_fct = 1,
use_scattermore = FALSE,
sctm_pixels = c(1024, 1024),
add_labs = FALSE,
geom = "point",
...
)
## S4 method for signature 'data.frame'
ggpLayerPoints(
object,
alpha_by = NULL,
color_by = NULL,
pt_alpha = 0.9,
pt_clr = "lightgrey",
pt_size = 1,
scale_fct = 1,
use_scattermore = FALSE,
sctm_pixels = c(1024, 1024),
bcs_rm = NULL,
geom = "point",
na_rm = FALSE
)
object |
An object of class |
... |
Additional arguments given to |
color_by |
Character value. The variables by which to color the data points. |
pt_alpha |
Numeric value. Specifies the degree of transparency of all points. |
pt_clr |
Character value. Specifies the color of all points. |
pt_size |
Numeric value. Specifies the size of all points. |
clrp |
Character value. Specifies the color palette to be used to represent
groups of discrete variables. Run |
clrp_adjust |
Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group. |
clrsp |
Character value. Specifies the color spectrum to be used to represent
continuous values of numeric variables. Run |
smooth |
Logical. If TRUE, a loess fit is used to smooth the values. |
smooth_span |
Numeric value. Controls the degree of smoothing.
Given to argument |
normalize |
Logical. If set to TRUE values will be scaled to 0-1. Hint: Variables that are uniformly expressed can not be scaled and are discarded. |
transform_with |
List or
In case of plotting:
Useful if you want to apply more than one transformation on variables mapped to
plotting aesthetics. Input for |
xrange , yrange |
Distance vector of length
two or |
unit |
The desired unit. Defaults to the unit
in which the original size of the image of the spatial method is
provided. Obtain valid input options with |
breaks |
Specifies where the breaks are set. Labels are plotted in the unit
specified in
|
expand |
Specifies how the axis are expanded. Using
|
use_scattermore |
Logical value. If |
add_labs |
Logical. If |
bcs_rm |
Character vector or |
verbose |
Logical. If (Warning messages will always be printed.) |
img_name |
Character value. The name of the image of interest.
If |
spot_alpha , spot_size , spot_clr |
Parameters to set the aesthetics
alpha, size, and color of the spots. Arguments |
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")
ggplot() +
ggpLayerPoints(object, color_by = "HM_HYPOXIA")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.