Plot the results of a filtering report generated by prioritise_targets.
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,
...
)
Report table.
The cell type-phenotype enrichment results generated by gen_results and merged together with merge_results
Phenotype to gene mapping from load_phenotype_to_genes.
HPO annotations.
Columns to remove from rep_dt
.
Size of label border, in mm.
Print the plot to the console.
Add severity tiers subplot.
Save the plot to a file.
Set to NULL
to not save the plot.
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.
ggplot object
results <- load_example_results()
rep_dt <- example_targets$report
gp <- plot_report(rep_dt=rep_dt, results=results)
#> plot_report:: Preparing data.
#> Warning: column(s) not removed because not found: [Rows_diff]
#> Reading cached RDS file: phenotype.hpoa
#> + Version: v2024-12-12
#> Reading cached RDS file: phenotype_to_genes.txt
#> + Version: v2024-12-12
#> plot_report:: Preparing plot.
#> Saving plot ==> /tmp/RtmpMmVOaL/file2ffc3e0c05_plot_report.pdf
#> Saving 7 x 7 in image