plotBarchart: Plot distribution of discrete variables

Description Usage Arguments

View source: R/plot-family-statistics.R

Description

Visualizes the count or the proportion of barcode spots falling into certain groups via barcharts. It does so either for the whole sample or in a comparing manner if across is specified.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
plotBarchart(
  object,
  variables,
  phase = "all",
  across = NULL,
  across_subset = NULL,
  relevel = TRUE,
  clrp = "milo",
  clrp_adjust = NULL,
  position = "fill",
  display_facets = TRUE,
  ncol = NULL,
  nrow = NULL,
  ...
)

Arguments

object

A valid cell tracer object.

variables

Character vector. The discrete features whose group count or proportion you want to display. Must not contain the feature specified in across - if across is not set to NULL.

phase

Character value. Refers to the phase of the experiment. Valid inputs are:

'before_tmt'

Uses the data that refers to the time before the treatment.

'first_tmt'

Uses the data that refers tot the time after the treatment.

Note: This argument is ignored if the experiment set up did not include any treatment or the treatment started right from the beginning.

across

Character value or NULL. Specifies the grouping variable of interest.

Use getGroupingOptions() to obtain all variable names that group the cells of your experiment in a certain manner.

across_subset

Character vector or NULL. Specifies the particular groups of interest the grouping variable specified in argument across contains.

If set to NULL all of them are chosen. You can prefix groups you are NOT interested in with a '-'. (Saves writing if there are more groups you are interested in than groups you are not interested in.)

Use getGroupNames() to obtain all valid input options.

relevel

Logical value. If set to TRUE the input order of across_subset determines the order in which the groups of interest are displayed. Groups that are not included are dropped which affects the colors with which they are displayed.

clrp

Character value. Specifies the color palette to be used to represent groups of discrete variables. Run validColorPalettes() to obtain valid input options.

clrp_adjust

Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group.

display_facets

Logical value. If set to TRUE the plot is split via ggplot2::facet_wrap() such that each variable gets it's own subplot.

ncol

Given to ggplot2::facet_wrap(). Affects the way the subplots are displayed.

nrow

Given to ggplot2::facet_wrap(). Affects the way the subplots are displayed.

...

Additional arguments given to the respective ggplot2::geom_<plot_type>() function. E.g. plotViolinplot() relies on ggplot2::geom_violin().


kueckelj/celltracer documentation built on June 2, 2021, 6:37 a.m.