In this vignette we present the basic features of Glimma. Glimma is an interactive R widget for creating plots for differential expression analysis, created using the Vega and htmlwidgets frameworks. The created plots can be embedded in R Markdown, or exported as standalone HTML documents. The data presented here is slightly modified from the RNAseq123 workflow and only a single contrast has been performed for simplicity. We can use either limma or edgeR to fit the models and they both share upstream steps in common.
To begin, the DGEList object from the workflow has been included with the package as internal data.
The multidimensional scaling (MDS) plot is frequently used to explore differences in samples. When data has been MDS transformed, the first two dimensions explain the greatest variance between samples, and the amount of variance decreases monotonically with increasing dimension.
The Glimma MDS plot contains two main components:
The Glimma MDS allows different dimensions to be plotted against each other, and for the colours of the points to be changed based on predefined factors. The grouping variables are taken from the
samples component of
DGEList objects used in
In the plot above, try:
Some customisations to the plot include:
glimmaMDS(dge, width=1200, height=1200), which will adjust the dimensions in pixels of the created widget - default width and height is 920px.
glimmaMDS(dge, continuous.color=TRUE), which specifies that continuous colour schemes should be used - useful for when a large number of differential selections are required.
glimmaMDS(dge, groups=[vector or data frame]), which allows changing the associated sample information such as experimental groups - this information is displayed in mouseover tooltips and can be used to adjust the plot using
The MA plot is a visualisation that plots the log-fold-change between experimental groups (M) against the mean expression across all the samples (A) for each gene.
The Glimma MA plot contains two main components:
The second plot shows gene expression from the last selected sample, which can be selected from the table or directly from the summary plot.
To create this plot we first need to run differential expression (DE) analysis for our data. We load in design and contrast matrices generated from the RNAseq123 workflow.
We fit our DE analysis using
voom, this leaves us with an object that contains test statistics for each gene.
The MA plot can then be created using the fitted object containing the statistics about the genes, and the
dge object containing information about the samples and raw counts.