## Loading example data
dat <- read.FCS(system.file("extdata","0877408774.B08",
package="flowCore"))
## Defining the gate
sqrcut <- matrix(c(300,300,600,600,50,300,300,50),ncol=2,nrow=4)
colnames(sqrcut) <- c("FSC-H","SSC-H")
pg <- polygonGate(filterId="nonDebris", boundaries= sqrcut)
pg
## Filtering using polygonGates
fres <- filter(dat, pg)
fres
summary(fres)
## The result of polygon filtering is a logical subset
Subset(dat, fres)
## We can also split, in which case we get those events in and those
## not in the gate as separate populations
split(dat, fres)
Run the code above in your browser using DataLab