quadGate-class.RdClass and constructors for quadrant-type filter objects.
quadGate(..., .gate, filterId="defaultQuadGate")
| filterId | An optional parameter that sets the |
|---|---|
| .gate | A definition of the gate for programmatic access. This can be either a named list or a named numeric vector, as described below. |
| ... | The parameters of |
Returns a quadGate object for use in filtering
flowFrames or other flow cytometry objects.
quadGates are defined by two parameters, which specify a separation
of a two-dimensional parameter space into four quadrants. The
quadGate function is designed to be useful in both direct and
programmatic usage.
For the interactive use, these parameters can be given as additional named
function arguments, where the names correspond to valid parameter names in a
flowFrame or flowSet. For a more programmatic
approach, a named list or numeric vector of the gate boundaries can be
passed on to the function as argument .gate.
Evaluating a quadGate results in four sub-populations, and hence in
an object of class multipleFilterResult. Accordingly,
quadGates can be used to split flow cytometry data sets.
boundaryObject of class "numeric", length
2. The boundaries of the quadrant regions.
parametersObject of class "character",
describing the parameter used to filter the flowFrame.
filterIdObject of class "character",
referencing the gate.
See the documentation in the flowViz
package for plotting of quadGates.
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("quadGate",
...) or using the constructor quadGate. The latter is the
recommended way.
signature(x = "flowFrame", table =
"quadGate"): The workhorse used to evaluate the gate on
data. This is usually not called directly by the user, but
internally by calls to the filter methods.
signature(object = "quadGate"): Print
information about the gate.
flowFrame, flowSet, filter for
evaluation of quadGates and split for splitting of flow
cytometry data sets based on that.
Other Gate classes:
ellipsoidGate-class,
polygonGate-class,
polytopeGate-class,
rectangleGate-class
## Loading example data dat <- read.FCS(system.file("extdata","0877408774.B08", package="flowCore")) ## Create directly. Most likely from a command line quadGate(filterId="myQuadGate1", "FSC-H"=100, "SSC-H"=400)#> Quadrant gate 'myQuadGate1' with dimensions: #> FSC-H: 100 #> SSC-H: 400## To facilitate programmatic construction we also have the following quadGate(filterId="myQuadGate2", list("FSC-H"=100, "SSC-H"=400))#> Quadrant gate 'myQuadGate2' with dimensions: #> FSC-H: 100 #> SSC-H: 400## FIXME: Do we want this? ##quadGate(filterId="myQuadGate3", .gate=c("FSC-H"=100, "SSC-H"=400)) ## Filtering using quadGates qg <- quadGate(filterId="quad", "FSC-H"=600, "SSC-H"=400) fres <- filter(dat, qg) fres#> A filterResult produced by the filter named 'quad' #> resulting in multiple populations: #> FSC-H+SSC-H+ #> FSC-H-SSC-H+ #> FSC-H+SSC-H- #> FSC-H-SSC-H-summary(fres)#> FSC-H+SSC-H+: 1535 of 10000 events (15.35%) #> FSC-H-SSC-H+: 135 of 10000 events (1.35%) #> FSC-H+SSC-H-: 429 of 10000 events (4.29%) #> FSC-H-SSC-H-: 7901 of 10000 events (79.01%)names(fres)#> [1] "FSC-H+SSC-H+" "FSC-H-SSC-H+" "FSC-H+SSC-H-" "FSC-H-SSC-H-"## The result of quadGate filtering are multiple sub-populations ## and we can split our data set accordingly split(dat, fres)#> $`FSC-H+SSC-H+` #> flowFrame object '0877408774.B08 (FSC-H+SSC-H+)' #> with 1535 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 #> 165 keywords are stored in the 'description' slot #> #> $`FSC-H-SSC-H+` #> flowFrame object '0877408774.B08 (FSC-H-SSC-H+)' #> with 135 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 #> 165 keywords are stored in the 'description' slot #> #> $`FSC-H+SSC-H-` #> flowFrame object '0877408774.B08 (FSC-H+SSC-H-)' #> with 429 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 #> 165 keywords are stored in the 'description' slot #> #> $`FSC-H-SSC-H-` #> flowFrame object '0877408774.B08 (FSC-H-SSC-H-)' #> with 7901 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 #> 165 keywords are stored in the 'description' slot #>## We can limit the splitting to one or several sub-populations split(dat, fres, population="FSC-H-SSC-H-")#> $`FSC-H-SSC-H-` #> flowFrame object '0877408774.B08 (FSC-H-SSC-H-)' #> with 7901 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 #> 165 keywords are stored in the 'description' slot #>#> $keep #> flowFrame object '0877408774.B08 (FSC-H-SSC-H-,FSC-H-SSC-H+)' #> with 8036 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 #> 3 keywords are stored in the 'description' slot #>