plot_expr: Plot cRPKM values of a given gene

View source: R/plot_expr.R

plot_exprR Documentation

Plot cRPKM values of a given gene

Description

Generate a plot of cRPKM values for a given gene. The cRPKM values are obtained from the vast-tools pipeline.

Usage

plot_expr(x, config = NULL, subg = FALSE, subg.show = c("mean",
  "all", "beeswarm"), trim_colnames = NULL, counts = FALSE,
  groupmean = ifelse(is.null(config), FALSE, TRUE), col = NULL,
  title = NULL, xlab = "", ylab = "Expression (cRPKM)",
  ylim = NULL, cex.main = 14, cex.yaxis = 12, cex.xaxis = 12,
  pch = 20, cex.pch = 3, plot = NULL, gridlines = TRUE,
  show_group_legend = TRUE)

Arguments

x

A 1-row data frame containing cRPKM values to be plotted

config

Optional configuration settings for plot_expr. 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_expr multiple times.

subg

Logical indicating whether samples should be subgrouped for plotting. If TRUE, the average of all samples in a subgroup is plotted as a single data point. See plot_event and preprocess_sample_colors for more details on subgrouping.

subg.show

Only applies when subg == TRUE. Default is mean, in which the average PSI is computed for each subgroup. If all, then individual point estimates with error bars are shown. If beeswarm, this is similar to all, but shown as a beeswarm plot and without error bars.

trim_colnames

String that must be searched for and trimmed at the end of every sample column in x. Useful to trim the "-cRPKM" suffix from expression tables. If no string must be trimmed, leave as NULL.

counts

Logical indicating whether the data frame contains read counts. Set to TRUE if the data frame contains two columns per sample (cRPKM and counts), otherwise leave as FALSE (default).

groupmean

Logical indicating whether grouped means should be drawn. Requires config.

col

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

title

Title of the plot. If NULL (default), the title will be the content of the ID column in x.

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.

show_group_legend

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

Details

Like plot_event and plot_multievent, 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 customizing plots. Note that the errorbar argument is not available for cRPKMs.

cRPKM values that have NA value are omitted and not plotted.

Value

ggplot2 object.

See Also

format_table for performing some initial conversion steps of x

preprocess_sample_colors for pre-processing of x using config

Examples

## Not run: 
plot_expr(crpkm[1,])

# Plot with custom configuration
config
plot_expr(crpkm[1,], config = config, groupmean=TRUE)
plot_expr(crpkm[1,], config = "/path/to/config")

# Plot using custom configuration, changing point symbol, and y-axis
# scale
plot_expr(crpkm[1,], config = config, pch = 9, ylim = c(20, 80))

## End(Not run)

# Plot with subgrouped samples
plot_expr(crpkm[1,], config=config, subg=TRUE)

# Plot directly from a table with suffixes and read counts
crpkm_counts
plot_expr(crpkm_counts[1,], config = config, trim_colnames = "-cRPKM", counts = TRUE)


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