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 with only a single contrast has been performed for simplicity. Here we use DESeq2 to fit the model.
To begin, the DGEList object from the workflow has been included with the package as internal data. We will convert this to a DESeq data object.
library(Glimma) library(edgeR) library(DESeq2) readRDS(system.file("RNAseq123/dge.rds", package = "Glimma")) dge <- DESeqDataSetFromMatrix( dds <-countData = dge$counts, colData = dge$samples, rowData = dge$genes, design = ~group )#> converting counts to integer mode
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 contains two main components:
The Glimma MDS allows different dimensions to be plotted against each other, with the proportion of variability explained by each dimension highlighted in the barplot alongside it. The interactive MDS plot can be created simply with a single argument for a DESeqDataSet object. The points in the MDS plot can have their size, colour and shape changed based on the information that is stored in the colData of the DESeqDataSet.
In the plot above, try:
Adjusting plot size
glimmaMDS(dds, width=1200, height=1200)
Users can specify the width and height of the MDS plot widget in pixels. The default width and height are 900 and 500 respectively.
Continuous colour schemes
This argument specifies that continuous colour schemes should be used, which can be useful for colouring samples by their expression for a particular gene.
Custom experimental groups
glimmaMDS(dds, groups=[vector or data frame])
This allows the user to change 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 the MA plot we first need to run differential expression (DE) analysis for our data using the
DESeq(dds, quiet=TRUE)dds <-
The MA plot can then be created using the
dds object that now contains fitted results and the gene counts.
glimmaMA(dds) #> 15 of 16624 genes were filtered out in DESeq2 tests