Plot of median genes per cell per sample grouped by desired meta data variable.
Plot_Median_Genes(
seurat_object,
sample_col = "orig.ident",
group_by = NULL,
colors_use = NULL,
dot_size = 1,
plot_title = "Median Genes/Cell per Sample",
y_axis_label = "Median Genes",
x_axis_label = NULL,
legend_title = NULL,
x_lab_rotate = TRUE,
color_seed = 123
)
Seurat object name.
Specify which column in meta.data specifies sample ID (i.e. orig.ident).
Column in meta.data slot to group results by (i.e. "Treatment").
List of colors or color palette to use. Only applicable if group_by
is not NULL.
size of the dots plotted if group_by
is not NULL. Default is 1.
Plot title.
Label for y axis.
Label for x axis.
Label for plot legend.
logical. Whether to rotate the axes labels on the x-axis. Default is FALSE.
random seed for the "varibow" palette shuffle if colors_use = NULL
and number of
groups plotted is greater than 36. Default = 123.
A ggplot object
library(Seurat)
# Create example groups
pbmc_small$sample_id <- sample(c("sample1", "sample2"), size = ncol(pbmc_small), replace = TRUE)
# Plot
Plot_Median_Genes(seurat_object = pbmc_small, sample_col = "orig.ident", group_by = "sample_id")
#> Bin width defaults to 1/30 of the range of the data. Pick better value with
#> `binwidth`.