plotSpatialTrajectories | R Documentation |
Displays the spatial course of spatial trajectory that was
drawn with createSpatialTrajectories()
on a surface plot.
Increase the transparency via argument pt_alpha
to highlight
the trajectory's course.
plotSpatialTrajectories(
object,
ids = NULL,
color_by = NULL,
alpha_by = NULL,
method_gs = NULL,
smooth = NULL,
smooth_span = NULL,
width = NULL,
pt_size = NULL,
pt_alpha = 0.5,
pt_alpha2 = 0.9,
pt_clr = NULL,
pt_clrp = NULL,
clrp_adjust = NULL,
pt_clrsp = NULL,
sgmt_clr = NULL,
sgmt_size = NULL,
display_facets = FALSE,
display_image = NULL,
display_title = NULL,
uniform_genes = NULL,
arrow = ggplot2::arrow(length = ggplot2::unit(x = 0.125, "inches")),
nrow = NULL,
ncol = NULL,
xrange = getCoordsRange(object)[["x"]],
yrange = getCoordsRange(object)[["y"]],
verbose = NULL,
...
)
object |
An object of class |
color_by |
Character value. The variables by which to color the data points. |
method_gs |
Character value. The method according to which gene sets will be handled specified as a character of length one. This can be either 'mean or one of 'gsva', 'ssgsea', 'zscore', or 'plage'. The latter four will be given to gsva::GSVA(). |
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_size |
Numeric value. Specifies the size of all points. |
pt_alpha |
Numeric value. Specifies the degree of transparency of all points. |
pt_alpha2 |
Numeric value. Specifies the transparency of the spots that fall into the trajectory's reach. |
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 |
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. |
pt_clrsp |
The color spectrum to be used if the specified variable displayed by
color is continuous. Run |
sgmt_size |
The size of the segment arrrow specified as a numeric value. |
display_facets |
Logical value. If set to TRUE the plot is split via
|
display_image |
Logical. If set to TRUE the histology image of the specified sample is displayed underneath the plot. |
display_title |
Logical value. If set to TRUE an informative title is displayed. |
uniform_genes |
Character value. If set to 'discard' genes that are uniformly expressed across all barcode-spots of the specified coordinates data.frame are discarded. If set to 'keep' they are kept. |
nrow , ncol |
Numeric values or NULL. Used to arrange multiple plots. |
xrange , yrange |
Distance vector of length
two or |
verbose |
Logical. If (Warning messages will always be printed.) |
... |
Used to absorb deprecated arguments or functions. |
Returns a ggplot that can be additionally customized according to the rules of the ggplot2 framework.
library(SPATA2)
data("example_data")
object <- example_data$object_UKF269T_diet
plotSpatialTrajectories(object, color_by = "histology", pt_clrp = "npg", ids = "horizontal_mid")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.