Generate multiple clustering iterations on a Seurat object containing scRNA-seq data using the provided dimensionality reduction. The function creates a shared nearest neighbor (SNN) graph and assigns clusters using the specified algorithm, then calculates stability metrics across iterations.
clustStable(
n_runs,
seurat_obj,
method = c("louvain", "leiden"),
resolution = 0.8,
dims = 1:10,
n_cores = 1,
verbose = TRUE,
print_plot = TRUE,
seeds = NULL
)
A list containing the following components:
Numeric vector of NMI values for each clustering iteration
Numeric vector containing the lower and upper bounds of the 95% confidence interval
List of cluster assignments for each iteration
Integer specifying the number of cluster assignments to generate (default: 100)
A Seurat object containing scRNA-seq data with a PCA reduction
Character string specifying the clustering algorithm to use: either "louvain" or "leiden"
Numeric value specifying the clustering resolution parameter (default: 0.8)
Integer vector specifying which PCA dimensions to use (default: 1:10)
Integer specifying the number of CPU cores to use for parallelization (default: 1)
Whether the function should print summary statistics as it calculates them
Whether the final violin plot should be automatically printed
A set of seeds of length n_runs for creating clusters