filter-methods: Filter FCS files

filter-methodsR Documentation

Filter FCS files

Description

These methods link filter descriptions to a particular set of flow cytometry data allowing for the lightweight calculation of summary statistics common to flow cytometry analysis.

Usage

filter(x, filter, method = c("convolution", "recursive"), 
sides = 2L, circular = FALSE, init = NULL)

Arguments

x

Object of class flowFrame or flowSet.

filter

An object of class filter or a named list filters.

method, sides, circular, init

These arguments are not used.

Details

The filter method conceptually links a filter description, represented by a filter object, to a particular flowFrame. This is accomplished via the filterResult object, which tracks the linked frame as well as caching the results of the filtering operation itself, allowing for fast calculation of certain summary statistics such as the percentage of events accepted by the filter. This method exists chiefly to allow the calculation of these statistics without the need to first Subset a flowFrame, which can be quite large.

When applying on a flowSet, the filter argument can either be a single filter object, in which case it is recycled for all frames in the set, or a named list of filter objects. The names are supposed to match the frame identifiers (i.e., the output of sampleNames(x) of the flowSet. If some frames identifiers are missing, the particular frames are skipped during filtering. Accordingly, all filters in the filter list that can't be mapped to the flowSet are ignored. Note that all filter objects in the list must be of the same type, e.g. rectangleGates.

Value

A filterResult object or a filterResultList object if x is a flowSet. Note that filterResult objects are themselves filters, allowing them to be used in filter expressions or Subset operations.

Author(s)

F Hahne, B. Ellis, N. Le Meur

See Also

Subset, filter, filterResult

Examples


## Filtering a flowFrame
samp <- read.FCS(system.file("extdata","0877408774.B08", package="flowCore"))
rectGate <- rectangleGate(filterId="nonDebris","FSC-H"=c(200,Inf))
fr <- filter(samp,rectGate)
class(fr)
summary(fr)

## filtering a flowSet
data(GvHD)
foo <- GvHD[1:3]
fr2 <- filter(foo, rectGate)
class(fr2)
summary(fr2)

## filtering a flowSet using different filters for each frame
rg2 <- rectangleGate(filterId="nonDebris","FSC-H"=c(300,Inf))
rg3 <- rectangleGate(filterId="nonDebris","FSC-H"=c(400,Inf))
flist <- list(rectGate, rg2, rg3)
names(flist) <- sampleNames(foo)
fr3 <- filter(foo, flist)


RGLab/flowCore documentation built on Aug. 26, 2024, 8:52 a.m.