linearGate: Create Gate for Single Cells

Description Usage Arguments Details Value Examples

View source: R/linearGate.R

Description

Fit a narrow rectangular gate to select single cells in a 2-D plot of area x height

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
linearGate(
  x,
  xchan = "FL2.A",
  ychan = "FL2.H",
  zero.intercept = TRUE,
  width = 0.05,
  xRange = NULL,
  gRange = TRUE,
  filterId = "singlets",
  groupFilterId = "singletsGateList"
)

Arguments

x

Either a matrix from exprs, a flowFrame, or a flowSet

xchan, ychan

Character strings identifying the data to search for single cells with default values of "FL2.A" and "FL2.H"

zero.intercept

If TRUE (the default), force the regression used to identify the singlets through the origin

width

The width (narrow dimension) of the rotated rectangular gate expressed as either as a fraction of the instrument data range for the xchan parameter (if less than 1) or the absolute width of the gate in the same units as xchan, if greater than 1

xRange

A numeric value of length two to specify the upper and lower percentile of the data in xchan to be used for the regression. If NULL, a default value of c(0.025, 0.975) will be used

gRange

A logical value or a numeric vector of length 2 to specify limits on the dimension of the returned gate. The limits can be specified by quantiles or absolute values. See the Details section for more information

filterId

Character string with default value of "singlets" for successful fits. An unsuccessful fit is labeled "unfiltered"

groupFilterId

Character string with default value of "singletsGateList"

Details

This function creates a data-driven gate to select single cells from area and height values collected on a linear scale. A robust linear regression is fit to the data with lqs. This regression is used to create a narrow rectangular gate centered about the single cells. If zero.intercept = TRUE, the regression is forced through origin. By default, the regression is applied to values within the 2.5 to 97.5 percentiles of data in channel xchan. Other percentiles can be specified with the argument xRange.

The resulting polygonGate(s) will be limited to the range of values specified by gRange. If gRange = TRUE, the gate will be limited to the 2.5 to 97.5 percentile of all data in channel xchan. If gRange = FALSE, the gate will span the full range of data. If gRange is a numeric vector of values less than or equal to 1, gRange will be treated as the percentiles to limit the gate. If gRange is a numeric vector with values greater than 1, gRange will be interpreted as the lower and upper limits of the gate in the xchan dimension.

Since this is typically used for cell cycle analysis with DNA content, the default parameters are xchan = "FL2.A" and ychan = "FL2.H"

Value

A rectangular polygonGate or list of these gates.

Examples

1
2
3
4
5
6
# Read synchronized cell data
  fs <- readSet(system.file("extdata", "synch/", package = "flowExtra"))
  lg <- linearGate(fs) # default settings
  xyplot(FL2.H ~ FL2.A, fs[1:4], filter = lg[1:4], stats = TRUE)
  lg2 <- linearGate(fs, width = 0.02, gRange = c(75, 750))
  xyplot(FL2.H ~ FL2.A, fs[1:4], filter = lg2[1:4], stats = TRUE)

ornelles/flowExtra documentation built on March 1, 2020, 9:33 a.m.