Learn R Programming

flowCore (version 1.38.2)

polygonGate-class: Class "polygonGate"

Description

Class and constructor for 2-dimensional polygonal filter objects.

Usage

polygonGate(..., .gate, boundaries, filterId="defaultPolygonGate")

Arguments

filterId
An optional parameter that sets the filterId of this gate.
.gate, boundaries
A definition of the gate. This can be either a list or a named matrix as described below. Note the argument boundaries is deprecated and will go away in the next release.
...
You can also directly describe a gate without wrapping it in a list or matrix, as described below.

Value

Returns a polygonGate 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

boundaries:
Object of class "matrix". The vertices of the polygon in two dimensions. There need to be at least 3 vertices specified for a valid polygon.
parameters:
Object of class "character", describing the parameter 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("polygonGate", ...) or by using the constructor polygonGate. Using the constructor is the recommended way of object instantiation:

Methods

%in%
signature(x = "flowFrame", table = "polygonGate"): 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 = "polygonGate"): Print information about the filter.

Details

Polygons are specified by the coordinates of their vertices in two dimensions. The constructor is designed to be useful in both direct and programmatic usage. It takes either a list or a named matrix with 2 columns and at least 3 rows containing these coordinates. Alternatively, vertices can be given as named arguments, in which case the function tries to convert the values into a matrix.

See Also

flowFrame, rectangleGate, ellipsoidGate, polytopeGate, filter for evaluation of rectangleGates and split and Subsetfor splitting and subsetting of flow cytometry data sets based on that.

Examples

Run this code

## Loading example data
dat <- read.FCS(system.file("extdata","0877408774.B08",
package="flowCore"))

## Defining the gate
sqrcut <- matrix(c(300,300,600,600,50,300,300,50),ncol=2,nrow=4)
colnames(sqrcut) <- c("FSC-H","SSC-H")
pg <- polygonGate(filterId="nonDebris", boundaries= sqrcut)
pg

## Filtering using polygonGates
fres <- filter(dat, pg)
fres
summary(fres)

## The result of polygon filtering is a logical subset
Subset(dat, fres)

## We can also split, in which case we get those events in and those
## not in the gate as separate populations
split(dat, fres)

Run the code above in your browser using DataLab