s3vmLabel: Returns the final label assignments for a parameter using a...

View source: R/s3vmLabel.R

s3vmLabelR Documentation

Returns the final label assignments for a parameter using a semi-supervised support vector machine

Description

Returns the final label assignments for a parameter using a semi-supervised support vector machine

Usage

s3vmLabel(
  x,
  type = c("bead", "doublet", "debris", "dead"),
  loss = c("auc", "class"),
  n = 4000,
  standardize = TRUE
)

Arguments

x

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

type

Identifies the type of label that is being modeled. Must be 'bead', 'doublet', 'debris', or 'dead'.

loss

Specifies the type of loss used to tune the SVM. Can be either "auc" for the area under the curve or "class" for classification error.

n

number of observations in training dataset.

standardize

Indicates if the data should be standardized. Because the data are on different scales, it should be standardized for this analysis because the variables are on different scales.

Details

s3vmLabel uses a semi-supervised support vector machine to compute the final labels for the specified parameter type (bead, doublet, debris, or dead). The model is initially computed using only the data specified in the index argument. Events are iteratively added to this set when the updated SVM predicts a label with high confidence. Then predicted values are computed for all of the observations in x. If the predicted probability for the label type is greater than 0.5, the label is changed to the specified type. However, if an observation already has a label other than 'cell' in the labels$label variable, it will not be changed. The predicted probabilities for all of the observations is 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

An updated SingleCellExperiment is returned with the labels for the parameter of interest (bead, doublet, debris, or dead) added to the label object of the SingleCellExperiment and the probabilities for the event type added to the probs object of the SingleCellExperiment.

Examples

data("raw_data", package = "CATALYST")
sce <- readCytof(raw_data, beads = "Beads", viability = c("cisPt1", "cisPt2"))
sce <- initialBead(sce)
sce <- svmLabel(sce, type = "bead", loss = "auc")
head(probs(sce))
table(label(sce))


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