## Loading example data
dat <- read.FCS(system.file("extdata","0877408774.B08",
package="flowCore"))
## Defining the gate
cov <- matrix(c(6879, 3612, 3612, 5215), ncol=2,
dimnames=list(c("FSC-H", "SSC-H"), c("FSC-H", "SSC-H")))
mean <- c("FSC-H"=430, "SSC-H"=175)
eg <- ellipsoidGate(filterId= "myEllipsoidGate", .gate=cov, mean=mean)
## Filtering using ellipsoidGates
fres <- filter(dat, eg)
fres
summary(fres)
## The result of ellipsoid 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)
##ellipsoidGate can be converted to polygonGate by interpolation
pg <- as(eg, "polygonGate")
pg
Run the code above in your browser using DataLab