plot_report: Report plot

View source: R/plot_report.R

plot_reportR Documentation

Report plot

Description

Plot the results of a filtering report generated by prioritise_targets.

Usage

plot_report(
  rep_dt,
  results,
  phenotype_to_genes = HPOExplorer::load_phenotype_to_genes(1),
  annot = HPOExplorer::load_phenotype_to_genes(3),
  remove_cols = c("Rows", "Rows_diff", "ids"),
  label.size = 0.25,
  show_plot = TRUE,
  add_tiers = TRUE,
  save_path = tempfile(fileext = "_plot_report.pdf"),
  verbose = TRUE,
  ...
)

Arguments

rep_dt

Report table.

results

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

phenotype_to_genes

Phenotype to gene mapping from load_phenotype_to_genes.

annot

HPO annotations.

remove_cols

Columns to remove from rep_dt.

label.size

Size of label border, in mm.

show_plot

Print the plot to the console.

add_tiers

Add severity tiers subplot.

save_path

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

verbose

Print messages.

...

Arguments passed on to ggplot2::ggsave

filename

File name to create on disk.

plot

Plot to save, defaults to last plot displayed.

device

Device to use. Can either be a device function (e.g. png), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only). If NULL (default), the device is guessed based on the filename extension.

path

Path of the directory to save plot to: path and filename are combined to create the fully qualified file name. Defaults to the working directory.

scale

Multiplicative scaling factor.

width,height

Plot size in units expressed by the units argument. If not supplied, uses the size of the current graphics device.

units

One of the following units in which the width and height arguments are expressed: "in", "cm", "mm" or "px".

dpi

Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.

limitsize

When TRUE (the default), ggsave() will not save images larger than 50x50 inches, to prevent the common error of specifying dimensions in pixels.

bg

Background colour. If NULL, uses the plot.background fill value from the plot theme.

create.dir

Whether to create new directories if a non-existing directory is specified in the filename or path (TRUE) or return an error (FALSE, default). If FALSE and run in an interactive session, a prompt will appear asking to create a new directory when necessary.

Value

ggplot object

Examples

results <- load_example_results()
rep_dt <- example_targets$report
gp <- plot_report(rep_dt=rep_dt, results=results)

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