Skip to contents

Plot the predictive prior, experimental observation, and Gaussian posterior distributions for one sample and perturbation from the output of calculate_powerup_posteriors(). The posterior target-event region is shaded relative to the response cutoff.

Usage

plot_posterior(
  posteriors,
  perturbation,
  sample,
  response_cutoff = NULL,
  fixed_axis = FALSE,
  axis_limits = c(0, 1),
  colors = c(prior = "#6721B4", observation = "#F97316", posterior = "#10B981")
)

Arguments

posteriors

Posterior results returned by calculate_powerup_posteriors().

perturbation

A single perturbation name to plot.

sample

A single sample name to plot.

response_cutoff

Optional response cutoff used for the posterior target-event probability and event-region shading. If NULL, use the cutoff stored in posteriors.

fixed_axis

If TRUE, use axis_limits; otherwise derive the x-axis from the plotted distributions.

axis_limits

Numeric vector of length two used when fixed_axis = TRUE.

colors

Named character vector giving colors for prior, observation, and posterior.

Value

A ggplot object showing prior, observation, and posterior Gaussian density curves.

Examples

if (FALSE) { # \dontrun{
posteriors <- calculate_powerup_posteriors(predictions, observations)
plot_posterior(
  posteriors,
  perturbation = "CTNNB1",
  sample = "Sample_A"
)
} # }