gate_draw-GatingSet-method: gate_draw GatingSet Method

Description Usage Arguments Value Author(s) See Also Examples

Description

Manually draw gates around populations for analysis of flow cytometry data.

Usage

1
2
3
4
5
## S4 method for signature 'GatingSet'
gate_draw(x, group_by = NULL, select = NULL,
  parent = "root", alias = NULL, channels = NULL, type = "polygon",
  gatingTemplate = NULL, display = NULL, axis = "x",
  density_smooth = 1.5, label = TRUE, plot = TRUE, ...)

Arguments

x

object of class GatingSet.

group_by

vector of pData column names (e.g. c("Treatment","Concentration") indicating how the samples should be grouped prior to gating, set to the length of x by default to construct a single gate for all samples. If group_by is supplied a different gate will be constructed for each group.

select

vector containing the indices of samples within each group to use for plotting.

parent

name of the parent population to extract for gating.

alias

the name(s) of the populations to be gated. If multiple population names are supplied (e.g. c("CD3,"CD4)) multiple gates will be returned. alias is NULL by default which will halt the gating routine.

channels

vector of channel names to use for plotting, can be of length 1 for 1-D density histogram or length 2 for 2-D scatter plot.

type

vector of gate type names used to construct the gates. Multiple gate types are supported but should be accompanied with an alias argument of the same length (i.e. one type per alias). Supported gate types are polygon, rectangle, ellipse, threshold, boundary, interval, quadrant and web which can be abbreviated as upper or lower case first letters as well. Default type is "interval" for 1D gates and "polygon" for 2D gates.

gatingTemplate

name of gatingTemplate csv file to be saved.

display

numeric [0,1] to control the percentage of events to be plotted. Specifying a value for display can substantial improve plotting speed for less powerful machines.

axis

indicates whether the "x" or "y" axis should be gated for 2-D interval gates.

density_smooth

smoothing factor passed to density for 1-D plots (defaults to 1.5).

label

logical indicating whether to include cyto_plot_label for the gated population(s), TRUE by default.

plot

logical indicating whether a plot should be drawn, set to TRUE by default.

...

additional arguments for cyto_plot,GatingSet-method.

Value

drawn gates are applied to the GatingSet and saved to a gatingTemplate.

Author(s)

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

See Also

cyto_plot,GatingSet-method

gate_draw,flowFrame-method

gate_draw,flowSet-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
27
28
29
30
31
## Not run: 
library(CytoRSuiteData)

# Load in samples
fs <- Activation
gs <- GatingSet(fs)

# 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)

# draw gates using gate_draw - add contour lines & overlay control
gate_draw(gs,
  parent = "Dendritic Cells",
  channels = c("Alexa Fluor 488-A", "Alexa Fluor 700-A"),
  alias = c("CD8+ DC", "CD4+ DC"),
  gatingTemplate = "Example-gatingTemplate.csv",
  type = "rectangle",
  contour_lines = 15
)

# Constructed gate applied directly to GatingSet
getNodes(gs)

## End(Not run)

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