PolygonGate {ScatterDensity} | R Documentation |
PolygonGate
Description
A specific Gate defined by xy coordinates that result in a closed polygon is applied to the flowcytometry data.
Usage
PolygonGate(Data, Polygon, GateVars, PlotIt = FALSE, PlotSampleSize = 1000)
Arguments
Data |
numerical matrix n x d |
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. |
GateVars |
vector, either column index in Data of X and Y coordinates of gate or its variable names as string |
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 |
Details
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
Value
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 |
Note
if GateVars is not found a text is given back which will state this issue
Author(s)
Michael Thrun
See Also
Examples
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 index
V=PolygonGate(Data,poly,c(5,8),PlotIt=FALSE,100)
#select var name
V=PolygonGate(Data,poly,c("GateVar5","GateVar8"),PlotIt=FALSE,100)