expressionFilter-class | R Documentation |
A filter
holding an expression that can be evaluated to a
logical vector or a vector of factors.
expressionFilter(expr, ..., filterId="defaultExpressionFilter")
char2ExpressionFilter(expr, ..., filterId="defaultExpressionFilter")
filterId |
An optional parameter that sets the |
expr |
A valid R expression or a character vector that can be parsed into an expression. |
... |
Additional arguments that are passed to the evaluation environment of the expression. |
The expression is evaluated in the environment of the flow cytometry values,
hence the parameters of a flowFrame
can be accessed through
regular R symbols. The convenience function char2ExpressionFilter
exists to programmatically construct expressions.
Returns a expressionFilter
object for use in filtering
flowFrame
s or other flow cytometry objects.
expr
The expression that will be evaluated in the context of the flow cytometry values.
args
An environment providing additional parameters.
deparse
A character scalar of the deparsed expression.
filterId
The identifier of the filter.
Class "concreteFilter"
, directly.
Class "filter"
, by class concreteFilter
,
distance 2.
Objects can be created by calls of the form
new("expressionFilter", ...)
, using the
expressionFilter
constructor or, programmatically, from a
character string using the char2ExpressionFilter
function.
signature(x = "flowFrame", table =
"expressionFilter")
: 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 = "expressionFilter")
: Print
information about the gate.
F. Hahne, B. Ellis
flowFrame
, filter
for evaluation of
sampleFilters
and split
and Subset
for
splitting and subsetting of flow cytometry data sets based on that.
## Loading example data
dat <- read.FCS(system.file("extdata","0877408774.B08",
package="flowCore"))
#Create the filter
ef <- expressionFilter(`FSC-H` > 200, filterId="myExpressionFilter")
ef
## Filtering using sampeFilters
fres <- filter(dat, ef)
fres
summary(fres)
## The result of sample filtering is a logical subset
newDat <- Subset(dat, fres)
all(exprs(newDat)[,"FSC-H"] > 200)
## We can also split, in which case we get those events in and those
## not in the gate as separate populations
split(dat, fres)
## Programmatically construct an expression
dat <- dat[,-8]
r <- range(dat)
cn <- paste("`", colnames(dat), "`", sep="")
exp <- paste(cn, ">", r[1,], "&", cn, "<", r[2,], collapse=" & ")
ef2 <- char2ExpressionFilter(exp, filterId="myExpressionFilter")
ef2
fres2 <- filter(dat, ef2)
fres2
summary(fres2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.