initialGuess: General preliminary classification.

View source: R/initialGuess.R

initialGuessR Documentation

General preliminary classification.

Description

General preliminary classification.

Usage

initialGuess(x, middleGroup = c(0, -1, 1), bead = FALSE)

Arguments

x

The score (ie. debris score, doublet score, etc.) to be used for predicting each event's label (eg. "doublet" vs. "cell").

middleGroup

numeric. When the optimal model (according to BIC) is the 3-component mixture model, this argument determines how to assign the middle group. Possible values are -1 for "cell", 0 (default) for "indeterminate", and 1 for the event type of interest (eg. "doublet").

bead

logical. Should be TRUE when classifying beads. The bead score sometimes has a larger peak for for the group that contains the beads. This results in a misclassification of the beads that can make the algorithm unable to find the beads. An adjustment is made to ensure this does not happen, but it should only be applied for bead classification. If the correction is used for other event types, they may be misclassified.

Value

A list with the following elements:

  • label A vector of the same length as x providing the labels (-1 for cells, 1 for non-cells, 0 for uncertain).

  • fit1 Summary of the 1-component (half Normal) model fit.

  • fit2 Summary of the 2-component (half Normal + Normal) model fit.

  • fit1 Summary of the 3-component (half Normal + 2 Normals) model fit.

Examples

data("raw_data", package = "CATALYST")
sce <- readCytof(raw_data, beads = "Beads", viability = c("cisPt1", "cisPt2"))
sce <- initialBead(sce)
fit <- initialGuess(scores(sce, "bead"), bead = TRUE)
sce <- initialDoublet(sce)
fit <- initialGuess(scores(sce, "doublet"))


jillbo1000/cytofQC documentation built on Aug. 23, 2023, 9:47 p.m.