do_GeyserPlot {SCpubr} | R Documentation |
Generate a Geyser plot.
Description
A Geyser plot is a custom plot in which we plot continuous values on the Y axis grouped by a categorical value in the X. This is plotted as a dot plot, jittered so that the dots span all the way to the other groups. On top of this, the mean and .66 and .95 of the data is plotted, depicting the overall distribution of the dots. The cells can, then, be colored by a continuous variable (same as Y axis or different) or a categorical one (same as X axis or different).
Usage
do_GeyserPlot(
sample,
features,
assay = NULL,
slot = "data",
group.by = NULL,
split.by = NULL,
enforce_symmetry = FALSE,
scale_type = "continuous",
order = TRUE,
plot_cell_borders = TRUE,
jitter = 0.45,
pt.size = 1,
border.size = 2,
border.color = "black",
legend.position = "bottom",
legend.width = 1,
legend.length = 20,
legend.framewidth = 0.5,
legend.tickwidth = 0.5,
legend.framecolor = "grey50",
legend.tickcolor = "white",
legend.type = "colorbar",
font.size = 14,
font.type = "sans",
axis.text.x.angle = 45,
viridis.palette = "G",
viridis.direction = 1,
colors.use = NULL,
na.value = "grey75",
legend.ncol = NULL,
legend.nrow = NULL,
legend.icon.size = 4,
legend.byrow = FALSE,
legend.title = NULL,
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
xlab = "Groups",
ylab = feature,
flip = FALSE,
min.cutoff = rep(NA, length(features)),
max.cutoff = rep(NA, length(features)),
number.breaks = 5,
diverging.palette = "RdBu",
diverging.direction = -1,
sequential.palette = "YlGnBu",
sequential.direction = -1,
use_viridis = TRUE,
plot.title.face = "bold",
plot.subtitle.face = "plain",
plot.caption.face = "italic",
axis.title.face = "bold",
axis.text.face = "plain",
legend.title.face = "bold",
legend.text.face = "plain"
)
Arguments
sample |
|
features |
|
assay |
|
slot |
|
group.by |
|
split.by |
|
enforce_symmetry |
|
scale_type |
|
order |
|
plot_cell_borders |
|
jitter |
|
pt.size |
|
border.size |
|
border.color |
|
legend.position |
|
legend.length , legend.width |
|
legend.framewidth , legend.tickwidth |
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
viridis.palette |
|
viridis.direction |
|
colors.use |
|
na.value |
|
legend.ncol |
|
legend.nrow |
|
legend.icon.size |
|
legend.byrow |
|
legend.title |
|
plot.title , plot.subtitle , plot.caption |
|
xlab , ylab |
|
flip |
|
min.cutoff , max.cutoff |
|
number.breaks |
|
diverging.palette |
|
diverging.direction |
|
sequential.palette |
|
sequential.direction |
|
use_viridis |
|
plot.title.face , plot.subtitle.face , plot.caption.face , axis.title.face , axis.text.face , legend.title.face , legend.text.face |
|
Details
Special thanks to Christina Blume for coming up with the name of the plot.
Value
Either a plot of a list of plots, depending on the number of features provided.
Examples
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_GeyserPlot", passive = TRUE)
if (isTRUE(value)){
# Consult the full documentation in https://enblacar.github.io/SCpubr-book/
# Define your Seurat object.
sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))
# Geyser plot with categorical color scale.
p <- SCpubr::do_GeyserPlot(sample = sample,
features = "nCount_RNA",
scale_type = "categorical")
p
# Geyser plot with continuous color scale.
p <- SCpubr::do_GeyserPlot(sample = sample,
features = "nCount_RNA",
scale_type = "continuous")
p
} else if (base::isFALSE(value)){
message("This function can not be used without its suggested packages.")
message("Check out which ones are needed using `SCpubr::state_dependencies()`.")
}