plot_multievent: Plot PSI values of multiple alternative splicing events

View source: R/plot_multievent.R

plot_multieventR Documentation

Plot PSI values of multiple alternative splicing events

Description

Generate a plot with PSI values for several exons. The PSI values and corresponding quality scores are typically obtained from the vast-tools pipeline.

Usage

plot_multievent(x, config = NULL, subg = FALSE, trim_colnames = NULL,
  qual = c("VLOW", "N", "LOW", "OK", "SOK"), errorbar = TRUE,
  col = NULL, event_col = NULL, title = "MULTI EVENT PLOT",
  xlab = "", ylab = "PSI", ylim = c(0, 100), cex.main = 14,
  cex.yaxis = 12, cex.xaxis = 12, pch = 20, cex.pch = 3,
  plot = NULL, gridlines = TRUE, lwd = 0.5, show_event_legend = T,
  show_group_legend = T)

Arguments

x

A data frame containing PSI values to be plotted.

config

Optional configuration settings for plot_event. Can be a path to the .config file, or 4/5-column data frame of the .config file. Use the latter option if you are calling plot_event multiple times.

subg

Logical indicating whether samples should be subgrouped for plotting.

trim_colnames

String that must be searched for and trimmed at the end of every sample column in x. If no string must be trimmed, leave as FALSE.

qual

String indicating the minimun vast-tools quality score for the PSI to be accepted. Defaults to 'VLOW'. See the vast-tools documentation for details.

errorbar

Logical indicating whether error bars should be drawn

col

Vector of colors with length matching the number of samples. If specified, this will override the color settings specified in config.

event_col

Vector of colors, with length matching the number of events (rows of x). If left as NULL, event colors will be set with scale_colour_hue

title

Title of the plot.

xlab

The x-axis label.

ylab

The y-axis label.

ylim

Range of y-axis.

cex.main

Plot title size (pts).

cex.yaxis

Y-axis font size (pts).

cex.xaxis

X-axis font size (i.e. the sample names) (pts).

pch

Point symbol.

cex.pch

Size of datapoints.

plot

(deprecated) Prints the plot.

gridlines

Logical indicating whether grid lines should be drawn.

lwd

Line width for errorbars and the line connecting PSIs from each event.

show_event_legend

Set to FALSE to avoid showing a legend with the event IDs and their colors.

show_group_legend

Set to FALSE to avoid showing a legend with the sample groups and their colors.

Details

Like in plot_event and plot_expr, plots can be customized via the config option. Either a data frame or the filepath to the config file can be used. Alternatively, plots can be customized using a limited set of graphical parameters as described above.

See Details of plot_event and preprocess_sample_colors for more information on the usage of the config, subg, and errorbar arguments.

Unlike in plot_event and plot_expr, sample colors in config or col are now shown only in the background, as the point colors are now used to differentiate PSI values from different events. In addition, a line connects the points from each event, to increase visibility. The color of each event can be set using the event_col argument.

Also, note that using subg=TRUE and errorbar=TRUE together is an experimental feature, computationally expensive, and CIs may not be shown for some subgroups, especially for events with low coverage and PSI values near 0 or 1 (see get_beta_ci_subg for details on error bar estimation for subgrouped samples).

Value

ggplot2 object

See Also

format_table for performing some initial conversion steps of x.

preprocess_sample_colors for pre-processing of x usingconfig.

plot_event for plotting single events.

Examples

plot_multievent(psi, config = config)

# Example with subgrouped samples, custom title and no error bars
plot_multievent(psi, config = config, subg = TRUE, errorbar = FALSE, title = "Highlighted events")

# Legends can be hidden separately
plot_multievent(psi, config = config, show_event_legend = FALSE)
plot_multievent(psi, config = config, show_group_legend = FALSE)

# Custom event colors
plot_multievent(psi[1:3,], config = config, event_col=c("red","black","orange"))

# Use of errobar = TRUE and subg = TRUE is experimental and computationally expensive
## Not run: 
plot_multievent(psi, config = config, subg = TRUE, errorbar = TRUE)

## End(Not run)


kcha/psiplot documentation built on March 27, 2022, 4:20 a.m.