cyto_plot-flowFrame-method: cyto_plot - flowFrame Method

Description Usage Arguments Author(s) See Also Examples

Description

Explore & visualise a flowFrame.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## S4 method for signature 'flowFrame'
cyto_plot(x, channels, axes_trans = NULL,
  overlay = NULL, gate = NA, limits = "machine", popup = FALSE,
  xlim = NULL, ylim = NULL, title, xlab = NA, ylab = NA,
  density_modal = TRUE, density_smooth = 1.5, density_stack = 0,
  density_fill = NA, density_fill_alpha = 1, density_line_type = 1,
  density_line_width = 1, density_line_col = "black",
  point_shape = ".", point_size = 2, point_col = NA,
  point_alpha = 1, contour_lines = 0, contour_line_type = 1,
  contour_line_width = 1, contour_line_col = "black",
  axes_text_font = 1, axes_text_size = 1, axes_text_col = "black",
  axes_label_text_font = 1, axes_label_text_size = 1.1,
  axes_label_text_col = "black", title_text_font = 2,
  title_text_size = 1.1, title_text_col = "black", legend = FALSE,
  legend_text, legend_text_font = 1, legend_text_size = 1,
  legend_text_col = "black", legend_line_col = NA,
  legend_box_fill = NA, legend_point_col = NA, gate_line_type = 1,
  gate_line_width = 2.5, gate_line_col = "red", label = TRUE,
  label_text = NA, label_stat = "percent", label_text_font = 2,
  label_text_size = 1, label_text_col = "black", label_box_x = NA,
  label_box_y = NA, label_box_alpha = 0.6, border_line_type = 1,
  border_line_width = 1, border_line_col = "black", ...)

Arguments

x

object of class flowFrame.

channels

name of the channel(s) or marker(s) to be used to construct the plot. The length of channels determines the type of plot to be constructed, either a 1-D density distribution for a single channel or a 2-D scatterplot with blue-red colour scale for two channels.

axes_trans

object of class transformList or transformerList generated by estimateLogicle which was used to transform the fluorescent channels of the supplied flowFrame. This transformation object will be used internally to ensure that the axes labels of the plot are appropriately transformed. The transformation object will NOT be applied to the flowFrame internally and should be applied to the flowFrame prior to plotting.

overlay

a flowFrame, flowSet or list of flowFrames to be overlaid onto the plot.

gate

gate object(s) to be added to plot. For cyto_1d_plot only gate objects of class rectangleGate in either 1 or 2 dimensions are supported. Multiple gates can be supplied either as a list or filters object.

limits

indicates whether the axes limits should be based on the "data" or "machine", set to "machine" by default to show complete axes ranges. This argument will only alter the upper axis limits, to modify the lower limits use xlim and ylim.

popup

logical indicating whether the plot should be constructed in a pop-up window, set to FALSE by default. popup will open OS-specific graphic device prior to plotting. Mac users will need to install XQuartz for this functionality.

xlim

lower and upper limits of x axis (e.g. c(0,5)).

ylim

lower and upper limits of y axis (e.g. c(0,5)).

title

title to use for the plot, set to the name of the sample by default. Title can be removed by setting this argument to NA.

xlab

x axis label.

ylab

y axis label.

density_modal

logical indicating whether density should be normalised to mode and presented as a percentage for 1-D plots. Set to TRUE by default.

density_smooth

smoothing parameter passed to density to adjust kernel density for 1-D plots.

density_stack

numeric [0,1] indicating the degree of offset for 1-D density distributions with overlay, set to 0.5 by default.

density_fill

fill colour(s) for 1-D density distributions.

density_fill_alpha

numeric [0,1] used to control 1-D density fill colour transparency, set to 1 by default for solid colours.

density_line_type

line type(s) to use for 1-D density lines, set to 1 by default to use solid lines. See lty for alternatives.

density_line_width

numeric to control line width(s) for 1-D density lines, set to 1 by default.

density_line_col

colour(s) for 1-D density lines, set to "black" by default.

point_shape

shape(s) to use for points in 2-D scatterplots, set to "." by default to maximise plotting speed. See pch for alternatives.

point_size

numeric to control the size of points in 2-D scatter plots set to 2 by default.

point_col

colour(s) to use for points in 2-D scatter plots, set to NA by default to use a blue-red density colour scale.

point_alpha

numeric [0,1] to control point colour transparency in 2-D scatter plots, set to 1 by default to use solid colours.

contour_lines

numeric indicating the number of levels to use for contour lines in 2-D scatter plots, set to 0 by default to turn off contour lines.

contour_line_type

integer [0,6] to control the line type of contour lines in 2-D scatter plots, set to 1 to draw solid lines by default. See lty for alternatives.

contour_line_width

numeric to control line width(s) for contour lines in 2-D scatter plots, set to 2 by default.

contour_line_col

colour(s) to use for contour lines in 2-D scatter plots, set to "black" by default.

axes_text_font

numeric to control the font of axes text, set to 1 for plain font by default. See font for alternatives.

axes_text_size

numeric to control the size of axes text, set to 1 by default.

axes_text_col

colour to use for axes text, set to "black" by default.

axes_label_text_font

numeric to control the font axes labels, set to 1 for plain font by default. See font for alternatives.

axes_label_text_size

numeric to control the text size of axes labels, set to 1.1 by default.

axes_label_text_col

colour to use for axes labels text, set to "black" by default.

title_text_font

numeric to control the font of title text, set to 2 for bold font by default. See font for alternatives.

title_text_size

numeric to control the text size of the plot title, set to 1.1 by default.

title_text_col

colour to use for plot title text, set to "black" by default.

legend

can be either "line" or "fill" to indicate whether a legend should be constructed based on the density "line" or "fill", set to FALSE by default to remove the legend.

legend_text

vector of labels to use in the legend.

legend_text_font

numeric to control the font of legend text, set to 1 for plain font by default. See font for alternatives.

legend_text_size

numeric to control the size of text in the legend, set to 1 by default.

legend_text_col

colour(s) to use for text in legend, set to "black" by default.

legend_line_col

colour(s) to use for the lines in 1-D plot legends when legend is set to "line".

legend_box_fill

fill colour(s) to use for the boxes in 1-D plot legends when legend is set to "fill".

legend_point_col

colour(s) to use for points in 2-D scatter plot legend.

gate_line_type

integer [0,6] to control the line type of gates, set to 1 to draw solid lines by default. See lty for alternatives.

gate_line_width

numeric to control the line width(s) of gates, set to 2.5 by default.

gate_line_col

colour(s) to use for gates, set to "red" by default.

label

logical indicating whether gated populations should be labelled. To include the names of the populations in these labels, supply the population names to the label_text argument. The default statistic is "percent" for gated data and "count" for un-gated data.

label_text

vector of population names to use in the labels. Set to NA by default to exclude population names.

label_stat

indicates the type of statistic to include in the plot labels, can be "percent", "count", "mean", "median", "mode" or "geo mean", set to "percent" for gated data or NA to exclude statistics for un-gated data. Currently, only "percent" and "count" are supported for 2-D scatter plots.

label_text_font

numeric to control the font of text in plot labels, set to 2 for bold font by default. See font for alternatives.

label_text_size

numeric to control the size of text in the plot labels, set to 1 by default.

label_text_col

colour(s) to use for text in plot labels, set to "black" by default.

label_box_x

vector of x co-ordinate(s) to manually adjust the position plot label(s) on the plot.

label_box_y

vector of y co-ordinate(s) to manually adjust the position plot label(s) on the plot.

label_box_alpha

numeric to control background fill transparency of label boxes, set to 0.6 by default to introduce some transparency.

border_line_type

integer [0,6] to control the line type of plot border, set to 1 by default for a solid border. See lty for alternatives.

border_line_width

numeric to control line width for the plot border, set to 1 by default.

border_line_col

colour to use for the plot border, set to "black" by default.

...

additional arguments passed to plot.

Author(s)

Dillon Hammill, Dillon.Hammill@anu.edu.au

See Also

cyto_plot,flowSet-method

cyto_plot,GatingHierarchy-method

cyto_plot,GatingSet-method

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(CytoRSuiteData)

# Load in samples
fs <- Activation

# Apply compensation
fs <- compensate(fs, fs[[1]]@description$SPILL)

# Transform fluorescent channels
trans <- estimateLogicle(fs[[4]], cyto_fluor_channels(fs))
fs <- transform(fs, trans)

# 1-D Density Distribution
cyto_plot(fs[[1]],
  channels = "PE-A",
  axes_trans = trans,
  overlay = fs[2:4],
  density_stack = 0.5
)

# 2-D Scatter Plot
cyto_plot(fs[[4]],
  channels = c("FSC-A", "PE-A"),
  axes_trans = trans,
  overlay = fs[[1]]
)

DillonHammill/cytoSuite documentation built on March 7, 2019, 10:09 a.m.