Skip to contents

Plot the cell counts normalized by volume for a given channel

Usage

plot_normalized_counts(
  e,
  channels = c("cfos", "eyfp", "colabel"),
  by = c("sex", "group"),
  values = list(c("female", "non"), c("female", "agg"), c("female", "control"),
    c("male", "agg"), c("male", "control")),
  colors = c("white", "lightblue", "black", "red", "green"),
  ontology = "allen",
  title = NULL,
  unit_label = bquote(`Cell counts `("cells/mm"^3)),
  anatomical.order = c("Isocortex", "OLF", "HPF", "CTXsp", "CNU", "TH", "HY", "MB",
    "HB", "CB"),
  height = 7,
  width = 20,
  region_label_angle = 50,
  label_text_size = 8,
  print_plot = TRUE,
  save_plot = TRUE,
  flip_axis = FALSE,
  legend.justification = c(0, 0),
  legend.position = "inside",
  legend.position.inside = c(0.05, 0.6),
  legend.direction = "vertical",
  limits = c(0, 1e+05),
  facet_background_color = NULL,
  image_ext = ".pdf"
)

Arguments

e

experiment object

channels

(str, default = c("cfos", "eyfp", "colabel"))

by

(str) Attribute names to group by, e.g. c("sex", "group")

values

(list) A list with a length the number of groups desired for plotting. Each element of the list is a vector in the order of the the respective values for the attributes entered for the by parameter to generate a specific analysis group. Each vector should be unique to generate a uniquely colored bar. e.g.values = c("female", "AD").

colors

(str, default = c("white", "lightblue")) Hexadecimal codes corresponding to the groups (respectively) to plot. The length of this vector should be the length of the list.

ontology

(str, default = "allen") Region ontology to use. options = "allen" or "unified"

title

(str, default = NULL) An optional title for the plot

unit_label

(str, default = bquote('Cell counts '('cells/mm'^3))) Default unit label for the graphs

anatomical.order

(default = c("Isocortex", "OLF", "HPF", "CTXsp", "CNU","TH", "HY", "MB", "HB", "CB")) Default way to group subregions into super regions order

height

height of the plot in inches.

width

width of the plot in inches.

region_label_angle

(int, default = 50) Angle of the region label.

label_text_size

(int, default = 8) Size of the text element for the region labels.

print_plot

(bool, default = TRUE) Whether to display the plot (in addition to saving the plot)

save_plot

(bool, default = TRUE) Save into the figures subdirectory of the experiment object output folder.

flip_axis

plot cell counts on x-axis rather than y-axis.

legend.direction

The exact acronyms used will be ontology dependent so make sure that these match the ontology parameter

limits

(c(0,100000)) Range of the normalized cell counts.

facet_background_color

(default = NULL) Set to a hexadecimal string, e.g."#FFFFFF", when you want to shade the background of the graph. Defaults to no background when NULL.

image_ext

(default = ".png") image extension to the plot as.

Value

p_list A list the same length as the number of channels, with each element containing a plot handle for that channel.