kmeansFilter-class.RdA filter that performs one-dimensional k-means (Lloyd-Max) clustering on a single flow parameter.
kmeansFilter(..., filterId="defaultKmeansFilter")
| ... |
or
If the parameter is not fully realized, but instead is the result of a
|
|---|---|
| filterId | An optional parameter that sets the |
Returns a kmeansFilter object for use in filtering
flowFrames or other flow cytometry
objects.
The one-dimensional k-means filter is a multiple population filter capable
of operating on a single flow parameter. It takes a parameter argument
associated with two or more populations and results in the generation of an
object of class multipleFilterResult. Populations are
considered to be ordered such that the population with the smallest mean
intensity will be the first population in the list and the population with
the highest mean intensity will be the last population listed.
populationsObject of class character. The
names of the k populations (or clusters) that will be
created by the kmeansFilter. These names will later be used
for the respective subpopulations in split
operations and for the summary of the filterResult.
parametersObject of class parameters,
defining a single parameter for which the data in the
flowFrame is to be clustered. This may also
be a transformation object.
filterIdObject of class character, an
identifier or name to reference the kmeansFilter object
later on.
See the documentation in the flowViz
package for plotting of kmeansFilters.
Class parameterFilter, directly.
Class concreteFilter, by class parameterFilter,
distance 2.
Class filter, by class parameterFilter,
distance3.
Like all other filter objects in flowCore,
kmeansFilter objects should be instantiated through their
constructor kmeansFilter(). See the Usage section for
details.
signature(x = "flowFrame", table =
"kmeansFilter"): The workhorse used to evaluate the filter on
data. Usage: This is usually not called directly by the user, but internally by
the filter methods.
signature(object = "kmeansFilter"): Print
information about the filter. Usage: The method is called automatically whenever the object is printed
on the screen.
flowFrame, flowSet, filter for
evaluation of kmeansFilters and split for splitting of
flow cytometry data sets based on the result of the filtering operation.
## Loading example data dat <- read.FCS(system.file("extdata","0877408774.B08", package="flowCore")) ## Create the filter kf <- kmeansFilter("FSC-H"=c("Pop1","Pop2","Pop3"), filterId="myKmFilter") ## Filtering using kmeansFilters fres <- filter(dat, kf) fres#> A filterResult produced by the filter named 'myKmFilter' #> resulting in multiple populations: #> Pop1 #> Pop2 #> Pop3summary(fres)#> Pop1: 1236 of 10000 events (12.36%) #> Pop2: 6996 of 10000 events (69.96%) #> Pop3: 1768 of 10000 events (17.68%)names(fres)#> [1] "Pop1" "Pop2" "Pop3"## The result of quadGate filtering are multiple sub-populations ## and we can split our data set accordingly split(dat, fres)#> $Pop1 #> flowFrame object '0877408774.B08 (Pop1)' #> with 1236 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 #> #> $Pop2 #> flowFrame object '0877408774.B08 (Pop2)' #> with 6996 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 #> #> $Pop3 #> flowFrame object '0877408774.B08 (Pop3)' #> with 1768 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 #>#> $Pop1 #> flowFrame object '0877408774.B08 (Pop1)' #> with 1236 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 (Pop1,Pop2)' #> with 8232 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 #>