In Seurats
' documentation for FindClusters()
function it is written that for around 3000
cells the resolution
parameter should be from 0.6
and up to 1.2
. I am wondering then what should I use if I have 60 000
cells? How to determine that?
3 Answers
Assuming you have an informative selection of variable genes from which you have constructed a number of useful PCs, I'd run a number of iterations with FindClusters()
as described in the other answer, then choose a level which overclusters the dataset (for example, clusters that are visibly separate on a t-SNE or other dimensionality reduction plot should definitely have their own number):
seuratobject <- SetAllIdent(seuratobject, id='chosen.resolution')
Then run:
Seurat::BuildClusterTree()
Seurat::FindAllMarkersNode()
Assessing the cluster markers for each node will hopefully give you a good idea on which clusters should be combined. Then you can "combine" the clusters and re-label the cells using something like:
library(plyr)
cell.labels <- seuratobject@ident
cell.labels <- mapvalues(cell.labels,
from=0:16, # cluster numbers
to=c('A', 'B', 'C', 'C', 'D', 'E', 'E', ... )) # etc
seuratobject <- AddMetaData(seuratobject, cell.labels, 'Combined.clusters')
The usefulness of the clustering will very much depend on the selection of variable genes, therefore, depending on the (diversity of the) dataset, you will want to experiment with selection parameters or subset the dataset and repeat the above procedure.
-
$\begingroup$ Hi, I am using Seurat and URD; Let's say both give 3 clusters on 200 cells, however seurat gives stronger marker genes for these clusters whereas URD gives very weak marker genes. I really got puzzled which of Seurat or URD cluster my 200 more proper? Is there any way to judge them? As I know, I just noticed Seurat clusters make more sense biologically :( :( But if seurat is right in clustering, why I am not able to reproduce clusters by URD? $\endgroup$ Oct 5, 2018 at 16:52
That is a very general recommendation. Depending on your experiment, you can get a very different number of clusters with the same number of cells at the same resolution.
You can actually use a vector of different resolutions and see which one performs best:
pbmc_small <- FindClusters(
object = pbmc_small,
reduction.type = "pca",
resolution = c(0.4, 0.8, 1.2),
dims.use = 1:10,
save.SNN = TRUE
)
-
$\begingroup$ What does it mean best? How to assess it? There will be different number of clusters, but I do not know which number is correct. $\endgroup$ May 14, 2018 at 20:42
-
5$\begingroup$ There is no software tool that will tell you what is the best number of clusters. You will have to check the expression of known genes or cluster markers to determine which clusters make the most biological sense. This step is probably the most difficult part of single-cell analysis. $\endgroup$– burgerMay 14, 2018 at 20:50
Have a look into clustree to assess the different clusters by clustering them and see different levels.
Example:
library(clustree)
data("iris_clusts")
# plot the tree of clusters
# K1 to K5 correspond to different clustering resolutions
clustree(iris_clusts, prefix = "K")
Using the stability index to assess clusters
The stability index from the SC3 package (Kiselev et al. 2017) measures the stability of clusters across resolutions. The stability index is automatically calculated when a clustering tree is built. Note that each level of clustering corresponds to a different resolution.
clustree(iris_clusts, prefix = "K", node_colour = "sc3_stability")
-
$\begingroup$ Hi Samad, thanks for joining us at Bioinfo.SE. "different clusters by clustering them and see different levels ..." sounds rather confusing, and also it's not directly answering the original question? How does this package help to find a resolution parameter? $\endgroup$ Jun 6, 2019 at 11:58
-
$\begingroup$ I used it to assess all resolution values by plotting the clusters tree and see at which resolution the groups of cells are well defined. $\endgroup$ Jun 12, 2019 at 9:41
-
1$\begingroup$ What I meant is, that your answer seems on spot, but a reader could use a bit more detail, so I wanted to encourage you to edit it and add a sentence or two explaining how can clustree be used to get a good value of resolution (i.e. what you wrote in the comment). $\endgroup$ Jun 12, 2019 at 11:12
-
$\begingroup$ I add more details now, I hope it can help ! $\endgroup$ Jun 12, 2019 at 13:16
-
1