<p>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.</p>
<p>You can actually use a vector of different resolutions and see which one performs best:</p>
<pre><code>pbmc_small &lt;- FindClusters(
  object = pbmc_small,
  reduction.type = &quot;pca&quot;,
  resolution = c(0.4, 0.8, 1.2),
  dims.use = 1:10,
  save.SNN = TRUE
)
</code></pre>
<p>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.</p>

CC BY-SA 4.0
2018-05-14T19:17:48.590Z
2024-01-04T21:18:50.860Z
2024-01-04T21:18:50.860Z
burger
<p>Have a look into <a href="https://cran.r-project.org/web/packages/clustree/vignettes/clustree.html" rel="nofollow noreferrer">clustree</a> to assess the different clusters by clustering them and see different levels.</p>
<h3>Example:</h3>
<pre><code>library(clustree)
data(&quot;iris_clusts&quot;)

# plot the tree of clusters
# K1 to K5 correspond to different clustering resolutions
clustree(iris_clusts, prefix = &quot;K&quot;)
</code></pre>
<h3>Using the stability index to assess clusters</h3>
<p>The stability index from the SC3 package (<a href="https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5410170/" rel="nofollow noreferrer">Kiselev et al. 2017</a>) 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.</p>
<pre><code>clustree(iris_clusts, prefix = &quot;K&quot;, node_colour = &quot;sc3_stability&quot;)
</code></pre>
<p><a href="https://i.sstatic.net/DKT34.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/DKT34.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2019-06-06T08:08:33.160Z
2022-01-06T07:10:32.537Z
2022-01-06T07:10:32.537Z
Samad Elka
<p>Assuming you have an informative selection of variable genes from which you have constructed a number of <strong>useful</strong> PCs, I'd run a number of iterations with <code>FindClusters()</code> as described in the other answer, then choose a level which <strong>overclusters</strong> the dataset (for example, clusters that are visibly separate on a t-SNE or other dimensionality reduction plot should definitely have their own number):</p>

<pre><code>seuratobject &lt;- SetAllIdent(seuratobject, id='chosen.resolution')
</code></pre>

<p>Then run:</p>

<pre><code>Seurat::BuildClusterTree()
Seurat::FindAllMarkersNode()
</code></pre>

<p>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:</p>

<pre><code>library(plyr)
cell.labels &lt;- seuratobject@ident
cell.labels &lt;- mapvalues(cell.labels,
  from=0:16, # cluster numbers
  to=c('A', 'B', 'C', 'C', 'D', 'E', 'E', ... )) # etc

seuratobject &lt;- AddMetaData(seuratobject, cell.labels, 'Combined.clusters')
</code></pre>

<p>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 <strong>experiment with selection parameters</strong> or <strong>subset the dataset</strong> and repeat the above procedure.</p>

CC BY-SA 4.0
2018-05-15T15:35:18.240Z
2018-05-15T15:35:18.240Z
Peter
<p>In <code>Seurats</code>' documentation for <code>FindClusters()</code> function it is written that for around <code>3000</code> cells the <code>resolution</code> parameter should be from <code>0.6</code> and up to <code>1.2</code>. I am wondering then what should I use if I have <code>60 000</code> cells? How to determine that? </p>

<r><single-cell><seurat>
Finding the optimal resolution parameter in Seurat's FindClusters function
# Finding the optimal resolution parameter in Seurat's FindClusters function

(Asked by: username_0 on 2018-05-14)

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?

**Tags:** r, single-cell, seurat

---

## 3 answers

### Answer by username_3 on 2018-05-15. Score: 7 | Accepted answer

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.


---

### Answer by username_1 on 2018-05-14. Score: 3

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
)

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.


---

### Answer by username_2 on 2019-06-06. Score: 3

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")


---

