Learn R Programming

Glimma (version 1.0.0)

glMDPlot.MArrayLM: Glimma MD Plot

Description

Draw an interactive MD plot from a MArrayLM object

Usage

"glMDPlot"(x, counts, anno, groups, samples, status = rep(0, nrow(x)), coef = ncol(x$coefficients), p.adj.method = "BH", search.by = "Symbols", jitter = 30, id.column = "GeneID", display.columns = id.column, cols = c("#0000FF", "#858585", "#B32222"), sample.cols = rep("#1f77b4", ncol(counts)), path = getwd(), folder = "glimma-plots", html = "MD-Plot", launch = TRUE, ...)

Arguments

x
the MArrayLM object.
counts
the matrix containing all counts.
anno
the data.frame containing gene annotations.
groups
the factor containing experimental groups of the samples.
samples
the names of the samples.
status
vector giving the control status of data point, of same length as the number of rows of object. If NULL, then all points are plotted in the default colour.
coef
integer or character index vector indicating which column of object to plot.
p.adj.method
character vector indicating multiple testing correction method. (defaults to "BH")
search.by
the name of the column which will be used to search for data points. (should contain unique values)
jitter
the amount of jitter to apply to the samples in the expressions plot.
id.column
the column containing unique identifiers for each gene.
display.columns
character vector containing names of columns to display in mouseover tooltips.
cols
vector of strings denoting colours corresponding to control status -1, 0 and 1. (may be R named colours or Hex values)
sample.cols
vector of strings denoting colours for each sample point on the expression plot.
path
the path in which the folder will be created.
folder
the name of the fold to save html file to.
html
the name of the html file to save plots to.
launch
TRUE to launch plot after call.
...
additional arguments to be passed onto the MD plot.

Value

Draws a two-panel interactive MD plot in an html page. The left plot shows the log-fold-change vs average expression. The right plot shows the expression levels of a particular gene of each sample.

Examples

Run this code

library(limma)
library(edgeR)

data(lymphomaRNAseq)
x <- lymphomaRNAseq

sel <- rowSums(cpm(x$counts)>0.5)>=3
x <- x[sel,]

genotype <- relevel(x$samples$group, "Smchd1-null")
x <- calcNormFactors(x, method="TMM")
des <- model.matrix(~genotype)

## Apply voom with sample quality weights and fit linear model
v <- voomWithQualityWeights(x, design=des, normalization="none", plot=FALSE)
vfit <- lmFit(v,des)

## Apply treat relative to a fold-change of 1.5
vtfit <- treat(vfit,lfc=log2(1.5))
vfit <- eBayes(vfit)
results <- decideTests(vfit,p.value=0.01)

glMDPlot(vfit, counts=x$counts, anno=x$genes, groups=genotype, samples=1:7,
         status=results[,2], main="MD plot: Wild-type vs Smchd1",
         display.columns=c("Symbols", "GeneID", "GeneName"),
         folder="Smchd1-Lymphoma")


Run the code above in your browser using DataLab