This function performs clustering on enrichment results by integrating gene similarity scores and various clustering strategies.
cluster(
enrichment_results,
df_names = NULL,
min_terms = 5,
min_value = 0.1,
distance_metric = "kappa",
distance_cutoff = 0.5,
linkage_method = "average",
linkage_cutoff = 0.5
)A named list containing: - `distance_matrix`: The distance matrix used in clustering. - `clusters`: The final clusters. - `df_list`: The original list of enrichment result dataframes. - `merged_df`: The merged dataframe containing combined results. - `cluster_options`: A list of clustering parameters used in the analysis. - `df_names` (optional): The names of the input dataframes if provided.
A list of dataframes, each containing enrichment results. Each dataframe should include at least the columns 'Term', 'GeneID', and 'Padj'.
Optional, a character vector of names for the enrichment result dataframes. Must match the length of `enrichment_results`. Default is `NULL`.
Minimum number of terms each final cluster must include
Minimum 'Pvalue' a term must have in order to be counted in final clustering
A string specifying the distance metric to use (e.g., "kappa").
A numeric value for the distance cutoff (0 < cutoff <= 1).
A string specifying the linkage method to use (e.g., "average"). Supported options are "single", "complete", "average", and "ward".
A numeric value between 0 and 1 for the membership cutoff.