plotExprVsDistSA.Rd
Generates a scatterplot to visualize the relationship between gene expression and
the distance of data points to a spatial reference. Set line_alpha
> 0 to visualize the
inferred expression pattern used for spatial gradient screening.
plotExprVsDistSA(
object,
variables,
ids = idSA(object),
distance = "dte",
resolution = recSgsRes(object),
core = FALSE,
pt_alpha = 0.1,
pt_color = "black",
pt_clrp = NULL,
pt_size = 1.5,
line_alpha = 0,
line_color = "forestgreen",
line_size = 1.75,
border_linealpha = 1,
border_linecolor = "black",
border_linesize = 1,
border_linetype = "solid",
ee_linealpha = 0,
ee_linecolor = "black",
ee_lineend = "point",
ee_linesize = 1,
ee_linetype = "solid",
se_fill = ggplot2::alpha("lightgrey", 0.5),
unit = getDefaultUnit(object),
ggpLayers = NULL,
ncol = NULL,
nrow = NULL,
...
)
plotExprVsDistST(
object,
variables,
id = idST(object),
resolution = recSgsRes(object),
width = NULL,
pt_alpha = 0.5,
pt_color = "black",
pt_clrp = NULL,
pt_size = 1.5,
line_alpha = 0.9,
line_color = "forestgreen",
line_size = 1,
unit = getDefaultUnit(object),
ggpLayers = NULL,
ncol = NULL,
nrow = NULL,
...
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Character vector. All numeric variables hat are supposed to be plotted.
Character vector. Specifies the IDs of the spatial annotations of interest.
A numeric vector of distances to the annotation's edge.
Distance measure. The resolution
with which the expression gradient is inferred. Defaults are platform specific.
See more in detail section of recSgsRes()
.
Numeric value. Specifies the degree of transparency of all points.
The color palette to be used if the specified variable displayed by
color is categorical/discrete. Run validColorPalettes()
to see valid input.
Numeric value. Specifies the size of all points.
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.
The fill color for the smoothing line's standard error area (default: "lightgrey").
Character value. Specifies the desired unit in
which distance measures
or area measures are provided.
Run validUnitsOfLength()
or validUnitsOfArea()
for valid
input options.
List of ggproto
-objects that are added to each plot.
Skim ggpLayer*()
-functions for more options.
Numeric values or NULL. Used to arrange multiple plots.
Used to absorb deprecated arguments or functions.
Character value. The ID of the spatial trajectory.
A ggplot.
library(SPATA2)
library(tidyverse)
data("example_data")
object <- example_data$object_UKF275T_diet
object <- normalizeCounts(object, activate = TRUE)
object <-
createNumericAnnotations(
object = object,
variable = "HM_HYPOXIA",
threshold = "kmeans_high",
id = "hypoxia_ann",
inner_borders = FALSE,
force1 = TRUE
)
plotExprVsDistSA(object, variables = c("HM_HYPOXIA", "METRN"), ids = "hypoxia_ann", core = T)