View source: R/plot_celltype_severity.R
plot_celltype_severity | R Documentation |
Plot the phenotype severity scores (generated by GPT-4) aggregated by the cell types each phenotype is significantly associated with.
plot_celltype_severity(
results,
cl = get_cl(),
q_threshold = 0.05,
run_enrichment = TRUE,
top_n = 3,
types = c("dot", "bar")[1],
run_prune_ancestors = FALSE,
nonsig_fill = ggplot2::alpha("grey90", 0.001),
force_new = FALSE,
base_size = 8,
save_path = tempfile(fileext = ".rds"),
workers = 1
)
results |
The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results |
cl |
Cell Ontology (CL) object from
|
q_threshold |
The q value threshold to subset the |
run_enrichment |
Instead of simply taking the top N results, run a series of one-sided Wilcoxan rank-sum tests to determine whether the distribution of ordinal severity values (never=0, rarely=1, often=2, always=3) are significantly different between a given cell type and all other cell types. Tests are repeated across each GPT annotation separately using group_by and wilcox_test. |
top_n |
Top and bottom number of cell types to show per annotation (used in dot plot only). |
types |
Which types of plots of create. |
run_prune_ancestors |
Prune redundant ancestral terms if any of their descendants are present. Passes to prune_ancestors. |
nonsig_fill |
Fill colour for non-significant results. |
force_new |
Run a new set of enrichment tests even when cached
results are found. Only used when |
base_size |
base font size, given in pts. |
save_path |
Path to save results to. |
workers |
Number (>1) or proportion (<1) of worker cores to use. |
Named list of ggplot and data.table objects.
set.seed(2025)
results <- load_example_results()
results <- results[sample(seq(nrow(results)), 5000),]
out <- plot_celltype_severity(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.