
Enrichment Analysis of Clusters vs Phenotypes
run_cluster_enrichment.RdPerforms "Cluster vs Rest" statistical tests for each phenotypic variable. For numeric variables, it tests for normality and applies either a t-test or Wilcoxon test. For categorical variables, it applies a chi-squared test. The function returns a dataframe summarizing the results, including adjusted p-values for multiple testing. Clusters with fewer than 3 samples are automatically skipped to ensure statistical validity. The results include the type of test used, p-values, test statistics, and any enriched classes for categorical variables.