cyto_plot_label takes on a flowFrame object, population name text, channels and a gate object to construct a text label for the plot with the population name and frequency.

# S4 method for flowFrame,list
cyto_plot_label(x, gates, trans = NULL,
  channels, text = NA, stat = NA, text_x = NA, text_y = NA,
  text_font = 2, text_size = 0.8, text_col = "black",
  box_alpha = 0.6)

Arguments

x

a flowFrame gated in the existing plot.

gates

an object of class "list" containing objects of class rectangleGate, polygonGate or ellipsoidGate.

trans

object of class transformList or transformerList generated by estimateLogicle which was used to transform the fluorescent channels of the supplied flowFrame.

channels

a vector indicating the fluorescent channel(s) to be used for gating.

text

the name of the gated population, set to NA by default to only include percent in labels.

stat

indicates the type of statistic to include in the label, can be either "freq", "count", "median", "mean", "mode", "geo mean" or "CV". stat is set to "freq" by default. Statistics for fluorescent intensity are calculated for the entire distribution. Only count and percent statistics are supported for 2D plots.

text_x

vector containing the x co-ordinates for the plot labels. Set to NULL by default to place labels in the center of the gates.

text_y

vector containing the x co-ordinates for the plot labels. Set to NULL by default to place labels in the center of the gates.

text_font

integer [1,2,3,4] passed to text to alter the font, set to 2 by default for a bold font.

text_size

numeric character expansion used to control the size of the text in the labels, set to 0.8 by default. See ?text for details.

text_col

specify text colour in label for each gate, defaults to "black" for all gates.

box_alpha

numeric [0,1] controls the transparency of the background, set to 0.6 by default.

Value

add a boxed text label to cyto_plot.

See also

Examples

library(CytoRSuiteData) # Load in samples fs <- Activation gs <- GatingSet(fs)
#> .
#> .
#> .
#> .
#> done!
# Apply compensation gs <- compensate(gs, fs[[1]]@description$SPILL) # Transform fluorescent channels trans <- estimateLogicle(gs[[4]], cyto_fluor_channels(fs)) gs <- transform(gs, trans) # Gate using gate_draw gating(Activation_gatingTemplate, gs)
#> Preprocessing for 'Cells'
#> Gating for 'Cells'
#> done.
#> Preprocessing for 'Single Cells'
#> Gating for 'Single Cells'
#> done.
#> Preprocessing for 'Live Cells'
#> Gating for 'Live Cells'
#> done.
#> Preprocessing for 'Dendritic Cells'
#> Gating for 'Dendritic Cells'
#> done.
#> Preprocessing for 'T Cells'
#> Gating for 'T Cells'
#> done.
#> Preprocessing for 'CD8 T Cells'
#> Gating for 'CD8 T Cells'
#> done.
#> Preprocessing for 'CD69+ CD8 T Cells'
#> Gating for 'CD69+ CD8 T Cells'
#> done.
#> Preprocessing for 'CD4 T Cells'
#> Gating for 'CD4 T Cells'
#> done.
#> Preprocessing for 'CD69+ CD4 T Cells'
#> Gating for 'CD69+ CD4 T Cells'
#> done.
#> finished.
# Plot cyto_plot(gs[[4]], parent = "Live Cells", channels = c("APC-Cy7-A", "PE-A") )
# T Cells & Dendritic Cells gates gts <- list(getGate(gs, "T Cells")[[1]], getGate(gs, "Dendritic Cells")[[1]]) cyto_plot_gate(gts, channels = c("APC-Cy7-A", "PE-A") )
# Labels cyto_plot_label(getData(gs, "Live Cells")[[4]], gates = gts, trans = trans, channels = c("APC-Cy7-A", "PE-A"), text = c("T Cells", "Dendritic Cells"), stat = "count", text_col = c("magenta", "purple"), text_size = 1.2, box_alpha = 1 )