Learn R Programming

Seurat (version 2.1.0)

NumberClusters: Convert the cluster labels to a numeric representation

Description

Convert the cluster labels to a numeric representation

Usage

NumberClusters(object)

Arguments

object

Seurat object

Value

Returns a Seurat object with the identities relabeled numerically starting from 1.

Examples

Run this code
# NOT RUN {
# Append "Cluster_" to cluster IDs to demonstrate numerical conversion
new.cluster.labels <- paste0("Cluster_", pbmc_small@ident)
pbmc_small <- SetIdent(
  object = pbmc_small,
  cells.use = pbmc_small@cell.names,
  ident.use = new.cluster.labels
)
unique(pbmc_small@ident)
# Now relabel the IDs numerically starting from 1
pbmc_small <- NumberClusters(pbmc_small)
unique(pbmc_small@ident)

# }

Run the code above in your browser using DataLab