This function is a wrapper for DotPlot. It provides most of its functionalities while adding extra. You can
do_DotPlot(
sample,
features,
assay = NULL,
slot = "data",
group.by = NULL,
split.by = NULL,
zscore.data = FALSE,
min.cutoff = NA,
max.cutoff = NA,
dot.min = 5,
enforce_symmetry = ifelse(base::isTRUE(zscore.data), TRUE, 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",
legend.ncol = NULL,
legend.nrow = NULL,
legend.byrow = FALSE,
dot.scale = 8,
plot.title = NULL,
plot.subtitle = NULL,
plot.caption = NULL,
xlab = NULL,
ylab = NULL,
font.size = 14,
font.type = "sans",
cluster.identities = FALSE,
cluster.features = FALSE,
flip = FALSE,
axis.text.x.angle = 45,
use_viridis = FALSE,
viridis.palette = "G",
viridis.direction = -1,
sequential.palette = "YlGnBu",
sequential.direction = 1,
diverging.palette = "RdBu",
diverging.direction = -1,
na.value = "grey75",
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"
)A ggplot2 object containing a Dot Plot.
Seurat | A Seurat object, generated by CreateSeuratObject.
character | Features to represent.
character | Assay to use. Defaults to the current assay.
character | Data slot to use. Only one of: counts, data, scale.data. Defaults to "data".
character | Metadata variable to group the output by. Has to be a character of factor column.
character | Secondary metadata variable to further group (split) the output by. Has to be a character of factor column.
logical | Whether to compute Z-scores instead of showing average expression values. This allows to see, for each gene, which group has the highest average expression, but prevents you from comparing values across genes. Can not be used with slot = "scale.data" or with split.by.
numeric | Set the min/max ends of the color scale. Any cell/group with a value lower than min.cutoff will turn into min.cutoff and any cell with a value higher than max.cutoff will turn into max.cutoff. In FeaturePlots, provide as many values as features. Use NAs to skip a feature.
numeric | Ranges from 0 to 100. Filter out dots whose Percent Expressed falls below this threshold.
logical | Return a symmetrical plot axes-wise or continuous color scale-wise, when applicable.
character | Title for the legend.
character | Type of legend to display. One of:
normal: Default legend displayed by ggplot2.
colorbar: Redefined colorbar legend, using guide_colorbar.
character | Position of the legend in the plot. One of:
top: Top of the figure.
bottom: Bottom of the figure.
left: Left of the figure.
right: Right of the figure.
none: No legend is displayed.
numeric | Width of the lines of the box in the legend.
numeric | Length and width of the legend. Will adjust automatically depending on legend side.
character | Color of the lines of the box in the legend.
character | Color of the ticks of the box in the legend.
numeric | Number of columns in the legend.
numeric | Number of rows in the legend.
logical | Whether the legend is filled by row or not.
numeric | Scale the size of the dots.
character | Title, subtitle or caption to use in the plot.
character | Titles for the X and Y axis.
numeric | Overall font size of the plot. All plot elements will have a size relationship with this font size.
character | Base font family for the plot. One of:
mono: Mono spaced font.
serif: Serif font family.
sans: Default font family.
logical | Whether to cluster the identities (groups) based on the expression of the features.
logical | Whether to cluster the features (genes) based on their expression across identities.
logical | Whether to invert the axis of the displayed plot.
numeric | Degree to rotate the X labels. One of: 0, 45, 90.
logical | Whether to use viridis color scales.
character | A capital letter from A to H or the scale name as in scale_fill_viridis.
numeric | Either 1 or -1. Controls how the gradient of viridis scale is formed.
character | Type of sequential color palette to use. Out of the sequential palettes defined in brewer.pal.
numeric | Direction of the sequential color scale. Either 1 or -1.
character | Type of symmetrical color palette to use. Out of the diverging palettes defined in brewer.pal.
numeric | Either 1 or -1. Direction of the divering palette. This basically flips the two ends.
character | Color value for NA.
logical | Whether to plot grid lines.
character | Color of the grid in the plot. In heatmaps, color of the border of the cells.
character | One of the possible linetype options:
blank.
solid.
dashed.
dotted.
dotdash.
longdash.
twodash.
numeric | Controls the number of breaks in continuous color scales of ggplot2-based plots.
character | Controls the style of the font for the corresponding theme element. One of:
plain: For normal text.
italic: For text in itallic.
bold: For text in bold.
bold.italic: For text both in itallic and bold.
# \donttest{
# Check Suggests.
value <- SCpubr:::check_suggests(function_name = "do_DotPlot", 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 Dot plot.
# genes <- rownames(sample)[1:14]
# p <- SCpubr::do_DotPlot(sample = sample,
# features = genes)
} 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()`.")
}
# }
Run the code above in your browser using DataLab