do_RidgePlot | R Documentation |
This function computes ridge plots based on the ggridges package.
do_RidgePlot(
sample,
feature,
group.by = NULL,
split.by = NULL,
assay = "SCT",
slot = "data",
continuous_scale = FALSE,
legend.title = NULL,
legend.ncol = NULL,
legend.nrow = NULL,
legend.byrow = FALSE,
legend.position = NULL,
legend.width = 1,
legend.length = 20,
legend.framewidth = 0.5,
legend.tickwidth = 0.5,
legend.framecolor = "grey50",
legend.tickcolor = "white",
legend.type = "colorbar",
colors.use = NULL,
font.size = 14,
font.type = "sans",
axis.text.x.angle = 45,
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
xlab = NULL,
ylab = NULL,
compute_quantiles = FALSE,
compute_custom_quantiles = FALSE,
quantiles = c(0.25, 0.5, 0.75),
compute_distribution_tails = FALSE,
prob_tails = 0.025,
color_by_probabilities = FALSE,
use_viridis = TRUE,
viridis.palette = "G",
viridis.direction = 1,
sequential.palette = "YlGnBu",
sequential.direction = 1,
plot.grid = TRUE,
grid.color = "grey75",
grid.type = "dashed",
flip = FALSE,
number.breaks = 5,
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"
)
sample |
|
feature |
|
group.by |
|
split.by |
|
assay |
|
slot |
|
continuous_scale |
|
legend.title |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
legend.position |
|
legend.length, legend.width |
|
legend.framewidth, legend.tickwidth |
|
legend.framecolor |
|
legend.tickcolor |
|
legend.type |
|
colors.use |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
plot.title, plot.subtitle, plot.caption |
|
xlab, ylab |
|
compute_quantiles |
|
compute_custom_quantiles |
|
quantiles |
|
compute_distribution_tails |
|
prob_tails |
|
color_by_probabilities |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
plot.grid |
|
grid.color |
|
grid.type |
|
flip |
|
number.breaks |
|
plot.title.face, plot.subtitle.face, plot.caption.face, axis.title.face, axis.text.face, legend.title.face, legend.text.face |
|
A ggplot2 object.
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_RidgePlot", 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"))
# Compute the most basic ridge plot.
p <- SCpubr::do_RidgePlot(sample = sample,
feature = "nFeature_RNA")
p
# Use continuous color scale.
p <- SCpubr::do_RidgePlot(sample = sample,
feature = "nFeature_RNA",
continuous_scale = TRUE,
viridis.direction = 1)
p
# Draw quantiles of the distribution.
p <- SCpubr::do_RidgePlot(sample = sample,
feature = "nFeature_RNA",
continuous_scale = TRUE,
compute_quantiles = TRUE,
compute_custom_quantiles = TRUE)
p
# Draw probability tails.
p <- SCpubr::do_RidgePlot(sample = sample,
feature = "nFeature_RNA",
continuous_scale = TRUE,
compute_quantiles = TRUE,
compute_distribution_tails = TRUE)
p
# Draw probability tails.
p <- SCpubr::do_RidgePlot(sample = sample,
feature = "nFeature_RNA",
continuous_scale = TRUE,
compute_quantiles = TRUE,
color_by_probabilities = TRUE)
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()`.")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.