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
)

Arguments

scdata

single-cell data. can be seurat/summarizedexperiment object

celltype_key

column name holding the celltype for each cell

genes

genes you want to plot

splitby_key

column name in the metadata/coldata table to split the spots by. If not provided, it will plot via celltype_key provided.

pct.threshold

float. required to keep gene expressed by minimum percentage of cells

scale

logical. scale the expression to mean +/- SD. NULL defaults to TRUE.

standard_scale

logical. scale the expression to range from 0 to 1. NULL defaults to FALSE.

keepLevels

logical. keep the original factor of the levels of the celltype_key (for plotting)

save.plot

logical. will try to save the pdf

h

height of plot

w

width of plot

filepath

path to file, or path to folder

filename

path to file

heat_cols

colour gradient for the dot plot

col_limits

set limits to the color gradient

outline_col

colour of outlines if fill = TRUE

outline_size

stroke size of outlines if fill = TRUE

Value

ggplot dot plot object of selected genes

Examples

# \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"
# }