peakFind: Find G1 and G2/M peaks

Description Usage Arguments Details Value Examples

View source: R/peakFind.R

Description

Find G1 and G2/M (and other) peaks in linear values

Usage

1
2
3
4
5
6
7
8
9
peakFind(
  x,
  chan = "FL2.A",
  darg = list(bw = "nrd0", n = 512),
  range.search = NULL,
  probs = c(0.05, 0.95),
  bwFac = 2,
  gridsize = rep(401, 2)
)

Arguments

x

A flowFrame or flowSet with the parameter named in chan or a numeric vector or matrix (see Details)

chan

The name of the data to be evaluated in x

darg

List of arguments passed to the kernel density estimating function (stats::density()) used to find peaks

range.search

An optional numeric vector of length 2 setting the range of values in chan to search for peaks. The default value of NULL limits the search to the range defined by the quantiles specified in probs

probs

Numeric vector of length 2 defining the lower and upper quantiles to set the value for range.search if not provided

bwFac, gridsize

Numeric values of length 1 and 2 used by flowStats::curv1Filter() to identify regions of 1-D curvature in the data (bwFac increased from default of 1.2 to 2)

Details

This function identifies the probable location of the G1 and G2/M peaks in the channel identified by chan in either a flowFrame or flowSet or "raw" values as described below. Areas of local high density are first identified by flowStats::curv1Filter() with arguments in bwFac and gridsize. The values are the default values for by curv1Filter(). The peak location within each local area of high density is identified from a kernel density estimate stats::density() using arguments passed in the list darg. Peak positions are returned as an array of two or more columns.

If range.search is NULL, peaks are accepted in the range of data spanning 5th to 95th percentile or as specified by the percentile values in probs. For well-behaved data, range.search can be set to c(50, 500) to exclude apoptotic and polyploid populations.

If exactly two peaks are found, they will be labeled "G1" and "G2". If a mixture of one and two peaks are found, the single peak will be treated as the "G1" peak and the "G2" peak will be assigned an NA value. If only one peak is found or if more than two peaks are found, the peaks will be labeled as "peak1", "peak2", "peak3", etc. A warning message will report finding other than 2 peaks.

The argument x can also be a matrix or numeric vector of "raw" values which will be coerced into a matrix. If the name of a column (or vector) is chan, that parameter will be analyzed. If the matrix or vector is not named, the first column will be analyzed.

Value

An 2-D array with row names obtained from flowCore::identifier() and column names determined as described above.

Examples

1
2
3
 fs <- readSet(system.file("extdata", "synch/", package = "flowExtra"))
 peakFind(fs) # find all by default
 peakFind(fs[9:16]) # paired peaks are labeled "G1" and "G2"

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