labelQC: Returns the final label assignments the specified parameters

View source: R/labelQC.R

labelQCR Documentation

Returns the final label assignments the specified parameters

Description

Returns the final label assignments the specified parameters

Usage

labelQC(
  x,
  model = c("svm", "rf", "gbm"),
  type = c("all", "bead", "doublet", "debris", "dead"),
  nTrain = 4000,
  loss = c("auc", "class")
)

Arguments

x

A SingleCellExperiment created with readCytof with the scores and initial columns filled out for the event type of interest.

model

Type of model to use to do the labeling. Options are "svm" for a support vector machine, "gbm" for a gradient boosting machine, or "rf" for a random forest.

type

Types of events to model. Options are "all", "bead", "doublet", "debris", and "dead".

nTrain

The (maximum) number of data points to use when training a model to predict event types.

loss

Specifies the type of loss used to tune the GBM. Can be either "auc" for the area under the curve or "class" for classification error. This argument is ignored if random forest is used as the model.

Details

labelQC uses a support vector machine, gradient boosting machine, or a random forest to compute the final labels for the specified parameter types (bead, doublet, debris, or dead). The predicted probabilities for all of the observations are stored in the variable associated with that type for further analysis. Thus, it is possible to have a probability greater than 0.5 for 'debris' but still have a label of 'bead' if an observation was classified as a bead prior to classifying the debris.

Value

A SingleCellExperiment data.frame is returned with the labels for the parameters of listed in types (bead, doublet, debris, or dead) added to the label variable and the probabilities for each of the columns pertaining to the parameters listed in probs.

Examples

data("raw_data", package = "CATALYST")
sce <- readCytof(raw_data, beads = "Beads", viability = c("cisPt1", "cisPt2"))
sce <- labelQC(sce)
table(label(sce))


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