Generate a plot summarising the cell type-phenotype enrichment results generated by gen_results.
summary_plot(
results = load_example_results(),
count_var = "hpo_name",
group_var = "CellType",
keywords = NULL,
q_threshold = 5e-04,
fold_threshold = 1,
cell_type = NULL,
ancestor = NULL,
hpo = HPOExplorer::get_hpo(),
phenotype_to_genes = HPOExplorer::load_phenotype_to_genes(),
option = "magma",
interactive = TRUE,
verbose = TRUE
)
The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results.
Variable to get counts for per group_var
.
Variable to group counts by.
Keywords supplied to search for phenotypes. Will be used to generate the plot title..
The q value threshold to subset the results
by.
The minimum fold change in specific expression
to subset the results
by.
The cell type of interest to be plotted.
Can be a single string (e.g. "Astrocytes"
) or a character vector
of multiple cell types (e..g. c("Astrocytes","Microglia")
).
Set to NULL
if you wish to include all cell-types that are available
(after q_threshold
and fold_threshold
filtering).
If >1 cell-type remains, results will be aggregated automatically
such that there is only 1 node per phenotype.
The ancestor to get all descendants of. If NULL
,
returns the entirely ontology.
Human Phenotype Ontology object, loaded from ontologyIndex.
Output of load_phenotype_to_genes mapping phenotypes to gene annotations.
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")
Make the plot interactive with ggplotly.
Print messages.
ggplot or plotly object
ancestor <- "Neurodevelopmental delay"
plt_pheno_count <- summary_plot(count_var = "hpo_name",
group_var = "CellType",
ancestor = ancestor)
#> Subsetting results by q_threshold and fold_change.
#> Skipping cell_type filter.
#> 649,567 associations remain after filtering.
#> Subsetting phenotypes to only ancestors of: Neurodevelopmental delay
#> Translating all phenotypes to HPO IDs.
#> ℹ All local files already up-to-date!
#> + Returning a vector of phenotypes (same order as input).
#> 16,581 associations remain after filtering.
#> Aggregating results by group_var='CellType'
plt_cell_count <- summary_plot(count_var = "CellType",
group_var = "hpo_name",
ancestor = ancestor)
#> Subsetting results by q_threshold and fold_change.
#> Skipping cell_type filter.
#> 649,567 associations remain after filtering.
#> Subsetting phenotypes to only ancestors of: Neurodevelopmental delay
#> Translating all phenotypes to HPO IDs.
#> ℹ All local files already up-to-date!
#> + Returning a vector of phenotypes (same order as input).
#> 16,581 associations remain after filtering.
#> Aggregating results by group_var='hpo_name'