tirank.SCSTpreprocess.Clustering

tirank.SCSTpreprocess.Clustering(ann_data, infer_mode, savePath)[source]

Performs standard clustering (HVGs, PCA, neighbors, UMAP, Leiden).

If neighbors are already computed, it just re-runs Leiden. Otherwise, it runs the full pipeline. Saves a UMAP or spatial plot.

Parameters:
  • ann_data (sc.AnnData) – The AnnData object.

  • infer_mode (str) – The inference data type (‘SC’ or ‘ST’) for plotting.

  • savePath (str) – The main project directory path to save plots.

Returns:

The clustered AnnData object.

Return type:

sc.AnnData