plot_bar_summary: Summary plot

View source: R/plot_bar_summary.R

plot_bar_summaryR Documentation

Summary plot

Description

Generate a plot summarising the cell type-phenotype enrichment results generated by gen_results.

Usage

plot_bar_summary(
  results = load_example_results(),
  count_var = "hpo_name",
  group_var = "CellType",
  keywords = NULL,
  q_threshold = 5e-04,
  effect_threshold = 1,
  filters = NULL,
  keep_descendants = NULL,
  hpo = HPOExplorer::get_hpo(),
  option = "magma",
  interactive = TRUE,
  show_plot = TRUE,
  verbose = TRUE
)

Arguments

results

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

count_var

Variable to get counts for per group_var.

group_var

Variable to group counts by.

keywords

Keywords supplied to search for phenotypes. Will be used to generate the plot title.

q_threshold

The q value threshold to subset the results by.

effect_threshold

The minimum fold change in specific expression to subset the results by.

filters

A named list, where each element in the list is the name of a column in the data, and the vector within each element represents the values to include in the final data.

keep_descendants

Terms whose descendants should be kept (including themselves). Set to NULL (default) to skip this filtering step.

hpo

Human Phenotype Ontology object, loaded from get_ontology.

option

A character string indicating the color map option to use. Eight options are available:

  • "magma" (or "A")

  • "inferno" (or "B")

  • "plasma" (or "C")

  • "viridis" (or "D")

  • "cividis" (or "E")

  • "rocket" (or "F")

  • "mako" (or "G")

  • "turbo" (or "H")

interactive

Make the plot interactive.

show_plot

Show the plot.

verbose

Print messages.

Value

ggplot or plotly object

Examples

keep_descendants <- "Neurodevelopmental delay"
plt_pheno_count <- plot_bar_summary(count_var = "hpo_name",
                                group_var = "CellType",
                                keep_descendants = keep_descendants)
plt_cell_count <- plot_bar_summary(count_var = "CellType",
                                group_var = "hpo_name",
                                keep_descendants = keep_descendants)

neurogenomics/MultiEWCE documentation built on Sept. 28, 2024, 2:27 a.m.