I'm working on a Seurat object and want to name the clusters according to 2 values alone (yes/no). So I want to add a new column to metadata and annotate the clusters (UMAP) with it.

orig.ident nCount_RNA nFeature_RNA percent.mito RNA_snn_res.0.6 seurat_clusters
BC01_02       BC01   999789.2         9225 0.2385090196               6               6
BC01_03       BC01   999776.9         9568 0.2925109851               6               6
BC01_04       BC01   999595.1         7482 0.0009888404               6               6
BC01_05       BC01   999992.0         8301 0.3801925053               6               6

I want to add a new column imported from a csv file that contains the row.names same as the meta.data with the status column as yes and no.

status
BC01_02           yes
BC01_03           yes
BC01_04           yes
BC01_05           yes

After adding the column, I want to name the clusters with yes or no, how is it possible?

To add the column status can try the following:

B@meta.data$status <- status[row.names(B@meta.data),]$status

To rename the clusters you can try the following:

B@meta.data$seurat_clusters <- B@meta.data$status

However, I think the plotting functions in Seurat do not use the cluster information from B@meta.data, rather they use information from B@active.idents. So, I guess you have to do the following instead:

B@active.idents <-  B@meta.data\$status

This should work, but, I will verify and update this answer later.

• Thank you! It worked! B@active.idents worked for renaming the clusters! – Najeha Mohamed Jul 21 '20 at 12:03