coFAST: Spatially-Aware Cell Clustering Algorithm with Cluster Significant Assessment

Wei Liu, Xiao Zhang, Yi Yang, Peng Xie, Chengqi Lin, Jin LiuOpenalex Unknown 2025 · DOI · OpenAlex

Abstract

A spatially-aware cell clustering algorithm is provided with cluster significance assessment. It comprises four key modules: spatially-aware cell-gene co-embedding, cell clustering, signature gene identification, and cluster significant assessment. More details can be referred to Peng Xie, et al. (2025) doi:10.1016/j.cell.2025.05.035.

Introduction

In the rapidly evolving field of Spatial Resolution Transcriptomics (SRT), researchers often encounter a "two-world" problem where gene expression and spatial coordinates are treated as separate entities. Traditional clustering algorithms frequently struggle to integrate these modalities effectively, leading to results that may be transcriptionally distinct but spatially incoherent. The coFAST R package addresses this by co-embedding cells and genes into a shared low-dimensional space, ensuring that physical tissue architecture is a fundamental part of the biological analysis.

Methodology

The coFAST package is built around a "spatially-aware" workflow consisting of four integrated modules:

  1. Spatially-Aware Co-embedding: Using the "FAST" model (Factor Analysis for Spatial Transcriptomics), the algorithm projects both cells (spots) and genes into the same latent space. It utilizes an adjacency matrix to ensure that cells physically near each other have similar embeddings.
  2. Cell Clustering: Once in this shared space, the package identifies clusters using Shared Nearest Neighbor (SNN) modularity optimization, a robust technique for finding community structures in high-dimensional data.
  3. Signature Gene Identification: Because genes and cells live in the same coordinate system, the "distance" between a gene and a cell cluster becomes a direct measure of association, simplifying marker discovery.
  4. Cluster Significance Assessment: Diagnostic tools, such as parallel analysis of eigenvalues, help researchers determine the optimal number of dimensions for their data, moving away from arbitrary selections.
Spatial coordinate and neighbor type parameters used in the co-embedding process.

Implementation and Key Features

The framework is designed for versatility, supporting various SRT platforms like Visium and ST. The adjacency calculations support 2D, 3D, and even higher-dimensional coordinates, making it future-proof for emerging volumetric transcriptomics.

Key functions like AddCluster allow users to fine-tune the clustering process by specifying resolution parameters or a fixed number of clusters (K). This flexibility ensures that the resulting cell type assignments respect both transcriptional profiles and tissue boundaries.

Parameters for the AddCluster function, including resolution and cluster count options.

Key Insights and Results

  • The Shared Latent Space: By placing genes and cells in the same "room," the search for marker genes becomes a simple distance calculation rather than a complex differential expression test.
  • Spatial as a Regularizer: coFAST uses spatial coordinates to "smooth" results, assuming that a cell's neighbors provide vital context for its identity.
  • Quantitative Metrics: The AggregationScore provides a concrete metric for how "clustered" or "dispersed" specific cell types are within the tissue.

Limitations and Future Work

While coFAST is optimized using Rcpp and irlba for speed, there is a natural trade-off between computational intensity and dataset size. Future iterations may include more automated methods for determining neighborhood definitions (e.g., fixed distance vs. fixed number of neighbors) based on specific tissue characteristics rather than user-defined parameters.

Reference: Peng Xie, et al. (2025) Spatially-Aware Cell Clustering Algorithm with Cluster Significant Assessment. doi:10.1016/j.cell.2025.05.035

Summary updated

Abstract

A spatially-aware cell clustering algorithm is provided with cluster significance assessment. It comprises four key modules: spatially-aware cell-gene co-embedding, cell clustering, signature gene identification, and cluster significant assessment. More details can be referred to Peng Xie, et al. (2025) &lt;<a href="https://doi.org/10.1016%2Fj.cell.2025.05.035" target="_top">doi:10.1016/j.cell.2025.05.035</a>&gt;.
BibTeX
@inproceedings{liu2025cofast,
  author = {Wei Liu and Xiao Zhang and Yi Yang and Peng Xie and Chengqi Lin and Jin Liu},
  title = {{coFAST: Spatially-Aware Cell Clustering Algorithm with Cluster Significant Assessment}},
  booktitle = {Openalex Unknown},
  year = {2025},
  doi = {10.32614/cran.package.cofast},
}
Figure