| gate-class {prada} | R Documentation |
In flow-cytometry analysis, regions in two-dimensional projections of the data space often have to be selected. Objects of this class can store the properties of these selections.
Objects can be created using methods of the generic function
drawGate or via
new("gate",
gateFun = ...., # function returning logical vector
colnames = .... # object of class character and length 2
logic = .... # object of class character
)
name:gate
object. You can reference the object by its name for subsequent
operations (e.g. plotting).gateFun:colnames:logic:character object, either & or
|. This specifies the logical operation that will be applied
when combining the selection from the gate with other object of
that class. See link[prada]{gateSet} for additional information
on combining gates.type:character giving the type of the
object. This is currently not used but might become important in the
future.boundaries:matrix with two columns
giving the boundaries of the gate in two dimensional space. Can be used
to superimpose the gate boundaries on a plot using lines().applyGate(x, data)x on data objects of class
cytoFrame or matrix.
In the former case x may be of class gate,
gateSet, character, numeric or
logical. See vignette for details.gate object to gateSet
objectgate objects to
one gateSet objectFlorian Hahne
cytoFrame, gateMatrix,
gateSet
sampdat <- readFCS(system.file("extdata", "fas-Bcl2-plate323-04-04.A01",
package="prada"))
g1 <- new("gate", name="test1", gateFun=function(x)x[,"FSC-H"]<500, logic="&",
colnames="FSC-H", type="misc")
g1
g2 <- new("gate", name="test2", gateFun=function(x)x[,"SSC-H"]>800, logic="&",
colnames="SSC-H", type="misc")
gs1 <- combineGates(g1,g2)
gs2 <- as.gateSet(g2)
names(g1)
names(g1) <- "testName"
applyGate(sampdat, g1)
applyGate(exprs(sampdat), g2)
gate(sampdat) <- g1
applyGate(sampdat, 1)
applyGate(sampdat, "testName")
applyGate(sampdat, TRUE)