deGate: 1D density gating method

Description Usage Arguments Value Author(s) Examples

View source: R/flowDensity_methods.R

Description

Find the best threshold for a single channel in flow cytometry data based on its density distribution.

Usage

1
2
3
deGate(flow.frame, channel, n.sd=1.5, use.percentile = FALSE, 
		percentile = 0.95,use.upper=FALSE, upper = NA, talk=TRUE, alpha = 0.1, 
		sd.threshold = FALSE, graphs = FALSE, all.cuts = FALSE, tinypeak.removal=1/25, adjust.dens=1)

Arguments

flow.frame

a 'FlowFrame' object.

channel

a channel's name or its corresponding index in the 'flow.frame'.

n.sd

an integer coefficient for the standard deviation to determine the threshold based on the standard deviation if 'sd.threshold' is TRUE.

use.percentile

if TRUE, forces to return the 'percentile'th threshold.

percentile

a value in [0,1] that is used as the percentile. The default value is 0.95.

upper

if TRUE, finds the change in the slope at the tail of the density curve, if FALSE, finds it at the head. Default value is set to 'NA'.

use.upper

Logical. If TRUE, forces to return the inflection point based on the first (last) peak if upper=F (upper=T). Default value is set to 'FALSE'

talk

Logical. If TRUE, Prints a message if only one peak is found, or when inflection point is used to set the gates.

alpha

a value in [0,1) specifying the significance of change in the slope being detected. This is by default 0.1, and typically need not be changed.

sd.threshold

if TRUE, uses 'n.sd' times standard deviation as the threshold. Default value is set to 'FALSE'.

graphs

if TRUE, generates density distribution plot plus its corresponding threshold.

all.cuts

if TRUE, returns all the identified cutoff points, i.e. potential thresholds for that channel. Default value is set to 'FALSE'.

tinypeak.removal

A number in [0,1] to exclude/include tiny peaks in density distribution.

adjust.dens

The smoothness of density in [0,Inf] to be used in density(.). The default value is 1 and should not be changed unless necessary

Value

an integer value (vector) of cutoff(s), i.e. threshold(s), on the specified channel

Author(s)

Jafar Taghiyar <jtaghiyar@bccrc.ca>

Examples

1
2
3
4
5
6
7
data_dir <- system.file("extdata", package = "flowDensity")
load(list.files(pattern = 'sampleFCS_1', data_dir, full = TRUE))
#Find the threshold for CD20
cd19.gate <- deGate(f,channel="PerCP-Cy5-5-A")
# Gate out the CD20- populations using the notSubFrame
plotDens(f,c("APC-H7-A","PerCP-Cy5-5-A"))
abline(h=cd19.gate,lty=3,col=2)

flowDensity documentation built on May 31, 2017, 3:23 p.m.

Search within the flowDensity package
Search all R packages, documentation and source code