Skip to contents

This function allows for plotting of normalized cell counts by area across specific regions to plot. Two different mouse attributes can be used as categorical variables to map to either the color or pattern aesthetics of the bar plot, e.g. sex and experimental group. The color aesthetic takes precedence over the pattern aesthetic so if you only want to use one mouse attribute, for plotting set it to the color_mapping parameter and set the pattern_mapping parameter to NULL.

Usage

plot_cell_counts(
  e,
  channel = "eyfp",
  rois = c("AAA", "dDG", "HY"),
  color_mapping = "group",
  colors = c("#952899", "#358a9c"),
  pattern_mapping = NULL,
  patterns = c("gray100", "hs_fdiagonal", "hs_horizontal", "gray90", "hs_vertical"),
  ylab = bquote(`Cell counts `("cells/mm"^3)),
  error_bar = "sem",
  ylim = c(0, 100),
  plot_individual = TRUE,
  height = 8,
  width = 8,
  print_plot = TRUE,
  save_plot = TRUE,
  image_ext = ".png"
)

Arguments

e

experiment object

channel

(str, default = "eyfp") The channel used as denominator in fraction counts.

rois

(vec, default = c("AAA", "dDG", "HY")) Allen acronyms of the ROIS that the user would like to plot

color_mapping

(str, default = "group") The variable name that maps subgroups you would like to graphically distinguish through colors.

colors

(vec, default = c("#952899", "#358a9c")) A vector of hexadecimal color codes for each subgroup distinguished by the color mapping variable.

pattern_mapping

(str, default = NULL) variable name that maps subgroups you would like to graphically distinguish through bar patterns.Set to NULL if not in use.

patterns

(default = c("gray100", 'hs_fdiagonal', "hs_horizontal", "gray90", "hs_vertical") Available patterns in ggpattern package to map to subgroups distinguished by the pattern mapping variable.

ylab

(str, default = bquote('Cell counts '('cells/mm'^3))) unit of measurement

error_bar

(str, c("sd", "sem)) options for which type of error bar to display, standard deviation or standard error of the mean.

height

(numeric) height of the plot in inches to save as.

width

(numeric) height of the plot in inches to save as.

save_plot

(book) Whether to save the plot in the experiment figures folder.

image_ext

(str, default = ".png") Extension of the output file

plot_individua

(bool) whether to plot individual points

Value

p Plot handle to the figure

Examples

plot_percentage_colabel
#> Error in eval(expr, envir, enclos): object 'plot_percentage_colabel' not found