resplot {GSEAlm} | R Documentation

## Simple Graphical Summaries for Gene Set Enrichment Analysis (GSEA)

### Description

Diagnostic plots for GSEA. 'resplot' and 'restrip' group residuals (or expression levels) from a specific gene-set by sample. 'mnDiffPlot' shows mean expression differences for a dichotomous phenotype, by gene, for a specific gene set.

### Usage

    resplot(GSname = "All", resmat, incidence = dumminc(resmat), fac,
         atomic = "Gene", core.text = "Residuals by Sample",
         yname = "Standardized Residual", xname = "Sample ID",
         ID = colnames(resmat), lims = 0, gnames = levels(factor(fac)),
         prefix = "", horiz = FALSE, colour=5,pch='+',...)

    restrip(GSname = "All", resmat, incidence = dumminc(resmat), fac,
       atomic = "Gene", core.text = "Residuals by Sample",
      yname = "Standardized Residual", xname = "Sample ID", ID = colnames(resmat),
      gnames = levels(factor(fac)), prefix = "", colour=c(2:4,6), resort=TRUE,
      horiz = FALSE, resort.fun=num.positive, pch='+', ...)

    mnDiffPlot(GSname = "All", exprmat, incidence = dumminc(exprmat), fac,
      atomic = "Gene", core.text = paste("Mean Expression Difference by",atomic),
      yname="Log Expression Ratio", xname="Log Expression",
      gnames = levels(factor(fac)), prefix = "", fitline=FALSE, varsize=FALSE,
      reverse=FALSE, ...)

### Arguments

`GSname` | Gene-set Name. See "Details".
`resmat,exprmat` | Numerical matrix with the values to be plotted. See "Details".
`incidence` | Gene-set 0/1 membership matrix
`fac` | The phenotypical variable to plot by. Must be discrete. For 'mnDiffPlot', must be dichotomous.
`atomic` | string identifying the meaning of rows in the data matrix. Defaults to "Gene".
`core.text,gnames,prefix,xname,yname` | strings controlling the text of main and axis captions
`ID` | Group names associated with the data matrix columns
`lims` | plotting limits for the response axis
`horiz` | logical: whether the boxplots or strips should be horizontal (defaults to FALSE)
`colour` | color of boxplot filling ('resplot') or symbols ('restrip')
`pch` | the plotting symbol
`resort` |
`resort.fun` | ('restrip' only) what function to sort groups by. Ignored unless 'resort==TRUE'. See `stripchart` documentation for more details
`fitline` | ('mnDiffPlot' only) logical: whether a loess fit should be plotted
`varsize` | ('mnDiffPlot' only) logical: whether symbol sizes should be proportional to (t-test style) standard errors
`reverse` | ('mnDiffPlot' only)logical: whether the factor's order should be reversed so that the second level is on the x-axis rather than the first one
`...` | Additional graphical parameters passed on to the generic plotting functions.

### Details

These functions provide simple graphical summaries for processed gene-expression data, or other similar datasets for which matrix form is useful. They are tailored predominantly for GSEA, but are useful in general as well.

'resplot' calls `boxplot` and 'restrip' calls `stripchart`; both summarize *all* data points from those rows in 'resmat' which are members in the gene-set specified by 'GSname'. The summary is by column. For each level of 'fac' there will be a separate pane.

'mnDiffPlot' calls `plot`; it plots the mean differences, by row, between columns belonging to the two groups specified by 'fac', as a function of the mean values for the first group alone. Each row translates to a single point on the graph. Again, the summary is only for rows indicated by 'GSname'.

For gene-set selective plots to properly work, the incidence matrix needs to have non-empty row names, and 'GSname' must match one of them.

If both 'GSname' and 'incidence' are left blank, automatic utilities are called which help generate a summary of the entire matrix, by column.

All functions plot a reference line signalling zero. 'mnDiffPlot' also optionally plots a loess fit for expression differences (if 'fitline=TRUE').

### Note

One can use 'resplot'/'restrip' to plot raw expression values rather than residuals; it all depends on what's in the data matrix.

### Author(s)

Assaf Oron

### See Also

`boxplot`,`plot`,`stripchart`,`par`,`GOmnplot`

### Examples

    data(sample.ExpressionSet)
    lm1 = lmPerGene(sample.ExpressionSet,~sex)
    r1 = getResidPerGene(lm1)
    ### now a boxplot of all residuals by sample
    resplot(resmat=exprs(r1),fac=sample.ExpressionSet$sex)
    ### This plot is not very informative because of some gross outliers;
    ### try this instead
    resplot(resmat=exprs(r1),fac=sample.ExpressionSet$sex,lims=c(-5,5))

    ### stripchart for first 10 genes
    restrip(resmat=exprs(r1)[1:10,],fac=sample.ExpressionSet$type,prefix="Not")

    ### note the wild trajectory of the loess fit:
    mnDiffPlot(exprmat=exprs(sample.ExpressionSet),fac=sample.ExpressionSet$type,xname="Raw Expression",yname="Expression Difference",fitline=TRUE)

[Package GSEAlm version 1.2.0 Index]