Class "kmeansFilter"

Share:

Description

A filter that performs one-dimensional k-means (Lloyd-Max) clustering on a single flow parameter.

Usage

1
kmeansFilter(..., filterId="defaultKmeansFilter")

Arguments

...

kmeansFilter are defined by a single flow parameter and an associated list of k population names. They can be given as a character vector via a named argument, or as a list with a single named argument. In both cases the name will be used as the flow parameter and the content of the list or of the argument will be used as population names, after coercing to character. For example

kmeansFilter(FSC=c("a", "b", "c"))

or

kmeansFilter(list(SSC=1:3))

If the parameter is not fully realized, but instead is the result of a transformation operation, two arguments need to be passed to the constructor: the first one being the transform object and the second being a vector of population names which can be coerced to a character. For example

kmeansFilter(tf, c("D", "E"))

filterId

An optional parameter that sets the filterId of the object. The filter can later be identified by this name.

Details

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.

Value

Returns a kmeansFilter object for use in filtering flowFrames or other flow cytometry objects.

Extends

Class parameterFilter, directly.

Class concreteFilter, by class parameterFilter, distance 2.

Class filter, by class parameterFilter, distance3.

Slots

populations:

Object 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.

parameters:

Object 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.

filterId:

Object of class character, an identifier or name to reference the kmeansFilter object later on.

Objects from the Class

Like all other filter objects in flowCore, kmeansFilter objects should be instantiated through their constructor kmeansFilter(). See the Usage section for details.

Methods

%in%

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.

show

signature(object = "kmeansFilter"): Print information about the filter.

Usage:

The method is called automatically whenever the object is printed on the screen.

Note

See the documentation in the flowViz package for plotting of kmeansFilters.

Author(s)

F. Hahne, B. Ellis, N. LeMeur

See Also

flowFrame, flowSet, filter for evaluation of kmeansFilters and split for splitting of flow cytometry data sets based on the result of the filtering operation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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
summary(fres)
names(fres)

## The result of quadGate filtering are multiple sub-populations
## and we can split our data set accordingly
split(dat, fres)

## We can limit the splitting to one or several sub-populations
split(dat, fres, population="Pop1")
split(dat, fres, population=list(keep=c("Pop1","Pop2")))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.