gs_pop_add | R Documentation |
GatingSet
method creates a gatingset from a flowSet with the ungated data as the root node.
add
method add the flowCore gate to a GatingHierarchy/GatingSet.
gs_pop_set_gate
method update the gate of one population node in GatingHierarchy/GatingSet.
Rm
method Remove the population node from a GatingHierarchy/GatingSet.
They are equivalent to the workFlow
,add
and Rm
methods in flowCore
package.
recompute
method does the actual gating after the gate is added,i.e. calculating the event indices according to the gate definition.
gs_pop_add(gs, gate, validityCheck = TRUE, ...)
gs_pop_remove(gs, node, ...)
gs |
A |
gate |
A |
validityCheck |
|
... |
some other arguments to specify how the gates are added to the gating tree.
|
node |
A |
GatingSet
method returns a GatingSet
object with just root node.
add
method returns a population node ID (or four population node IDs when adding a quadGate
) that uniquely identify the population node within a GatingHierarchy
.
GatingSet-class
## Not run:
library(flowCore)
data(GvHD)
#select raw flow data
fs<-GvHD[1:3]
#transform the raw data
tf <- transformList(colnames(fs[[1]])[3:6], asinh, transformationId="asinh")
fs_trans<-transform(fs,tf)
#add transformed data to a gatingset
gs <- GatingSet(fs_trans)
gs
gs_get_pop_paths(gs[[1]]) #only contains root node
#add one gate
rg <- rectangleGate("FSC-H"=c(200,400), "SSC-H"=c(250, 400),
filterId="rectangle")
nodeID<-gs_pop_add(gs, rg)#it is added to root node by default if parent is not specified
nodeID
gs_get_pop_paths(gs[[1]]) #the second population is named after filterId of the gate
#add a quadGate
qg <- quadGate("FL1-H"=2, "FL2-H"=4)
nodeIDs<-gs_pop_add(gs,qg,parent="rectangle")
nodeIDs #quadGate produces four population nodes
gs_get_pop_paths(gs[[1]]) #population names are named after dimensions of gate if not specified
#add a boolean Gate
bg<-booleanFilter(`CD15 FITC-CD45 PE+|CD15 FITC+CD45 PE-`)
bg
nodeID2<-gs_pop_add(gs,bg,parent="rectangle")
nodeID2
gs_get_pop_paths(gs[[1]])
#do the actual gating
recompute(gs)
#plot one gate for one sample
autoplot(gs[[1]],"rectangle")
autoplot(gs[[1]],nodeIDs) #may be smoothed automatically if there are not enough events after gating
#plot gates across samples
autoplot(gs,nodeID)
#plot all gates for one sample
autoplot(gs[[1]])#boolean gate is skipped by default
autoplot(gs[[1]],bool=TRUE)
#plot the gating hierarchy
plot(gs[[1]])
#remove one node causing the removal of all the descendants
gs_pop_remove('rectangle', gs = gs)
gs_get_pop_paths(gs[[1]])
#add logical vectors as gate
lg <- sapply(sampleNames(gs), function(sn){
gh <- gs[[sn]]
dat <- exprs(gh_pop_get_data(gh, "cd3+"))#get events data matrix for this sample at cd3+ node
vec <- dat[, "FSC-A"] > 1e4 & data[, "SSC-A"] > 1e5
vec
})
gs_pop_add(gs, lg, name = "new_bool", parent = "cd3+")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.