Plot the frequency of gene-phenotype and phenotype-disease associations.

plot_frequency_bar(
  results = load_example_results(),
  phenotype_to_genes = HPOExplorer::load_phenotype_to_genes(),
  allow.cartesian = TRUE,
  show_plot = FALSE,
  verbose = TRUE
)

Arguments

results

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

phenotype_to_genes

Output of load_phenotype_to_genes mapping phenotypes to gene annotations.

allow.cartesian

See allow.cartesian in [.data.table.

show_plot

Print the plot after it's been generated.

verbose

Print messages.

Value

ggplot object

Examples

results <- load_example_results()[seq(2500),]
fp_res <- plot_frequency_bar(results=results)
#> Annotating phenotype frequencies.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> Adding genes and disease IDs.
#> Adding level-2 ancestor to each HPO ID.
#> Adding ancestor metadata.
#> Ancestor metadata already present. Use force_new=TRUE to overwrite.
#> 62,437 associations remain after filtering.
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> Annotating gene frequencies.
#> Reading cached RDS file: genes_to_phenotype.txt
#> + Version: v2024-12-12
#> Adding level-2 ancestor to each HPO ID.
#> Adding ancestor metadata.
#> Ancestor metadata already present. Use force_new=TRUE to overwrite.
#> 835 associations remain after filtering.
#> 71.9% of rows are NA.
#> 75.8% of rows are NA.