do_DotPlot | R Documentation |
This function is a wrapper for DotPlot. It provides most of its functionalities while adding extra. You can
do_DotPlot(
sample,
features,
assay = NULL,
group.by = NULL,
scale = FALSE,
legend.title = NULL,
legend.type = "colorbar",
legend.position = "bottom",
legend.framewidth = 0.5,
legend.tickwidth = 0.5,
legend.length = 20,
legend.width = 1,
legend.framecolor = "grey50",
legend.tickcolor = "white",
colors.use = NULL,
dot.scale = 6,
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
xlab = NULL,
ylab = NULL,
font.size = 14,
font.type = "sans",
cluster = FALSE,
flip = FALSE,
axis.text.x.angle = 45,
scale.by = "size",
use_viridis = FALSE,
viridis.palette = "G",
viridis.direction = -1,
sequential.palette = "YlGnBu",
sequential.direction = 1,
na.value = "grey75",
dot_border = TRUE,
plot.grid = TRUE,
grid.color = "grey75",
grid.type = "dashed",
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 |
|
features |
|
assay |
|
group.by |
|
scale |
|
legend.title |
|
legend.type |
|
legend.position |
|
legend.framewidth, legend.tickwidth |
|
legend.length, legend.width |
|
legend.framecolor |
|
legend.tickcolor |
|
colors.use |
|
dot.scale |
|
plot.title, plot.subtitle, plot.caption |
|
xlab, ylab |
|
font.size |
|
font.type |
|
cluster |
|
flip |
|
axis.text.x.angle |
|
scale.by |
|
use_viridis |
|
viridis.palette |
|
viridis.direction |
|
sequential.palette |
|
sequential.direction |
|
na.value |
|
dot_border |
|
plot.grid |
|
grid.color |
|
grid.type |
|
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 containing a Dot Plot.
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_DotPlot", passive = TRUE)
if (isTRUE(value)){
# Define your Seurat object.
sample <- readRDS(system.file("extdata/seurat_dataset_example.rds", package = "SCpubr"))
# Basic Dot plot.
p <- SCpubr::do_DotPlot(sample = sample,
features = "EPC1")
# Querying multiple features.
genes <- rownames(sample)[1:14]
p <- SCpubr::do_DotPlot(sample = sample,
features = genes)
# Inverting the axes.
p <- SCpubr::do_DotPlot(sample = sample,
features = genes,
cluster = TRUE,
plot.title = "Clustered",
flip = TRUE)
# Modifying default colors.
# Two colors to generate a gradient.
p <- SCpubr::do_DotPlot(sample = sample,
features = genes,
colors.use = c("#001219", "#e9d8a6"))
# Querying multiple features as a named list - splitting by each item in list.
# Genes have to be unique.
genes <- list("Naive CD4+ T" = rownames(sample)[1:2],
"EPC1+ Mono" = rownames(sample)[3:4],
"Memory CD4+" = rownames(sample)[5],
"B" = rownames(sample)[6],
"CD8+ T" = rownames(sample)[7],
"FCGR3A+ Mono" = rownames(sample)[8:9],
"NK" = rownames(sample)[10:11],
"DC" = rownames(sample)[12:13],
"Platelet" = rownames(sample)[14])
p <- SCpubr::do_DotPlot(sample = sample,
features = genes)
# Clustering the identities.
p <- SCpubr::do_DotPlot(sample = sample,
features = genes,
cluster = TRUE,
plot.title = "Clustered")
} 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.