plot_dot_attr3: Create scatter plot of three attributes

Description Usage Arguments Details Value

Description

Creates the X-Y-Z scatter plot of three numeric attributes of a lineage or division tree.

Usage

1
2
3
4
plot_dot_attr3(tree, treeT = c("LT", "DT"), attr1, unit1 = "", attr2,
  unit2 = "", attr3, unit3 = "", attrC = "", unitC = "", NC = NULL,
  attrS = "", sizeL = 0.8, save = FALSE, savePars = list(w = 2500, h =
  2000, res = 350, path = getwd(), name = "my_dot_attr3"))

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

attr1, attr2, attr3

The names of the attributes in the tree, character strings. Each one can be any numeric attribute, as returned from get_attr_names, except for "colony", "generation" and "frame".

unit1, unit2, unit3

The units of the corresponding attr, character strings. Each one 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 of each is the empty character "", which implies that the corresponding attr is in arbitrary units.

attrC

The name of the attribute in the tree by which the cells will be colored, a character string. It can be any numeric or boolean attribute, as returned from get_attr_names. Coloring is applied to all depicted cells, except for cells with NA value in this attribute which are colored gray. When the default value "" (the empty character) is used, data points' color is the default.

unitC

The unit of attrC, 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 attrC is in arbitrary units. This argument is ignored in case attrC = "".

NC

Number of colonies in the movie (if attrC = "colony") or number of generations in the movie (if attrC = "generation"), a non-zero positive integer value. This argument is ignored in case attrC != "colony" and attrC != "generation".

attrS

The name of the attribute in the tree by which the cells will be shaped, a character string. It can be any boolean attribute, as returned from get_attr_names. Cells are represented by dots or squares if their value in this attribute is TRUE or FALSE, respectively. When the default value "" (the empty character) is used, data points' shape is the default.

sizeL

Size of explanatory legends, a non-zero positive numeric value. The default value is 0.8. This argument is ignored in case attrC = "" or attrC is a boolean attribute or attrC = "colony" or attrC = "generation".

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

Details

Each data point (x,y,z) represents the value of attr1, attr2 and attr3 of a cell, respectively. The horizontal axis of the plot corresponds to the x-axis, the vertical to the z-axis and the diagonal to the y-axis. The scatter plot is created for all cells that are included in the analysis, as returned from get_cells, except for cells with NA value in attr1 or attr2 or attr3.

By default, all data points are purple dot points.

The linear regression plane is also drawn on the plot. X, Y are the predictor variables and Z is the response. The parameters of the regression plane are found using the linear least squares method provided by lm.

Value

A named list with the following components:

Ncells

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

regression

A named list with the following components:

  • a1 is the slope of the regression plane in the direction of x, a numeric value

  • a2 is the slope of the regression plane in the direction of y, a numeric value

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

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

In case less than 3 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.