Class and constructor for data-driven filter objects that discard margin events.

boundaryFilter(x, tolerance=.Machine$double.eps, side=c("both", "lower",
"upper"), filterId="defaultBoundaryFilter")

Arguments

x

Character giving the name(s) of the measurement parameter(s) on which the filter is supposed to work. Note that all events on the margins of ay of the channels provided by x will be discarded, which is often not desired. Such events may not convey much information in the particular channel on which their value falls on the margin, however they may well be informative in other channels.

tolerance

Numeric vector, used to set the tolerance slot of the object. Can be set separately for each element in x. R's recycling rules apply.

side

Character vector, used to set the side slot of the object. Can be set separately for each element in x. R's recycling rules apply.

filterId

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

Value

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

Details

Flow cytomtery instruments usually operate on a given data range, and the limits of this range are stored as keywords in the FSC files. Depending on the amplification settings and the dynamic range of the measured signal, values can occur that are outside of the measurement range, and most instruments will simply pile those values at the minimum or maximum range limit. The boundaryFilter removes these values, either for a single parameter, or for a combination of parameters. Note that it is often desirable to treat boundary events on a per-parameter basis, since their values might be uninformative for one particular channel, but still be useful in all of the other channels.

The constructor boundaryFilter is a convenience function for object instantiation. Evaluating a boundaryFilter results in a single sub-populations, an hence in an object of class filterResult.

Slots

tolerance

Object of class "numeric". The machine tolerance used to decide whether an event is on the measurement boundary. Essentially, this is done by evaluating x>minRange+tolerance & x<maxRange-tolerance.

side

Object of class "character". The margin on which to evaluate the filter. Either upper for the upper margin or lower for the lower margin or both for both margins.

Extends

Class "parameterFilter", directly.

Class "concreteFilter", by class parameterFilter, distance 2.

Class "filter", by class parameterFilter, distance 3.

Objects from the Class

Objects can be created by calls of the form new("boundaryFilter", ...) or using the constructor boundaryFilter. Using the constructor is the recommended way.

Methods

%in%

signature(x = "flowFrame", table = "boundaryFilter"): 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.

show

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

See also

flowFrame, flowSet, filter for evaluation of boundaryFilters and Subset for subsetting of flow cytometry data sets based on that.

Examples

## Loading example data dat <- read.FCS(system.file("extdata","0877408774.B08", package="flowCore")) ## Create directly. Most likely from a command line boundaryFilter("FSC-H", filterId="myBoundaryFilter")
#> boundaryFilter 'myBoundaryFilter' operating on channel #> FSC-H (tolerance=2.22e-16, boundary=both)
## To facilitate programmatic construction we also have the following bf <- boundaryFilter(filterId="myBoundaryFilter", x=c("FSC-H")) ## Filtering using boundaryFilter fres <- filter(dat, bf) fres
#> A filterResult produced by the filter named 'myBoundaryFilter'
summary(fres)
#> myBoundaryFilter+: 9345 of 10000 events (93.45%)
## We can subset the data with the result from the filtering operation. Subset(dat, fres)
#> flowFrame object '0877408774.B08' #> with 9345 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
## A boundaryFilter on the lower margins of several channels bf2 <- boundaryFilter(x=c("FSC-H", "SSC-H"), side="lower")