Glimma 2,0 is an interactive R widget for creating plots for differential expression analysis, created using the Vega and htmlwidgets frameworks. It's an update/reimplementation of Glimma 1.0! New features include:
Feedback is welcome, please feel free to open an issue for any enhancements you would like to see in future.
You can install the development version of GlimmaV2 using devtools from the R command line.
devtools::install_github("hasaru-k/GlimmaV2")
The default mapping between the status vector and color of the gene is given below:
-1 (downreg) => blue
0 (not DE) => silver
1 (upreg) => red
Accordingly, the default status.colours argument is c("dodgerblue", "silver", "firebrick")
. If no status vector is provided, all genes are given a status value of 0. The colour mapping can be changed by varying the status.colours argument which must be a vector of three valid CSS strings (for example: #f304d3
, #fff
, rgb(253, 12, 134)
, steelblue
):
glimmaMA(fit, dge=rnaseq, status.colours=c("#3977db","#3d3f42","#db0d4e"))
glimmaVolcano(fit, dge=rnaseq, status.colours=c("blue", "darkgrey", "red"))
glimmaXY(x=fit$coef, y=fit$lod, dge=rnaseq, status=dtFit, status.colours=c("cyan", "grey", "hotpink"))
Gene symbol text will be displayed above selected points if there is a symbol
column (case-insensitive) within the gene annotation supplied as per the example plots shown above. The gene annotation is the anno
argument.
anno
defaults to x$genes
for DGELRT/DGEExact and MArrayLM objects and defaults to NULL
for DESeqDataSet objects - see ?glimmaMA
, ?glimmaVolcano
for further detailanno
is always NULL
by defaultThe scale_by
dropdown menu contains numeric features provided the groups
dataframe, while the shape_by
dropdown contains discrete features provided by the groups
dataframe. The colour_by
dropdown contains discrete features by default but can be altered to take numeric features such as library size by setting continuous.colour=TRUE
:
glimmaMDS(rnaseq, groups=groups, continuous.colour=TRUE)
The test used to distinguish numeric vs discrete features in the groups dataframe is sapply(groups, is.numeric)
, so the appropriate coercions can be used toggle ambiguous features between numeric/discrete.
Specifying a filename using the html
argument (including the extension) in any of the GlimmaV2 functions will export the widget to a standalone single HTML file, rather than displaying/returning the widget in R Markdown.
glimmaMA(fit, dge=rnaseq, html="MA_plot.html")
If more flexibility is required (ex. varying the background colour, whether or not the file should be standalone), the user can call htmlwidgets::saveWidget()
on instantiated widgets which has further options.
glMA <- glimmaMA(fit, dge=rnaseq)
htmlwidgets::saveWidget(glMA, file="glimmaV2Example.html")
GlimmaV2 automatically rescales the y-axis of the expression plot depending on which gene is currently selected. This can make it difficult to compare the expression of different genes. In order to fix the y-axis when selecting between multiple genes, you can specify a maximum y-value in the max_y_axis
input form.
Rescaling Axis | Fixed Axis |
---|---|
The width and height parameters can be adjusted to change the dimensions of the widget in pixels in the RStudio viewer and in knitted HTML:
glimmaMA(fit, dge=rnaseq, width=1200, height=1200)
All GlimmaV2 functions take optional width/height arguments. The default glimmaMA/glimmaXY width and height are both 920px, so they should be modified in a 1:1 ratio if preserving the original scale is desired.