Summarise results from MSTExplorer.

summarise_results(
  results,
  group_var = "ctd",
  add_merged = TRUE,
  phenotype_to_genes = HPOExplorer::load_phenotype_to_genes(),
  digits = 3,
  save_path = tempfile("summarise_results.csv")
)

Arguments

results

The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results

group_var

Variable to segregate results by.

add_merged

Add a merged summary across all groups.

phenotype_to_genes

Output of load_phenotype_to_genes mapping phenotypes to gene annotations.

digits

a positive integer indicating how many significant digits are to be used for numeric and complex x. The default, NULL, uses getOption("digits"). This is a suggestion: enough decimal places will be used so that the smallest (in magnitude) number has this many significant digits, and also to satisfy nsmall. (For more, notably the interpretation for complex numbers see signif.)

save_path

Path to save the summary to as a CSV.

Examples

results <- load_example_results()
summary_split <- summarise_results(results, group_var="ctd")
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> Saving results --> /tmp/RtmpMmVOaL/summarise_results.csv2ffc1ea36966
summary_merged <- summarise_results(results, group_var=NULL)
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> Saving results --> /tmp/RtmpMmVOaL/summarise_results.csv2ffc65c317fc