View source: R/do_ViolinPlot.R
do_ViolinPlot | R Documentation |
Wrapper for VlnPlot.
do_ViolinPlot(
sample,
features,
assay = NULL,
slot = NULL,
group.by = NULL,
split.by = NULL,
colors.use = NULL,
pt.size = 0,
line_width = 0.5,
y_cut = rep(NA, length(features)),
plot_boxplot = TRUE,
boxplot_width = 0.2,
legend.position = "bottom",
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
xlab = rep(NA, length(features)),
ylab = rep(NA, length(features)),
font.size = 14,
font.type = "sans",
axis.text.x.angle = 45,
plot.grid = TRUE,
grid.color = "grey75",
grid.type = "dashed",
flip = FALSE,
ncol = NULL,
share.y.lims = FALSE,
legend.title = NULL,
legend.title.position = "top",
legend.ncol = NULL,
legend.nrow = NULL,
legend.byrow = FALSE,
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 |
|
features |
|
assay |
|
slot |
|
group.by |
|
split.by |
|
colors.use |
|
pt.size |
|
line_width |
|
y_cut |
|
plot_boxplot |
|
boxplot_width |
|
legend.position |
|
plot.title, plot.subtitle, plot.caption |
|
xlab, ylab |
|
font.size |
|
font.type |
|
axis.text.x.angle |
|
plot.grid |
|
grid.color |
|
grid.type |
|
flip |
|
ncol |
|
share.y.lims |
|
legend.title |
|
legend.title.position |
|
legend.ncol |
|
legend.nrow |
|
legend.byrow |
|
plot.title.face, plot.subtitle.face, plot.caption.face, axis.title.face, axis.text.face, legend.title.face, legend.text.face |
|
A ggplot2 object containing a Violin Plot.
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_ViolinPlot", 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"))
# Basic violin plot.
p <- SCpubr::do_ViolinPlot(sample = sample,
feature = "nCount_RNA")
p
# Remove the box plots.
p <- SCpubr::do_ViolinPlot(sample = sample,
feature = "nCount_RNA",
plot_boxplot = FALSE)
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.