geneDotPlot.Rd
Plotting genes as dotplot
geneDotPlot(
scdata,
celltype_key,
genes,
splitby_key = NULL,
pct.threshold = 0.05,
scale = NULL,
standard_scale = NULL,
keepLevels = TRUE,
save.plot = FALSE,
h = 5,
w = 5,
filepath = NULL,
filename = NULL,
heat_cols = NULL,
col_limits = NULL,
fill = FALSE,
outline_col = "black",
outline_size = 0.2
)
single-cell data. can be seurat/summarizedexperiment object
column name holding the celltype for each cell
genes you want to plot
column name in the metadata/coldata table to split the spots by. If not provided, it will plot via celltype_key provided.
float. required to keep gene expressed by minimum percentage of cells
logical. scale the expression to mean +/- SD. NULL defaults to TRUE.
logical. scale the expression to range from 0 to 1. NULL defaults to FALSE.
logical. keep the original factor of the levels of the celltype_key (for plotting)
logical. will try to save the pdf
height of plot
width of plot
path to file, or path to folder
path to file
colour gradient for the dot plot
set limits to the color gradient
colour of outlines if fill = TRUE
stroke size of outlines if fill = TRUE
ggplot dot plot object of selected genes
# \donttest{
data(kidneyimmune)
geneDotPlot(kidneyimmune, genes = c("CD68", "CD80", "CD86", "CD74", "CD2", "CD5"), celltype_key = "celltype", splitby_key = "Project", standard_scale = TRUE) + theme(strip.text.x = element_text(angle = 45, hjust = 0))
#> data provided is a SingleCellExperiment/SummarizedExperiment object
#> extracting expression matrix
#> attempting to subset the expression matrix to the 6 genes provided
#> found 6 genes in the expression matrix
#> preparing the final dataframe ...
#> setting minimum percentage of cells expressing gene to be 5% of cluster/cell-type
#> the following genes are removed
#> NULL
#> Error in theme(strip.text.x = element_text(angle = 45, hjust = 0)): could not find function "theme"
# }