plot_results_distributions: Plot results distributions

View source: R/plot_results_distributions.R

plot_results_distributionsR Documentation

Plot results distributions

Description

Plot the distributions of the test statistics in the phenotype-cell type association results.

Usage

plot_results_distributions(
  results = load_example_results(),
  x_var = "estimate",
  facets = "CellType",
  binwidth = NULL,
  scales = "fixed",
  log10_transform = TRUE,
  show_plot = TRUE,
  save_path = NULL,
  ...
)

Arguments

results

The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results

x_var

Variable to plot on the x-axis.

facets

A set of variables or expressions quoted by vars() and defining faceting groups on the rows or columns dimension. The variables can be named (the names are passed to labeller).

For compatibility with the classic interface, can also be a formula or character vector. Use either a one sided formula, ~a + b, or a character vector, c("a", "b").

binwidth

The width of the bins. Can be specified as a numeric value or as a function that calculates width from unscaled x. Here, "unscaled x" refers to the original x values in the data, before application of any scale transformation. When specifying a function along with a grouping structure, the function will be called once per group. The default is to use the number of bins in bins, covering the range of the data. You should always override this value, exploring multiple widths to find the best to illustrate the stories in your data.

The bin width of a date variable is the number of days in each time; the bin width of a time variable is the number of seconds.

scales

Should scales be fixed ("fixed", the default), free ("free"), or free in one dimension ("free_x", "free_y")?

log10_transform

log10 transform x_var.

show_plot

Print the plot to the console.

save_path

Save the plot to a file. Set to NULL to not save the plot.

...

Arguments passed on to KGExplorer::plot_save

height

Height of the heatmap body.

width

Width of the heatmap body.

Examples

results <- load_example_results()
ct <- unique(results$CellType)[seq(9)]
results <- results[CellType %in% ct]
results[,estimate_scaled:=scales::rescale(estimate,c(1,5))]
out <- plot_results_distributions(results, x_var="estimate_scaled")

neurogenomics/MultiEWCE documentation built on Sept. 28, 2024, 2:27 a.m.