plotExonUsage {edgeR} | R Documentation

## Create a Plot of Exon Usage from Exon-Level Count Data

### Description

Create a plot of exon usage for a given gene by plotting the (un)transformed counts for each exon, coloured by experimental group.

### Usage

    plotExonUsage(y, geneID, group=NULL, transform="none", counts.per.million=TRUE,
                  legend.coords=NULL, ...)

### Arguments

`y` | either a matrix of exon-level counts, a list containing a matrix of counts for each exon or a `DGEList` object with (at least) elements `counts` (table of counts summarized at the exon level) and `samples` (data frame containing information about experimental group, library size and normalization factor for the library size). Each row of `y` should represent one exon.
`geneID` | character string giving the name of the gene for which exon usage is to be plotted.
`group` | factor supplying the experimental group/condition to which each sample (column of `y`) belongs. If `NULL` (default) the function will try to extract if from `y`, which only works if `y` is a `DGEList` object.
`transform` | character, supplying the method of transformation to be applied to the exon counts, if any. Options are `"none"` (original counts are preserved), `"sqrt"` (square-root transformation) and `"log2"` (log2 transformation). Default is `"none"`.
`counts.per.million` | logical, if `TRUE` then counts per million (as determined from total library sizes) will be plotted for each exon, if `FALSE` the raw read counts will be plotted. Using counts per million effectively normalizes for different read depth among the different samples, which can make the exon usage plots easier to interpret.
`legend.coords` | optional vector of length 2 giving the x- and y-coordinates of the legend on the plot. If `NULL` (default), the legend will be automatically placed near the top right corner of the plot.
`...` | optional further arguments to be passed on to `plot`.

### Details

This function produces a simple plot for comparing exon usage between different experimental conditions for a given gene.

### Value

`plotExonUsage` (invisibly) returns the transformed matrix of counts for the gene being plotted and produces a plot to the current device.

### Author(s)

Davis McCarthy, Gordon Smyth

### See Also

`spliceVariants` for methods to detect genes with evidence for alternative exon usage.

### Examples

    # generate exon counts from NB, create list object
    y<-matrix(rnbinom(40,size=1,mu=10),nrow=10)
    rownames(y) <- rep(c("gene.1","gene.2"), each=5)
    d<-DGEList(counts=y,group=rep(1:2,each=2))
    plotExonUsage(d, "gene.1")

[Package edgeR version 3.36.0 Index]