# Seurat Dimplot with different clustering IDs

In Seurat metadata I have assigned cells to some cell types with different resolutions

I have added the cluster identities to the object via Idents:

 Idents(control) <- a$predicted.celltype.l1  I then added another clustering in the same way:  Idents(control) <- a$predicted.celltype.l2


Dimplot will now show the new identities:

How I can ask Dimplot to plot the clustering I want for example if I want to show predicted.celltype.l1 again (something like changing the default)?

The thing to tweak is the group.by argument of the Dimplot function.

It looks like you've already tried this in your attempts at solving a different problem.

The main thing you need to be aware of is that each new clustering needs to be saved as a separate metadata variable in order to do this. As I mentioned in one of my previous answers, I like to use the [[X]] notation for this:

control[["predicted.celltype.l1"]] <- a$$predicted.celltype.l1 control[["predicted.celltype.l2"]] <- a$$predicted.celltype.l2


Then you should be able to use both in the group.by argument:

DimPlot(control, reduction = "umap", group.by = "predicted.celltype.l1")
DimPlot(control, reduction = "umap", group.by = "predicted.celltype.l2")