plotSurface | R Documentation |
Displays the spatial dimension of the sample and colors the surface according to the expression of genes, gene sets or features. There are methods for multiple classes:
SPATA2
: The most versatile method with which all sorts of spatial
data can be visualized.
data.frame
: Method for a data.frame that contains at least the
variables x and y.
SpatialAnnotationScreening
: Method to visualize the surface based
on the setup with which spatialAnnotationScreening()
was run.
SpatialTrajectoryScreening
: Method to visualize the surface based
on the setup with which spatialAnnotationScreening()
was run.
plotSurface(object, ...)
## S4 method for signature 'SPATA2'
plotSurface(
object,
color_by = NULL,
alpha_by = NULL,
smooth = FALSE,
smooth_span = 0.2,
pt_alpha = NULL,
pt_clr = NULL,
pt_clrp = NULL,
pt_clrsp = NULL,
pt_size = NULL,
outline = FALSE,
outline_fct = c(2.125, 2.75),
clrp_adjust = NULL,
transform_with = NULL,
use_scattermore = NULL,
sctm_pixels = c(1024, 1024),
bcs_rm = base::character(0),
na_rm = FALSE,
xrange = getCoordsRange(object)$x,
yrange = getCoordsRange(object)$y,
display_image = NULL,
img_alpha = 1,
img_name = NULL,
geom = "point",
mtr_name = activeMatrix(object),
verbose = NULL,
...
)
## S4 method for signature 'data.frame'
plotSurface(
object,
color_by = NULL,
alpha_by = NULL,
pt_alpha = 0.9,
pt_clr = "lightgrey",
pt_clrp = "milo",
pt_clrsp = "inferno",
pt_size = 2,
image = NULL,
clrp_adjust = NULL,
use_scattermore = FALSE,
sctm_pixels = c(1024, 1024),
sctm_interpolate = FALSE,
outline = FALSE,
outline_coords = NULL,
outline_fct = c(2.125, 2.75),
order_by = NULL,
order_desc = FALSE,
na_rm = TRUE,
...
)
## S4 method for signature 'SpatialAnnotationScreening'
plotSurface(
object,
color_by = "rel_loc",
line_color = "black",
line_size = 1,
fill = ggplot2::alpha("lightgrey", 0.25),
pt_clrp = "npg",
...
)
## S4 method for signature 'SpatialGradientScreening'
plotSurface(
object,
color_by = "rel_loc",
line_color = "black",
line_size = 1,
pt_clrp = "npg",
...
)
plotSurfaceInteractive(object)
object |
An object of class |
... |
Additional arguments given to |
color_by |
Character value. The variables by which to color the data points. |
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 |
pt_alpha |
Numeric value. Specifies the degree of transparency of all points. |
pt_clr |
Character value. Specifies the color of all points. |
pt_clrp |
The color palette to be used if the specified variable displayed by
color is categorical/discrete. Run |
pt_clrsp |
The color spectrum to be used if the specified variable displayed by
color is continuous. Run |
pt_size |
Numeric value. Specifies the size of all points. |
outline |
Logical, indicating whether to add an outline to the points.
If |
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. |
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 |
use_scattermore |
Logical value. If |
bcs_rm |
Character vector or |
xrange , yrange |
Distance vector of length
two or |
img_alpha |
Numeric value. Sets the transparency for the image. |
img_name |
Character value. The name of the image of interest.
If |
mtr_name |
Character value. The name of the matrix of interest. Defaults
to the active matrix of the assay, as denoted by |
verbose |
Logical. If (Warning messages will always be printed.) |
sctm_interpolate , sctm_pixels |
Given to the corresponding arguments
of |
order_by |
Character value or |
order_desc |
Logical value. If |
line_color |
Character. Affects color of the main lines of the plot. |
line_size |
Numeric. Affects size of the main lines of the plot. |
fill |
Character value or NA. If character, specifies the color with which the outline of the spatial annotation is filled. |
outline_width |
Numeric vector of length 2, specifying the factor with which
the |
Returns a ggplot that can be additionally customized according to the rules of the ggplot2 framework.
The methods for SpatialAnnotationScreening
- and SpatialTrajectoryScreening
exist to quickly visualize the set up with which the screening was conducted. The ...
can be used to reach the plotSurface()
method for data.frames with all its
plotting parameters. For more controll, please use a combination of plotSurface()
with the
SPATA2
object and ggpLayer*
functions.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.