View source: R/do_AlluvialPlot.R
do_AlluvialPlot | R Documentation |
This function is based on the ggalluvial package. It allows you to generate alluvial plots from a given Seurat object.
do_AlluvialPlot(
sample,
first_group,
last_group,
middle_groups = NULL,
colors.use = NULL,
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
font.size = 14,
font.type = "sans",
xlab = NULL,
ylab = "Number of cells",
repel = FALSE,
fill.by = last_group,
use_labels = FALSE,
stratum.color = "black",
stratum.fill = "white",
stratum.width = 1/3,
stratum.fill.conditional = FALSE,
use_geom_flow = FALSE,
alluvium.color = "white",
flow.color = "white",
flip = FALSE,
label.color = "black",
curve_type = "sigmoid",
use_viridis = FALSE,
viridis.palette = "G",
viridis.direction = -1,
sequential.palette = "YlGnBu",
sequential.direction = 1,
plot.grid = FALSE,
grid.color = "grey75",
grid.type = "dashed",
na.value = "white",
legend.position = "right",
legend.title = NULL,
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 |
|
first_group |
|
last_group |
|
middle_groups |
|
colors.use |
|
plot.title , plot.subtitle , plot.caption |
|
font.size |
|
font.type |
|
xlab , ylab |
|
repel |
|
fill.by |
|
use_labels |
|
stratum.color , alluvium.color , flow.color |
|
stratum.fill |
|
stratum.width |
|
stratum.fill.conditional |
|
use_geom_flow |
|
flip |
|
label.color |
|
curve_type |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
plot.grid |
|
grid.color |
|
grid.type |
|
na.value |
|
legend.position |
|
legend.title |
|
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_AlluvialPlot", passive = TRUE)
message(value)
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 basic sankey plot.
p <- SCpubr::do_AlluvialPlot(sample = sample,
first_group = "orig.ident",
last_group = "seurat_clusters")
} 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.