Generates violin plots, boxplots, or density plots of continuous variables in the spatial meta data or of gene expression to make comparisons across samples

distribution_plots(
  x = NULL,
  plot_meta = NULL,
  genes = NULL,
  samples = NULL,
  data_type = "tr",
  color_pal = "okabeito",
  plot_type = "violin",
  ptsize = 0.5,
  ptalpha = 0.5
)

Arguments

x

an STlist

plot_meta

vector of variables in x@spatial_meta to plot distributions. If 'total_counts', the function plots the counts per spot/cell. If 'total_genes', the function plots the number of genes per spot/cell are plotted.

genes

vector of genes to plot expression distribution

samples

samples to include in the plot. Default (NULL) includes all samples

data_type

one of 'tr' or 'raw', to plot transformed or raw counts

color_pal

a string of a color palette from khroma or RColorBrewer, or a vector with colors

plot_type

one of "violin", "box", or "density" (violin plots, box plots, or density plots respectively)

ptsize

the size of points in the plots

ptalpha

the transparency of points (violin/box plot) or curves (density plots)

Details

The function allows to visualize the distribution of spot/cell total counts, total genes, or expression of specific genes across all samples for comparative purposes.