Generate a plot summarising the cell type-phenotype enrichment results generated by gen_results.
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
)
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.
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.
Terms whose descendants should be kept
(including themselves).
Set to NULL
(default) to skip this filtering step.
Human Phenotype Ontology object, loaded from get_ontology.
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.
Show the plot.
Print messages.
ggplot or plotly object
keep_descendants <- "Neurodevelopmental delay"
plt_pheno_count <- plot_bar_summary(count_var = "hpo_name",
group_var = "CellType",
keep_descendants = keep_descendants)
#> Subsetting results by q_threshold and effect.
#> 1,230 associations remain after filtering.
#> Translating ontology terms to ids.
#> Keeping descendants of 1 term(s).
#> 30 terms remain after filtering.
#> 0 associations remain after filtering.
#> Adding HPO names.
#> Translating ontology terms to names.
#> Aggregating results by group_var='CellType'
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA
plt_cell_count <- plot_bar_summary(count_var = "CellType",
group_var = "hpo_name",
keep_descendants = keep_descendants)
#> Subsetting results by q_threshold and effect.
#> 1,230 associations remain after filtering.
#> Translating ontology terms to ids.
#> Keeping descendants of 1 term(s).
#> 30 terms remain after filtering.
#> 0 associations remain after filtering.
#> Adding HPO names.
#> Translating ontology terms to names.
#> Aggregating results by group_var='hpo_name'
#> Warning: argument is not numeric or logical: returning NA
#> Warning: argument is not numeric or logical: returning NA