plot_2D_intervals | R Documentation |
This function creates a 2D interval plot for mean-variance association, highlighting significant differences based on a given significance threshold.
plot_2D_intervals(
.data,
significance_threshold = 0.05,
test_composition_above_logit_fold_change = attr(.data,
"test_composition_above_logit_fold_change")
)
.data |
Data frame containing the main data. |
significance_threshold |
Numeric value specifying the significance threshold for highlighting differences. Default is 0.025. |
test_composition_above_logit_fold_change |
A positive integer. It is the effect threshold used for the hypothesis test. A value of 0.2 correspond to a change in cell proportion of 10% for a cell type with baseline proportion of 50%. That is, a cell type goes from 45% to 50%. When the baseline proportion is closer to 0 or 1 this effect thrshold has consistent value in the logit uncontrained scale. |
A ggplot object representing the 2D interval plot.
print("cmdstanr is needed to run this example.")
if (instantiate::stan_cmdstan_exists()) {
data("counts_obj")
estimate <- sccomp_estimate(
counts_obj,
~ type,
~type,
sample,
cell_group,
count,
cores = 1
) |>
sccomp_test()
# Example usage:
my_plot = plot_2D_intervals(estimate)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.