View source: R/plot_ontology_levels.R
plot_ontology_levels | R Documentation |
Generate plots comparing the ontology level of each HPO phenotype and several other metrics.
plot_ontology_levels(
results = load_example_results(),
p2g = HPOExplorer::load_phenotype_to_genes(),
ctd_list = load_example_ctd(file = paste0("ctd_", unique(results$ctd), ".rds"),
multi_dataset = TRUE),
x_vars = c("genes", "cell types", "estimate", "mean_specificity"),
log_vars = x_vars %in% c("estimate", "statistic", "F", "ges", "effect"),
sig_vars = x_vars %in% c("estimate", "statistic", "F", "ges", "effect", "cell types",
"mean_specificity"),
group_vars = c("hpo_id", "ontLvl", "ctd"),
q_threshold = 0.05,
min_value = NULL,
label.x.npc = 0.05,
label.y.npc = 0.5,
n.breaks = 4,
notch = FALSE,
nrow = 2,
add_arrow = TRUE,
show_plot = TRUE,
save_path = NULL,
height = 7,
width = length(x_vars) * 5.75,
smooth.line.args = list(method = "loess", se = FALSE),
return_data = TRUE
)
results |
The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results |
p2g |
Phenotype to gene data. |
ctd_list |
A named list of CellTypeDataset objects each created with generate_celltype_data. |
x_vars |
Variables to plot on the x-axis of each subplot. |
log_vars |
Logical vector indicating which variables to log-transform. |
sig_vars |
Logical vector indicating which variables to only plot for significant results. |
group_vars |
Compute the mean value for each |
q_threshold |
The q value threshold to subset the |
min_value |
Minimum value for the |
label.x.npc , label.y.npc |
can be
If too short they will be recycled. |
n.breaks |
Passed to scale_fill_viridis_c. |
notch |
If |
nrow |
Number of facet rows for the plot. |
add_arrow |
Add arrows indicating whether phenotypes are more broader or more specific across ontology levels. |
show_plot |
Print the plot to the console. |
save_path |
Save the plot to a file.
Set to |
height |
Height of the saved plot. |
width |
Width of the saved plot. |
smooth.line.args |
A list of additional aesthetic arguments to be passed
to |
return_data |
Return the full long data used in the plots. |
A named list containing the data and the plot.
out <- plot_ontology_levels()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.