gate_flowclust_1d: Applies flowClust to 1 feature to determine a cutpoint...

View source: R/gating-functions.R

gate_flowclust_1dR Documentation

Applies flowClust to 1 feature to determine a cutpoint between the minimum cluster and all other clusters.

Description

We cluster the observations in fr into K clusters.

Usage

gate_flowclust_1d(
  fr,
  params,
  filterId = "",
  K = NULL,
  trans = 0,
  min.count = -1,
  max.count = -1,
  nstart = 1,
  prior = NULL,
  criterion = c("BIC", "ICL"),
  cutpoint_method = c("boundary", "min_density", "quantile", "posterior_mean",
    "prior_density"),
  neg_cluster = 1,
  cutpoint_min = NULL,
  cutpoint_max = NULL,
  min = NULL,
  max = NULL,
  quantile = 0.99,
  quantile_interval = c(0, 10),
  plot = FALSE,
  debug = FALSE,
  ...
)

Arguments

fr

a flowFrame object

params

character channel to be gated on

filterId

A character string that identifies the filter created.

K

the number of clusters to find

trans, min.count, max.count, nstart

some flowClust parameters. see flowClust

prior

list of prior parameters for the Bayesian flowClust. If NULL, no prior is used.

criterion

a character string stating the criterion used to choose the best model. May take either "BIC" or "ICL". This argument is only relevant when K is NULL or if length(K) > 1. The value selected is passed to flowClust.

cutpoint_method

How should the cutpoint be chosen from the fitted flowClust model? See Details.

neg_cluster

integer. The index of the negative cluster. The cutpoint is computed between clusters neg_cluster and neg_cluster + 1.

cutpoint_min

numeric value that sets a minimum thresold for the cutpoint. If a value is provided, any cutpoint below this value will be set to the given minimum value. If NULL (default), there is no minimum cutpoint value.

cutpoint_max

numeric value that sets a maximum thresold for the cutpoint. If a value is provided, any cutpoint above this value will be set to the given maximum value. If NULL (default), there is no maximum cutpoint value.

min

a numeric value that sets the lower bound for data filtering. If NULL (default), no truncation is applied.

max

a numeric value that sets the upper bound for data filtering. If NULL (default), no truncation is applied.

quantile

the quantile for which we will find the cutpoint using the quantile cutpoint_method. If the cutpoint_method is not set to quantile, this argument is ignored.

quantile_interval

a vector of length 2 containing the end-points of the interval of values to find the quantile cutpoint. If the cutpoint_method is not set to quantile, this argument is ignored.

plot

logical value indicating that the fitted flowClust model should be plotted along with the cutpoint

debug

logical indicating whether to carry the prior and posterious with the gate for debugging purpose. Default is FALSE.

...

additional arguments that are passed to flowClust

Details

By default, the cutpoint is chosen to be the boundary of the first two clusters. That is, between the first two cluster centroids, we find the midpoint between the largest observation from the first cluster and the smallest observations from the second cluster. Alternatively, if the cutpoint_method is min_density, then the cutpoint is the point at which the density between the first and second smallest cluster centroids is minimum.

Value

a rectangleGate object consisting of all values beyond the cutpoint calculated

Examples

## Not run: 
 gate <- gate_flowclust_1d(fr, params = "APC-A", K =2) # fr is a flowFrame

## End(Not run)

RGLab/openCyto documentation built on Nov. 7, 2024, 9:23 p.m.