Learn R Programming

openCyto (version 1.10.3)

flowClust.1d: 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

flowClust.1d(fr, params, filterId = "", K = NULL, trans = 0,
  positive = TRUE, 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
numeric indicating whether the Box-Cox transformation parameter is estimated from the data. May take 0 (no estimation), 1 (estimation) or 2 (cluster-specific estimation). NOTE: for the Bayesian version of flowClust, this value cannot be 2.
positive
If TRUE, then the gate consists of the entire real line to the right of the cutpoint. Otherwise, the gate is the entire real line to the left of the cutpoint. (Default: TRUE)
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

Value

  • a rectangleGate object consisting of all values beyond the cutpoint calculated

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.

Examples

Run this code
gate <- flowClust.1d(fr, params = "APC-A", K =2) # fr is a flowFrame

Run the code above in your browser using DataLab