View source: R/prepare_volcano_input.R
| prepare_volcano_input | R Documentation |
This function has as input posterior draws, calculates pi-values and credible intervals (CrI), and annotates them with biological information (e.g., cell line, time point) based on parameter names and a user-provided annotation data frame. Returns a data frame that is ready for plotting.
prepare_volcano_input(posterior, annotation, null.effect = 0, CrI_level = 0.95)
posterior |
A data frame of posterior draws (one row per draw) |
annotation |
A data frame with at least one column:
|
null.effect |
Central parameter value corresponding to no effect (default t=0). |
CrI_level |
a scalar between 0 and 1 specifying the mass within the credible interval (default=0.95, i.e. 95% credible interval (CrI)). |
Only returns pi-values and credible intervals for parameters that are in posterior and annotation. For formula see README or Vignette
A list with:
result: A data frame with columns:
parameter: original parameter name
pi.value: calculated pi.value
null.effect: set null effect by user
parameter.median: median posterior parameter value
parameter.low: lower boundary of CrI of parameter value
paramter.high: upper boundary of CrI of parameter value
CrI.width: the absolute distance between parameter.low and parameter.high
CrI.level: CrI_level set by user
label: biological label (e.g., cell.line)
Other columns from annotation (e.g., group, condition)
extract_fit()
# Example: Simulate posterior and annotation
posterior <- data.frame(
doubling.1 = rnorm(1000),
doubling.2 = rnorm(1000)
)
annotation <- data.frame(
parameter = c("doubling.1", "doubling.2"),
label = c("cell.line.A", "cell.line.B"),
group = c("group1", "group1")
)
result <- prepare_volcano_input(
posterior = posterior,
annotation = annotation,
)
head(result$result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.