Package 'MultiK'

Title: Multi-Resolution Consensus Clustering for Single-Cell RNA-seq
Description: Identifies optimal cluster numbers in single-cell RNA-seq data through subsampling-based consensus clustering. MultiK performs repeated subsampling and clustering across multiple resolution parameters, then evaluates clustering stability using the Proportion of Ambiguous Clustering (PAC) metric. Statistical significance of cluster separability is assessed using SigClust.
Authors: Zaoqu Liu [aut, cre] (ORCID: <https://orcid.org/0000-0002-0452-742X>), Siyao Liu [aut]
Maintainer: Zaoqu Liu <[email protected]>
License: MIT + file LICENSE
Version: 1.0.0
Built: 2026-05-23 08:50:57 UTC
Source: https://github.com/Zaoqu-Liu/MultiK

Help Index


Pairwise SigClust tests between clusters

Description

Performs statistical significance testing for cluster separability using the SigClust method on all pairwise combinations of clusters.

Usage

CalcSigClust(seu, clusters, nsim = 100, nfeatures = 2000, cores = 1)

Arguments

seu

A Seurat object

clusters

Vector of cluster assignments

nsim

Number of simulations for SigClust. Default is 100

nfeatures

Number of variable features. Default is 2000

cores

Number of cores for parallel processing. Default is 1

Value

A symmetric matrix of p-values from pairwise SigClust tests. Diagonal elements are NA. P-values indicate significance of cluster separation.


Diagnostic plots for optimal K selection

Description

Generates three diagnostic plots from MultiK results: (1) Frequency distribution of K values (2) rPAC scores across K (3) Stability vs frequency trade-off plot

Usage

DiagMultiKPlot(ks, consensus)

Arguments

ks

Vector of K values from MultiK output

consensus

List of consensus matrices from MultiK output

Value

Combined ggplot object with 3 panels. Also prints optimal K to console.


Extract cluster assignments for specified K values

Description

Performs Seurat clustering and retrieves cluster assignments for the specified optimal K values.

Usage

getClusters(seu, optK, nPC = 30, k.param = 20, nfeatures = 2000)

Arguments

seu

A Seurat object

optK

Vector of target cluster numbers

nPC

Number of principal components. Default is 30

k.param

Number of nearest neighbors. Default is 20

nfeatures

Number of variable features. Default is 2000

Value

A list containing:

clusters

Matrix of cluster assignments (cells x K values)

resolution

Resolution parameters used for each K


MultiK: Determine optimal cluster numbers via consensus clustering

Description

Performs subsampling-based consensus clustering across multiple resolution parameters to identify robust cluster numbers in single-cell RNA-seq data.

Usage

MultiK(
  seu,
  resolution = seq(0.05, 2, 0.05),
  nPC = 30,
  reps = 100,
  pSample = 0.8,
  k.param = 20,
  nfeatures = 2000,
  seed = NULL,
  cores = 1
)

Arguments

seu

A Seurat object

resolution

Numeric vector of resolution parameters for Seurat clustering. Default is seq(0.05, 2, 0.05)

nPC

Number of principal components. Default is 30

reps

Number of subsampling iterations. Default is 100

pSample

Proportion of cells to subsample. Default is 0.8

k.param

Number of nearest neighbors for graph construction. Default is 20

nfeatures

Number of variable features to select. Default is 2000

seed

Random seed for reproducibility. Default is NULL

cores

Number of cores for parallel processing. Default is 1

Value

A list containing:

k

Vector of K values from all clustering runs

clusters

Clustering results for each K

consensus

Consensus matrix for each K


Three Cell Line Mixture Dataset

Description

A Seurat object containing single-cell RNA-seq data from a mixture of three cell lines (H2228, H1975, HCC827). This dataset is used for demonstrating the MultiK workflow.

Usage

p3cl

Format

A Seurat object with approximately 2,600 cells and the following structure:

assays

RNA assay with count and normalized data

meta.data

Cell metadata including cell line annotations

Source

Dong et al. 2019 (PMID: 31925417)

Examples

data(p3cl)
p3cl

Visualize SigClust results with dendrogram and heatmap

Description

Generates a combined visualization showing: (1) Hierarchical clustering dendrogram of cluster centroids (2) Heatmap of pairwise SigClust p-values

Usage

PlotSigClust(seu, clusters, pval, nfeatures = 2000)

Arguments

seu

A Seurat object

clusters

Vector of cluster assignments

pval

P-value matrix from CalcSigClust

nfeatures

Number of variable features. Default is 2000

Details

Node shapes indicate statistical significance: - Filled circles: significant separation (p < 0.05) - Open circles: non-significant separation (p >= 0.05)

Value

Invisibly returns NULL; displays the combined plot