plot_baranyi: Plot growth curves of cell counts

Description Usage Arguments Details Value

Description

Computes and plots the growth curves of cell counts (number of cells) in a lineage tree. The growth curve can be plotted for each colony or for the whole population. Each growth curve is computed by fitting the Baranyi and Roberts model to the corresponding data.

Usage

1
2
3
plot_baranyi(LT, DT, cols = -1, Ncols, Nframes, frameR, showRaw = FALSE,
  save = FALSE, savePars = list(w = 3000, h = 2000, res = 300, path =
  getwd(), name = "my_baranyi"))

Arguments

LT

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

DT

The corresponding division tree of the LT, an object of class "igraph".

cols

The IDs of the colonies for which to fit the Baranyi and Roberts model, a vector of non-zero positive integer values. The default value -1 stands for all existing colonies in the LT. Use value -2 for fitting the model to the whole population.

Ncols

Number of colonies in the movie, a non-zero positive integer value. This argument is ignored in case cols = -2.

Nframes

Number of frames in the movie, a non-zero positive integer value.

frameR

Frame rate of the movie in frames per minute, a non-zero positive numeric value.

showRaw

A logical value (TRUE or FALSE) indicating whether the raw data (unfitted data points) will be shown on the plot or not, respectively. The default value is FALSE. This argument is ignored (regarded as FALSE) in case cols = -1.

save

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

savePars

A named list specifying the parameters of each 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 3000.

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

Details

The parameters of the Baranyi and Roberts model are found using the non-linear least squares method provided by nls, considering all non-root cells, as returned from get_cells.

When cols = -1, a common plot for all colonies is generated. In other cases, a separate plot for each colony specified in cols is generated.

x-axis represents the time in hours from the start (value 0) to end of the movie. y-axis represents the cell counts in logarithmic scale. The range of y-axis values depicted in each plot is common and is calculated as the range of values of all specified colonies, with minimum upper limit 2 (i.e. 20 cells).

Color denotes the corresponding colony.

Value

A dataframe with the following columns:

  1. colony is the colony ID (a non-zero positive integer value) or -2 in case cols = -2.

  2. lag is the lambda parameter (lag time) of the Baranyi and Roberts model in hours (a non-zero positive numeric value) or NA in case the model failed to be fitted or colony has only cells which have not been divided.

  3. mumax is the mumax parameter (maximum specific growth rate) of the Baranyi and Roberts model in 1/hour (a non-zero positive numeric value) or NA in case the model failed to be fitted or colony has only cells which have not been divided.

For groups with lag = NA, no plot is generated, except for the case that showRaw = TRUE. 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.