plot_viobox_attr: Create violin plot or boxplot for an attribute

Description Usage Arguments Details Value

Description

Creates the violin plot or boxplot of a numeric attribute of a lineage or division tree. The plot can be created for each colony or generation or for the whole population.

Usage

1
2
3
4
plot_viobox_attr(tree, treeT = c("LT", "DT"), attr, unit = "",
  grouped = c("col", "gen", "pop"), groups = -1, Ngroups, type = c("vio",
  "box"), save = FALSE, savePars = list(w = 2500, h = 2000, res = 300, path
  = getwd(), name = "my_viobox_attr"))

Arguments

tree

The lineage or division tree, an object of class "igraph".

treeT

A character string naming the type of tree:

  • "LT" if tree is a lineage tree

  • "DT" if tree is a division tree

attr

The name of the attribute in the tree, a character string. It can be any numeric attribute, as returned from get_attr_names, except for "colony", "generation" and "frame".

unit

The unit of attr, a character string. It should be in the format "<string>,<number>", where ",<number>" represents the power and is optional (e.g. "m" for meters and "cm,3" for cubic centimeters). The default value is the empty character "", which implies that attr is in arbitrary units.

grouped

A character string naming the grouping method:

  • "col" for grouping by colony

  • "gen" for grouping by generation

  • "pop" for no grouping (whole population)

groups

The IDs of the groups for which to create the violin plot or boxplot, a vector of positive integer values. This argument is ignored in case grouped = "pop". The default value -1 stands for all existing groups in the tree.

Ngroups

Number of colonies in the movie (if grouped = "col") or number of generations in the movie (if grouped = "gen"), a non-zero positive integer value. This argument is ignored in case grouped = "pop".

type

A character string naming the type of the plot to be created:

  • "vio" for violin plot. The black dot represents the median.

  • "box" for boxplot. The black dots represent the outliers (i.e. datapoints out of the 1st/3rd quantile).

save

A logical value (TRUE or FALSE) indicating whether the generated plot will be saved in a .png file or displayed in the Plots Pane of RStudio, respectively. The default value is FALSE.

savePars

A named list specifying the parameters of the generated image file. This argument is ignored in case save = FALSE. Elements of the list are the following:

w

The width of the image file in pixels, a non-zero positive integer value. The default value is 2500.

h

The height of the image file in pixels, a non-zero positive integer value. The default value is 2000.

res

The resolution of the image file in pixels per inch (ppi), a non-zero positive integer value. The smaller this value, the larger the plot area in inches, and the smaller the text relative to the graph itself. The default value is 300.

path

A character string naming the directory where the image file will be saved (excluding the last "/"). If it does not contain an absolute path, the image file will be saved relative to the current working directory getwd(). The default value is the current working directory getwd().

NOTE: The components should be separated by "/" on Windows.

name

The image file name, a character string. The suffix ".png" is added automatically. The default value is "my_viobox_attr".

Details

A common plot for all groups specified in groups is generated. Each violin plot or boxplot is created considering all cells that are included in the analysis, as returned from get_cells, except for cells with NA value in attr.

Color denotes the corresponding group.

Value

A dataframe with the following columns:

  1. group is the ID of the group (a positive integer value) or -2 in case grouped = "pop".

  2. Ncells is the number of cells, a positive integer value.

For groups with Ncells < 3, no plot is generated. In case no cells exist, no plot is generated and NULL is returned.


vicstefanou/ViSCA documentation built on May 31, 2019, 10:50 p.m.