plot_dot_time_attr: Create dot plot of an attribute by time

Description Usage Arguments Details Value

Description

Creates the dot plot of a numeric attribute of a lineage or division tree by time.

Usage

1
2
3
plot_dot_time_attr(tree, treeT = c("LT", "DT"), attr, unit = "",
  Nbins = 20, save = FALSE, savePars = list(w = 2500, h = 2000, res = 350,
  path = getwd(), name = "my_dot_time_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. In case treeT = "LT", it can be any numeric attribute, as returned from get_attr_names, except for "colony", "generation" and "frame". In case treeT = "DT", it can be any numeric attribute, as returned from get_attr_names, having the suffix "_birth" or "_division".

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.

Nbins

Number of equally spaced bins to be used for attr, a non-zero positive integer value >=2. This value is indicative and may change automatically depending on the values of attr, producing a warning message. The default value is 20.

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 350.

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_dot_time_attr".

Details

Each data point (x,y) represents the time in frames and the value of attr of a cell, respectively. The dot plot is created for all cells that are included in the analysis, as returned from get_cells, except for cells with NA value in attr.

Data points are dot points colored based on the density of the Y variable value at every time point x. Binning is applied on the range of all attr values. Density represents the counts (number of data points) in each bin at every time point x. Ultimately, the plot is a color representation of the histogram of attr in time.

Value

A named list with the following components:

Ncells

Number of cells, a non-zero positive integer value.

r

The Pearson correlation coefficient (a numeric value in the range [-1, 1]) or NA in case less than 2 unique data points exist.

regression

A named list with the following components:

  • a is the slope of the regression line, a numeric value

  • b is the y-intercept of the regression line, a numeric value

  • r2 is the R-squared coefficient of the regression line as returned from summary.lm, a numeric value in the range [0, 1]

In case less than 2 unique data points exist, NULL is returned, instead.

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.