isoPlot: Plot Isoform Expression Data

View source: R/isoPlot.R

isoPlotR Documentation

Plot Isoform Expression Data

Description

Visualize isoform expression data for exploratory data analysis.

Usage

isoPlot(
  x,
  isoforms = NULL,
  gene = NULL,
  plotType = c("box", "dot", "bar", "violin", "density", "surface"),
  asPercentage = FALSE,
  symbol = "GeneSymbol",
  legend = NULL,
  main = TRUE,
  na.rm = TRUE,
  group = NULL,
  subgroup = NULL,
  highlight = NULL,
  facet = NULL,
  stack = NULL,
  shiny = FALSE,
  groupByGene = FALSE,
  useNormCounts = TRUE,
  appris = FALSE,
  transcriptType = FALSE,
  ttype = "transcript_type",
  ...
)

Arguments

x

R data object; Most typically this is an ExpressionSet there is support for other datatypes as well.

isoforms

character; Isoform IDs or a vector of isoform IDS to plot.

gene

character; Gene or vector of gene names. This is an optional setting that will return all of the isoforms associated with the gene.

plotType

character; Can be set to "box", "violin, "dot", "bar", "denisity" or "surface" for box plots, violin plots, dot plots, bar plots, and kernel density plots, respectively.

asPercentage

logical; If set to TRUE, the isoform expression is given as a percentage of total gene expression (defaults to FALSE)

symbol

character; Column name of of gene symbols in the feature data of x (fData).

legend

logical or character; Draws a figure legend. Use to set the legend title which defaults to "Legend" if equals TRUE. Set to FALSE to disable.

main

character; The main plot title. Defaults to true for automated generation.

na.rm

logical; Removes NA values prior to plotting.

group

factor or name of factor to be extracted from x (e.g. pData). Used as the primary grouping factor.

subgroup

factor or name of factor to be extracted from x (e.g. pData). Used to subgroup data unless multiple genes are selected in which case subgroup is ignored.

highlight

factor or name of factor to be extracted from x (e.g. pData). Used to color data points by factor levels. Only valid for graphs with point overlays.

facet

factor or name of factor to be extracted from x (e.g. pData). Split the data into multiple smaller graphs.

stack

factor or name of factor to be extracted from x (e.g. pData). Used for stacked bar plots where both the individual and aggregate values are important. Valid only for bar plots.

shiny

logical; Use shiny interfaces if available.

groupByGene

logical; If more then one gene is listed and grouByGene is TRUE

useNormCounts

logical; By default genePlot will try to use normCounts instead of counts in SeqExpressionSets. Set to FALSE to use raw counts instead, though this will generate a warning about using non-normalized data.

appris

logical or character; If set to TRUE, will return only isoforms with appris annotation. If set to a character string, will restrict isoforms to those with the character value matching a substring of the appris tag. Appris column is determined by the first column name to containing 'Appris' (case insensitive).

transcriptType

character; Returns only those isoforms where the transcript type column has a substring that matches the character value supplied such as 'protein' in 'protein_coding'. The transcript type column is determined by the ttype option.

ttype

character; Column name of the optional transcript type column in the annotation. The default value is 'transcript_type'.

...

Any of the valid bvt graphics parameters which can be found in bvt_graphic_options.

Details

The isoPlot function is designed to make visualization of isoform expression data simple and easy for R novices and bioinformaticians alike. The function is an S3 generic that accept various R and Bioconductor data sets as input and extracts the expression, factor and annotation data from them according to the input data type. The factors allow for splitting expression data from one or more genes into groups and for various plot types with data point overlays. Points can be colored by factors levels as well. If the input data is a Bioconductor data set such as an ExpressionSet and the gene option is used, isoPlot will attempt to look up the isoforms in the associated with the gene in the annotation data (e.g. fData) according to the data input type and look for the gene symbol column indicated by the symbol option (defaults to 'GeneSymbol'). If no matches are found the row names of are checked of the expression data are check for matches as well. If character values are given for factor input, isoPlot will attempt to look up associated phenotype data (e.g. pData). One can also pass raw data vectors/data frames and/or factors to isoPlots to bypass this feature, which is critical for data sets and data formats where integrated phenotype and feature data is not available. The isoPlot uses the NicePlots graphics library and any NicePlots option and/or theme can be used in conjuction with options detailed below. The plotType options supported correspond to NicePlots functions and include box plots (niceBox), dot plots (niceDots), violin plots (niceVio), bar plots (niceBar) as well as both one/two dimensional kernel density plots (niceDensity). Supported data input types include: ExpressionSet, SeqExpressionSet-class, EList-class, DESeqTransform, as well as standard R data types such as vector, matrix, data.frame, and tibble. isoPlot silently returns a list of class npData that contains a summarized findings, p-values (if indicated), extracted plotting data, and plotting options. All npData objects can be plotted again using the plot function, isoPlot or any of the NicePlots functions. Options passed to any of these, including plotType will override the options for the npData object. A complete list of bvt graphics options can be found in bvt_graphic_options.

Value

A list of class npData. This contains data necessary to regenerate the plot as well as summary statistics.

See Also

genePlot, showIsoforms, niceBox, niceVio, niceBar, niceDots, niceDensity

Examples

ToDo<-1


ZachHunter/bvt documentation built on Sept. 18, 2024, 3:12 p.m.