plotFlscDist: Plot Fluorescence Distribution

View source: R/gen_accessories.R

plotFlscDistR Documentation

Plot Fluorescence Distribution

Description

Plot the fluorescence distribution contained in the object of class 'fdmat'. For each gate contained in 'fdmat', a graphic will be produced.

Usage

plotFlscDist(
  fdmat,
  gate = NULL,
  ti = "",
  spl = NULL,
  ylog = FALSE,
  ccol = NULL,
  clt = NULL,
  toPdf = TRUE,
  fns = NULL,
  foN.plots = ".",
  leg = TRUE,
  ...
)

Arguments

fdmat

An object of class "fdmat" as produced by makefdmat or flowdexit .

gate

Character or numeric length one. If more than one gate is present in the provided fdmatrix, provide either the name of the gate, or a numeric specifying the position of the gate in the metadata within the fdmatrix to plot data from only that gate. If left at the default NULL and more than one gate is present in the data, fluorescence distributions from all gates will be plotted in individual plots.

ti

Character length one. Will be used for the title in the plot.

spl

The column name in the cyTags of the values used for splitting. Defaults to NULL, i.e. no splitting.

ylog

Logical. If the y-axis (the counts) should be plotted in log scale.

ccol

An optional color vector for custom coloring. Must have the same length as number of rows in the matrix.

clt

Numeric vector specifying a sequence of custom line-types.

toPdf

Logical. If output should be saved in results as PDF. Defaults to TRUE.

fns

Character length one. The filename suffix, defaults to NULL.

foN.plots

Character length one. The name of the folder where possible PDFs should be saved in. If left at the default '.', the value as defined in the settings file (key 'foN_plots') will be used.

leg

Logical, if the legend should be plotted. Defaults to TRUE.

...

Additional plotting parameters passed on to 'matplot'

Value

(Invisible) NULL; is used for its side effects, i.e. to plot fluorescence distributions.

Note

This function is merely intended to give a first overview of the data resp. the fluorescence distribution. Its purpose is not to provide ample and sufficient data visualisation.

See Also

Other Plotting functions: drawGate(), plotgates()

Examples

td <- tempdir()
data_source <- "https://github.com/bpollner/data/raw/main/flowdex_examples/flowdex_examples.zip"
check_download_data(td, data_source)
exp_home <- paste0(td, "/flowdex_examples")
old_wd <- getwd()
setwd(exp_home)
#
assign("get_settings_from_flowdex_package_root", TRUE, pos=.GlobalEnv)
# only required to make the examples run automatically
# you should not call 'assign' if you run the examples manually
# the effect of setting 'get_settings_from_flowdex_package_root' to TRUE
# is that the file 'flowdex_settings.R' in 'root' of the installed package
# 'flowdex' will be sourced instead of the one in the user-defined location.
#
fdmat <- flowdexit(patt = "T4")
plotFlscDist(fdmat, toPdf = FALSE)
plotFlscDist(fdmat, spl = "C_treatment", toPdf = FALSE)
#
setwd(old_wd)

bpollner/flowdex documentation built on March 31, 2022, 3:21 a.m.