gate_draw: DrawGate plugin for openCyto

Description Usage Arguments Value Author(s) Examples

Description

DrawGate allows the user to draw polygon gates directly onto plots of flow cytometry data. Simply left click to gate and right click to close the gate.

Usage

1
2
3
4
gate_draw(fr, pp_res, channels, filterId = "", gate_range = NULL,
  min = NULL, max = NULL, gate_type = c("polygon", "rectangle",
  "interval", "threshold", "ellipse", "quadrant"), N = 1, axis = c("x",
  "y"), adjust = 1.5, ...)

Arguments

fr

a flowFrame object containing the flow cytometry data for gating.

pp_res

output of preprocessing function.

channels

a vector of length 2 indicating the channels used to construct the 2D plot.

filterId

gate name assigned by openCyto from the gatingTemplate.

gate_range

range in which gate should be constructed (only needed for autogating functions).

min

argument passed to truncate_flowFrame to restrict data to values > min.

max

argument passed to truncate_flowFrame to restrict data to values < max.

gate_type

type of gate to be constructed, supported types include c("polygon", "rectangle", "interval", "threshold", "ellipse", "quadrant").

N

an integer indicating the number of gates to construct, set to 1 by default.

axis

indicates the axis to use for gating for gate_type="interval" when 2 fluorescent channel are supplied.

adjust

numeric smoothing factor used for 1D density plots.

...

additional arguments passsed to DrawGate.

Value

a polygonGate constructed from coordinates supplied by DrawGate.

Author(s)

Dillon Hammill (Dillon.Hammill@anu.edu.au)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{
library(openCyto)

registerPlugins(fun = gate_draw, methodName = "DrawGate")
listgtMethods()   # check plugin has been registered with openCyto

fs <- read.flowSet(path = "Samples", pattern = ".fcs") # load in .fcs files

gs <- GatingSet(fs) # add flowSet to GatingSet

template <- add_pop(
gs, alias = "Lymphocytes", pop = "+", parent = "root", dims = "FSC-A,SSC-A", gating_method = "DrawGate", gaating_args = "gate_type='ellipse'",
gating_args = "subSample=10000", collapseDataForGating = TRUE, groupBy = 2
)

# gating window will open to construct gate left click vertices on plot and close gate by right click and selecting "stop".

ggcyto(gs[[1]], subset = "root", aes(x = "FSC-A",y = "SSC-A")) + geom_hex(bins = 100) + geom_stats()

}

DillonHammill/CytoGate documentation built on May 16, 2019, 7:20 a.m.