Learn R Programming

Seurat (version 2.1.0)

ClassifyCells: Classify New Data

Description

Classify new data based on the cluster information of the provided object. Random Forests are used as the basis of the classification.

Usage

ClassifyCells(object, classifier, training.genes = NULL,
  training.classes = NULL, new.data = NULL, ...)

Arguments

object

Seurat object on which to train the classifier

classifier

Random Forest classifier from BuildRFClassifier. If not provided, it will be built from the training data provided.

training.genes

Vector of genes to build the classifier on

training.classes

Vector of classes to build the classifier on

new.data

New data to classify

...

additional parameters passed to ranger

Value

Vector of cluster ids

Examples

Run this code
# NOT RUN {
pbmc_small
# take the first 10 cells as test data and train on the remaining 70 cells
test.pbmc <- SubsetData(object = pbmc_small, cells.use = pbmc_small@cell.names[1:10])
train.pbmc <- SubsetData(object = pbmc_small, cells.use = pbmc_small@cell.names[11:80])
predicted.classes <- ClassifyCells(
  object = train.pbmc,
  training.classes = train.pbmc@ident,
  new.data = test.pbmc@data
)

# }

Run the code above in your browser using DataLab