tirank.TrainPre.Pcluster

tirank.TrainPre.Pcluster(savePath, clusterColName, perm_n=1001)[source]

Performs a permutation test to identify significantly enriched clusters.

This function tests whether the observed number of ‘Rank+’ or ‘Rank-’ labels within any given cluster (e.g., ‘leiden_clusters’) is significantly higher than expected by chance.

Parameters:
  • savePath (str) – The main project directory path.

  • clusterColName (str) – The column name in ‘spot_predict_score.csv’ that contains the cluster labels (e.g., ‘leiden_clusters’, ‘patho_class’).

  • perm_n (int, optional) – The number of permutations to run. Defaults to 1001.

Returns:

None