AutoFindGranuleResolution | R Documentation |
AutoFindGranuleResolution
AutoFindGranuleResolution(
obj = combined.obj,
min.med.granule.size = 100,
max.med.granule.size = 200,
min.res = round(ncol(obj)/10000),
max.res = round(ncol(obj)/1000),
assay = c("integrated", "RNA")[1],
max.iter = 20,
clust.method = NULL,
n.threads = 1
)
obj |
Seurat object to perform clustering on. Defaults to 'combined.obj'. |
min.med.granule.size |
Minimum acceptable median cell count per cluster. Default is 100. |
max.med.granule.size |
Maximum acceptable median cell count per cluster. Default is 200. |
min.res |
Starting lower bound for clustering resolution search.
Defaults to: |
max.res |
Starting upper bound for clustering resolution search.
Defaults to: |
assay |
Specifies the assay to use for clustering. Default is 'integrated, with
"RNA" as an alternative taken from on |
max.iter |
Maximum number of iterations for adjusting clustering resolution. Default is 20. |
clust.method |
A Seurat method for running leiden (defaults to matrix which is fast for small datasets). Enable method = "igraph" to avoid casting large data to a dense matrix. |
The function iterates over clustering resolutions within the specified bounds to find an optimal resolution that results in median cluster sizes within the target range. It uses Seurat's clustering functionality and adjusts based on the median cell count per cluster.
A Seurat object with updated clustering at the optimal resolution found, including
modifications to obj@meta.data
and Idents(obj)
to reflect the new clustering.
reexports
, FindClusters
iprint
# Assuming `combined.obj` is a pre-loaded Seurat object
optimal.obj <- AutoFindGranuleResolution(obj = combined.obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.