Define a filter that removes stretches of unusual data
distribution within a single parameter over time. This can be used to
correct for problems during data acquisition like air bubbles or
clods.
The names of the parameters on which the filter is
supposed to work on. Names can either be given as individual
arguments, or as a list or a character vector.
filterId
An optional parameter that sets the filterId
slot of this gate. The object can later be identified by this name.
bandwidth, binSize
Numerics used to set the bandwidth
and binSize slots of the object.
timeParameter
Character used to set the timeParameter
slot of the object.
Details
Clods and disturbances in the laminar flow of a FACS instrument can
cause temporal aberrations in the data acquisition that lead to
artifactual values. timeFilters try to identify such stretches
of disturbance by computing local variance and location estimates and
to remove them from the data.
Value
Returns a timeFilter 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,
distance 3.
Slots
bandwidth:
Object of class "numeric". The
sensitivity of the filter, i.e., the amount of local variance of
the signal we want to allow.
binSize:
Object of class "numeric". The size
of the bins used for the local variance and location
estimation. If NULL, a reasonable default is used when
evaluating the filter.
timeParameter:
Object of class "character",
used to define the time domain parameter. If NULL, the
filter tries to guess the time domain from the flowFrame.
parameters:
Object of class "character",
describing the parameters used to filter the flowFrame.
filterId:
Object of class "character",
referencing the filter.
Objects from the Class
Objects can be created by calls of the form new("timeFilter",
...) or using the constructor timeFilter. Using the
constructor is the recommended way of object instantiation:
Methods
%in%
signature(x = "flowFrame", table =
"timeFilter"): The workhorse used to evaluate the filter on
data. This is usually not called directly by the user.
show
signature(object = "timeFilter"): Print
information about the filter.
Note
See the documentation of
timeLinePlot in the
flowViz package for details on
visualizing temporal problems in flow cytometry data.
Author(s)
Florian Hahne
See Also
flowFrame, filter for
evaluation of timeFilters and split and
Subsetfor splitting and subsetting of flow cytometry
data sets based on that.
Examples
## Loading example data
data(GvHD)
dat <- GvHD[1:10]
## create the filter
tf <- timeFilter("SSC-H", bandwidth=1, filterId="myTimeFilter")
tf
## Visualize problems
## Not run:
library(flowViz)
timeLinePlot(dat, "SSC-H")
## End(Not run)
## Filtering using timeFilters
fres <- filter(dat, tf)
fres[[1]]
summary(fres[[1]])
summary(fres[[7]])
## The result of rectangle filtering is a logical subset
cleanDat <- Subset(dat, fres)
## Visualizing after cleaning up
## Not run:
timeLinePlot(cleanDat, "SSC-H")
## End(Not run)
## We can also split, in which case we get those events in and those
## not in the gate as separate populations
allDat <- split(dat[[7]], fres[[7]])
par(mfcol=c(1,3))
plot(exprs(dat[[7]])[, "SSC-H"], pch=".")
plot(exprs(cleanDat[[7]])[, "SSC-H"], pch=".")
plot(exprs(allDat[[2]])[, "SSC-H"], pch=".")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(flowCore)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/flowCore/timeFilter-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: timeFilter-class
> ### Title: Class "timeFilter"
> ### Aliases: timeFilter-class timeFilter timeFilter-class
> ### show,timeFilter-method
> ### Keywords: classes methods
>
> ### ** Examples
>
>
> ## Loading example data
> data(GvHD)
> dat <- GvHD[1:10]
>
> ## create the filter
> tf <- timeFilter("SSC-H", bandwidth=1, filterId="myTimeFilter")
> tf
time filter 'myTimeFilter' with settings:
bandwidth=1
>
> ## Visualize problems
> ## Not run:
> ##D library(flowViz)
> ##D timeLinePlot(dat, "SSC-H")
> ## End(Not run)
>
> ## Filtering using timeFilters
> fres <- filter(dat, tf)
> fres[[1]]
A filterResult produced by the filter named 'myTimeFilter'
> summary(fres[[1]])
myTimeFilter+: 3420 of 3420 events (100.00%)
> summary(fres[[7]])
myTimeFilter+: 12104 of 13979 events (86.59%)
>
> ## The result of rectangle filtering is a logical subset
> cleanDat <- Subset(dat, fres)
>
> ## Visualizing after cleaning up
> ## Not run:
> ##D timeLinePlot(cleanDat, "SSC-H")
> ## End(Not run)
>
> ## We can also split, in which case we get those events in and those
> ## not in the gate as separate populations
> allDat <- split(dat[[7]], fres[[7]])
>
> par(mfcol=c(1,3))
> plot(exprs(dat[[7]])[, "SSC-H"], pch=".")
> plot(exprs(cleanDat[[7]])[, "SSC-H"], pch=".")
> plot(exprs(allDat[[2]])[, "SSC-H"], pch=".")
>
>
>
>
>
>
> dev.off()
null device
1
>