ellipsoidGate-class.RdClass and constructor for n-dimensional ellipsoidal filter
objects.
ellipsoidGate(..., .gate, mean, distance=1, filterId="defaultEllipsoidGate")
| filterId | An optional parameter that sets the |
|---|---|
| .gate | A definition of the gate via a covariance matrix. |
| mean | Numeric vector of equal length as dimensions in |
| distance | Numeric scalar giving the Mahalanobis distance defining the
size of the ellipse. This mostly exists for compliance reasons to the
gatingML standard as |
| ... | You can also directly describe the covariance matrix through named arguments, as described below. |
Returns a ellipsoidGate object for use in filtering
flowFrames or other flow cytometry objects.
A convenience method to facilitate the construction of a ellipsoid
filter objects. Ellipsoid gates in n dimensions (n >= 2) are
specified by a a covarinace matrix and a vector of mean values giving the
center of the ellipse.
This function is designed to be useful in both direct and programmatic usage. In the first case, simply describe the covariance matrix through named arguments. To use this function programmatically, you may pass a covarince matrix and a mean vector directly, in which case the parameter names are the colnames of the matrix.
meanObjects of class "numeric". Vector giving
the location of the center of the ellipse in n dimensions.
covObjects of class "matrix". The covariance
matrix defining the shape of the ellipse.
distanceObjects of class "numeric". The
Mahalanobis distance defining the size of the ellipse.
parametersObject of class "character",
describing the parameter used to filter the flowFrame.
filterIdObject of class "character",
referencing the filter.
See the documentation in the flowViz
package for plotting of ellipsoidGates.
Class "parameterFilter", directly.
Class "concreteFilter", by class
parameterFilter, distance 2.
Class "filter", by class parameterFilter,
distance 3.
Objects can be created by calls of the form new("ellipsoidGate",
...) or by using the constructor ellipsoidGate. Using the
constructor is the recommended way.
signature(x = "flowFrame", table =
"ellipsoidGate"): The workhorse used to evaluate the filter on
data. This is usually not called directly by the user, but
internally by calls to the filter methods.
signature(object = "ellipsoidGate"): Print
information about the filter.
flowFrame, polygonGate,
rectangleGate, polytopeGate,
filter for evaluation of rectangleGates and
split and Subsetfor splitting and subsetting of
flow cytometry data sets based on that.
Other Gate classes:
polygonGate-class,
polytopeGate-class,
quadGate-class,
rectangleGate-class
## 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#> A filterResult produced by the filter named 'myEllipsoidGate'summary(fres)#> myEllipsoidGate+: 4209 of 10000 events (42.09%)#> flowFrame object '0877408774.B08' #> with 4209 cells and 8 observables: #> name desc range minRange maxRange #> $P1 FSC-H FSC-H 1024 0.000000 1023 #> $P2 SSC-H SSC-H 1024 0.000000 1023 #> $P3 FL1-H <NA> 1024 1.009044 10000 #> $P4 FL2-H <NA> 1024 1.009044 10000 #> $P5 FL3-H <NA> 1024 1.009044 10000 #> $P6 FL1-A <NA> 1024 0.000000 1023 #> $P7 FL4-H <NA> 1024 1.009044 10000 #> $P8 Time Time (51.20 sec.) 1024 0.000000 1023 #> 164 keywords are stored in the 'description' slot## We can also split, in which case we get those events in and those ## not in the gate as separate populations split(dat, fres)#> $`myEllipsoidGate+` #> flowFrame object '0877408774.B08 (myEllipsoidGate+)' #> with 4209 cells and 8 observables: #> name desc range minRange maxRange #> $P1 FSC-H FSC-H 1024 0.000000 1023 #> $P2 SSC-H SSC-H 1024 0.000000 1023 #> $P3 FL1-H <NA> 1024 1.009044 10000 #> $P4 FL2-H <NA> 1024 1.009044 10000 #> $P5 FL3-H <NA> 1024 1.009044 10000 #> $P6 FL1-A <NA> 1024 0.000000 1023 #> $P7 FL4-H <NA> 1024 1.009044 10000 #> $P8 Time Time (51.20 sec.) 1024 0.000000 1023 #> 164 keywords are stored in the 'description' slot #> #> $`myEllipsoidGate-` #> flowFrame object '0877408774.B08 (myEllipsoidGate-)' #> with 5791 cells and 8 observables: #> name desc range minRange maxRange #> $P1 FSC-H FSC-H 1024 0.000000 1023 #> $P2 SSC-H SSC-H 1024 0.000000 1023 #> $P3 FL1-H <NA> 1024 1.009044 10000 #> $P4 FL2-H <NA> 1024 1.009044 10000 #> $P5 FL3-H <NA> 1024 1.009044 10000 #> $P6 FL1-A <NA> 1024 0.000000 1023 #> $P7 FL4-H <NA> 1024 1.009044 10000 #> $P8 Time Time (51.20 sec.) 1024 0.000000 1023 #> 164 keywords are stored in the 'description' slot #>##ellipsoidGate can be converted to polygonGate by interpolation pg <- as(eg, "polygonGate") pg#> Polygonal gate 'myEllipsoidGate' with 50 vertices in dimensions FSC-H and SSC-H