scStability: A user friendly wrapper function that runs the entire...

View source: R/scStability.r

scStabilityR Documentation

A user friendly wrapper function that runs the entire scRNA-seq stability workflow and shows statistics for each step

Description

A wrapper function that runs all other stability analysis functions in order. Statistics for each step are printed accordingly and a final DR and cluster plot is shown which represents the medoid embeddings and cluster assignments that were generated.

Usage

scStability(
  seurat_obj,
  n_runs = 100,
  dr_method = "umap",
  clust_method = "louvain",
  n_cores = 1,
  verbose = TRUE,
  print_plot = TRUE,
  seeds = NULL
)

Arguments

seurat_obj

A Seurat object containing scRNA-seq data and a PCA

n_runs

Number of DR embeddings and number of cluster assignments to be generated (< 250 recommended)

dr_method

Method to use for dimension reduction, either "umap" or "tsne"

clust_method

Algorithm used for clustering, either "louvain" or "leiden"

n_cores

Number of CPU cores to use for parallelising functions

verbose

Whether the function should print summary statistics as it calculates them

print_plot

Whether the final medoid plot should be printed

seeds

A set of seeds of length n_runs used for generating embeddings and clusters

Value

A list containing:

mean_emb

Data frame containing the mean embedding coordinates

mean_clust

Vector of the mean cluster assignments

plot

ggplot2 object with the medoid embedding plot and cluster assignments

embedding_stats

List of embedding statistics

cluster_stats

List of clustering statistics

seurat_object

Seurat object now containing mean embeddings and mean clusters


scStability documentation built on June 23, 2025, 5:08 p.m.