Plot mean community size across tested resolutions
Source:R/plot_resolution_results.R
plot_resolution_results.RdVisualises the output of test_resolution as a line plot of
mean cells per community against resolution, with optional error bars.
Use this plot to identify a resolution that yields communities of a
suitable and stable size before running create_communities.
Arguments
- resolution_results
A
data.frameas returned bytest_resolution, containing at minimum the columnsresolutionandmean_cells_per_community. Ifshow_error_bars = TRUE, the columnsd_cells_per_communitymust also be present.- show_error_bars
A logical value. If
TRUE(the default), error bars showing ±1 SD (sd_cells_per_community) are added around each point.
See also
test_resolution to generate the input
data.frame; create_communities to assign cells to
communities once a resolution has been chosen.
Examples
if (FALSE) { # \dontrun{
# Test a range of resolutions
res_results <- test_resolution(sce, resolutions = c(0.5, 1, 2.5, 5))
# Plot the results with error bars
plot_resolution_results(res_results)
# Plot without error bars
plot_resolution_results(res_results, show_error_bars = FALSE)
} # }