I'm trying to rename my clusters in a Seurat
object.
my old cluster IDs are numers
Idents(seuObj) <- 'RNA_snn_res.0.1'
levels(seuObj)
[1] "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10" "11" "12" "13" "14" "15"
I would like to assign the clusters names from a named vector
Following the vignette from the web site I tried to assign the vector to the numbers -
cluster_ids <- c("DC2_genes", "mregDC_genes", "mregDC_genes", "Bcell_genes",...)
names(cluster_ids) <- levels(seuObj)
seuObj <- RenameIdents(seuObj, cluster_ids)
But this just assigns numbers to the new Idents
head(Idents(seuObj))
C7_AAACCCAAGGGTGGGA-1 C7_AAACCCAAGTAGCATA-1 C7_AAACCCACAAGAGGTC-1 C7_AAACCCACAGTCTCTC-1 C7_AAACCCACATGAATCC-1
0.346464052287582 0.177389184397163 0.132815134099617 0.300105882352941 0.497196167423096
C7_AAACCCAGTAGAGGAA-1
0.335241176470588
What am I doing wrong here?
Don't understand this comment. I don't have any columns with this name.