R: A class for representing filtering operations to be applied...
filter-class
R Documentation
A class for representing filtering operations to be applied to flow data.
Description
The filter class is the virtual base class for all filter/gating objects
in flowCore. In general you will want to subclass or create a
more specific filter.
Slots
filterId:
A character vector that identifies this
filter. This is typically user specified but can be
automatically deduced by certain filter operations, particularly
boolean and set operations.
Objects from the Class
All filter objects in flowCore
should be instantiated through their constructors. These are functions
that share the same name with the respective filter
classes. E.g.,
rectangleGate() is the
constructor function for rectangular gates, and
kmeansFilter() creates
objects of class kmeansFilter. Usually these
constructors can deal with various different inputs, allowing to
utilize the same function in different programmatic or interactive
settings. For all filters that operate on specific flow
parameters (i.e., those inheriting from
parameterFilter), the parameters
need to be passed to the constructor, either as names or colnames of
additional input arguments or explicitly as separate arguments. See
the documentation of the respective filter classes for
details. If parameters are explicitly defined as separate arguments,
they may be of class character, in which case they will be
evaluated literally as colnames in a flowFrame, or of
class transform, in which case the
filtering is performed on a temporarily transformed copy of the input
data. See here for details.
Methods
%in%
Used in the usual way this returns a vector of
values that identify which events were accepted by the filter. A
single filter may encode several populations so this can return
either a logical vector, a factor vector or a
numeric vector of probabilities that the event is accepted
by the filter. Minimally, you must implement this method when
creating a new type of filter
&, |, !
Two filters can be composed
using the usual boolean operations returning a filter class
of a type appropriate for handling the operation. These methods
attempt to guess an appropriate filterId for the new
filter
%subset%, %&%
Defines a filter as being a
subset of another filter. For deterministic filters the results
will typically be equivalent to using an & operation to
compose the two filters, though summary methods will use subset
semantics when calculating proportions. Additionally, when the
filter is data driven, such as
norm2Filter, the subset
semantics are
applied to the data used to fit the filter possibly resulting in
quite different, and usually more desirable, results.
%on%
Used in conjunction with a
transformList to create a
transformFilter. This filter is similar to the subset
filter in that the filtering operation takes place on transformed
values rather than the original values.
filter
A more formal version of %in%, this
method returns a
filterResult object
that can be used in subsequent filter operations as well as providing
more metadata about the results of the filtering operation
summarizeFilter
When implementing a new filter this
method is used to update the filterDetails slot of a
filterResult. It is optional and typically only needs to be
implemented for data-driven filters.