Predicts cell classes for a new dataset based on trained model(s)

scPredict(
  new,
  reference,
  threshold = 0.55,
  max.iter.harmony = 20,
  recompute_alignment = TRUE,
  seed = 66
)

Arguments

new

A seurat object containing cells to be classified

reference

A Seurat object with trained model(s) using scPred or an scPred object

threshold

Threshold used for probabilities to classify cells into classes. All cells below this threshold value will be labels as "unassigned". In the case of binary classification (two cell tyoes), a threshold of 0.5 will force all cells to be classified to any of the two cell types. For multi-class classification, if there's no probability higher than the threshold associated to a cell type, this will be labelled as "unassigned"

max.iter.harmony

Maximum number of rounds to run Harmony. One round of Harmony involves one clustering and one correction step.

recompute_alignment

Recompute alignment? Useful if scPredict() has already been run

seed

Numeric seed for harmony

Value

A Seurat object with additional metadata columns with prediction probabilities associated to each class, a prediction column, indicating the classification based on the provided threshold and a generic_class column without "unassigned" labels. Additionally, two new reductions are returned:

  • scpred: Aligned data using harmony

  • scpred_projection: Raw projection using reference loadings

Author

José Alquicira Hernández