ApplyGate | R Documentation |
A specific Gate defined by xy coordinates that result in a closed polygon is applied to the flowcytometry data.
ApplyGate(Data, GateVar1, GateVar2, Polygon, PlotIt = FALSE, PlotSampleSize = 1000)
Data |
numerical matrix n x d |
GateVar1 |
either column index in Data of X coordinate of gate or its variable name as string |
GateVar2 |
either column index in Data of X coordinate of gate or its variable name as string |
Polygon |
numerical marix of two columns defining the coordiantes of the polygon. polygon assumed to be closed, i.e.,last coordinate connects to first coordinate. |
PlotIt |
if TRUE: plots a sample of data in the two selected variables and marks point inside the gate as yellow and outside as magenta |
PlotSampleSize |
size pof the plottet sample |
Gates are alwaxs two dimensional, i.e., require two filters, although all dimensions of data are filted by the gates. Only high-dimensional points inside the polygon (gate) are given back
list of
DataInGate |
m x d numerical matrix with m<=n of data points inside the gate |
InGateInd |
index of length m for the datapoints in original matrix |
if GateVar1 or GateVar2 is not found a text is given back which will state this issue
Michael Thrun
PointsInPolygon
Data <- matrix(runif(1000), ncol = 10)
colnames(Data)=paste0("GateVar",1:ncol(Data))
poly <- cbind(x = c(0.2,0.5,0.8), y = c(0.2,0.8,0.2))
#set plotit TRUE for understanding the example
#Select indect
V=ApplyGate(Data,5,8,poly,PlotIt=FALSE,100)
#select var name
V=ApplyGate(Data,"GateVar5","GateVar8",poly,PlotIt=FALSE,100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.