# How to split a Seurat cluster in several subclusters?

I've analyzed my scRNA-seq data and have a couple of Seurat clusters that show more than one cell type in each cluster. (for example, cluster 9 shows both NK and CD4 cells) How can I split a cluster into subclusters, based on the gene expression?

Increase the clustering resolution parameter to generate more (smaller) clusters, see FindClusters in the Seurat docs. Whether or not this will neatly, split your clusters into subclusters depends on your data, but normally one can easily separate CD4 and NK cells from PBMCs. See also the Clustree approach for determining the optimal resolution.

Alternatively/additionally use a cell type annotation approach that does not require clustering, e.g. Seurat V4 permits reference mapping and there are many other methods too

I've done sub-clustering a few times on my Seurat data sets. The approach I take is to subset the clusters that need to be clustered (i.e. using subset), carry out a clustering of only those cells, then transfer the subcluster labels back to the original dataset. Here's some rough code, which will need to be modified for your specific situation and code preferences:

data.sc[["main.cluster"]] <- Idents(data.sc);
clusterToSubset <- "B cells";
data.sub <- subset(data.sc, subset = main.cluster == clusterToSubset);
## ** [Cluster data.sub] **
Idents(data.sc) <- "main.cluster";
## This should work as long as cell order (i.e. column names) isn't changed
Idents(data.sc, cells=colnames(data.sc) %in% colnames(data.sub)) <-
paste0("Sub_", Idents(data.sub));
data.sc[["merged.cluster"]] <- Idents(data.sc);


This approach will work with multiple sub-clusters as well by changing the label that is pasted onto the sub-cluster idents:

data.sc[["main.cluster"]] <- Idents(data.sc);
clusterToSubset1 <- "B cells";
data.sub.1 <- subset(data.sc, subset = main.cluster == clusterToSubset1);
## ** [Cluster data.sub.1] **
clusterToSubset2 <- "T cells";
data.sub.2 <- subset(data.sc, subset = main.cluster == clusterToSubset2);
## ** [Cluster data.sub.2] **
Idents(data.sc) <- "main.cluster";
## This should work as long as cell order (i.e. column names) isn't changed
Idents(data.sc, cells=colnames(data.sc) %in% colnames(data.sub.1)) <-
paste0("Sub1_", Idents(data.sub.1));
Idents(data.sc, cells=colnames(data.sc) %in% colnames(data.sub.2)) <-
paste0("Sub2_", Idents(data.sub.2));
data.sc[["merged.cluster"]] <- Idents(data.sc);