Easy and efficient ensemble gene set testing with EGSEA

Gene set enrichment analysis is a popular approach for prioritising the biological processes perturbed in genomic datasets. The Bioconductor project hosts over 80 software packages capable of gene set analysis. Most of these packages search for enriched signatures amongst differentially regulated genes to reveal higher level biological themes that may be missed when focusing only on evidence from individual genes. With so many different methods on offer, choosing the best algorithm and visualization approach can be challenging. The EGSEA package solves this problem by combining results from up to 12 prominent gene set testing algorithms to obtain a consensus ranking of biologically relevant results.This workflow demonstrates how EGSEA can extend limma-based differential expression analyses for RNA-seq and microarray data using experiments that profile 3 distinct cell populations important for studying the origins of breast cancer. Following data normalization and set-up of an appropriate linear model for differential expression analysis, EGSEA builds gene signature specific indexes that link a wide range of mouse or human gene set collections obtained from MSigDB, GeneSetDB and KEGG to the gene expression data being investigated. EGSEA is then configured and the ensemble enrichment analysis run, returning an object that can be queried using several S4 methods for ranking gene sets and visualizing results via heatmaps, KEGG pathway views, GO graphs, scatter plots and bar plots. Finally, an HTML report that combines these displays can fast-track the sharing of results with collaborators, and thus expedite downstream biological validation. EGSEA is simple to use and can be easily integrated with existing gene expression analysis pipelines for both human and mouse data.


Introduction
Gene set enrichment analysis allows researchers to efficiently extract biological insights from long lists of differentially expressed genes by interrogating them at a systems level. In recent years, there has been a proliferation of gene set enrichment (GSE) analysis methods released through the Bioconductor project 1 together with a steady increase in the number of gene set collections available through online databases such as MSigDB 2 , GeneSetDB 3 and KEGG 4 . In an effort to unify these computational methods and knowledge-bases, the EGSEA R/Bioconductor package was developed. EGSEA, which stands for Ensemble of Gene Set Enrichment Analyses 5 combines the results from multiple algorithms to arrive at a consensus gene set ranking to identify biological themes and pathways perturbed in an experiment. EGSEA calculates seven statistics to combine the individual gene set statistics of base GSE methods to rank biologically relevant gene sets. The current version of the EGSEA package 6 utilizes the analysis results of up to twelve prominent GSE algorithms that include: ora 7 , globaltest 8 , plage 9 , safe 10 , zscore 11 , gage 12 , ssgsea 13 , padog 14 , gsva 15 , camera 16 , roast 17 and fry 17 . The ora, gage, camera and gsva methods depend on a competitive null hypothesis which assumes the genes in a set do not have a stronger association with the experimental condition compared to randomly chosen genes outside the set. The remaining eight methods are based on a self-contained null hypothesis that only considers genes within a set and again assumes that they have no association with the experimental condition.
EGSEA provides access to a diverse range of gene signature collections through the EGSEAdata package that includes more than 25,000 gene sets for human and mouse organised according to their database sources (Table 1). For example, MSigDB 2 includes a number of collections (Hallmark (h) and c1-c7) that explore different biological themes ranging from very broad (h, c2, c5) through to more specialised ones focusing on cancer (c4, c6) and immunology (c7). The other main sources are GeneSetDB 3 and KEGG 4 which have similar collections focusing on different biological characteristics ( Table 1). The choice of collection/s in any given analysis should of course be guided by the biological question of interest. The MSigDB c2 and c5 collections are the most widely used in our own analysis practice, spanning a wide range of biological processes and can often reveal new biological insights when applied to a given dataset.
The purpose of this article is to demonstrate the gene set testing workflow available in EGSEA on both RNA-seq and microarray data. Each analysis involves four major steps that are summarized in Figure 1: (1) selecting appropriate gene set collections for analysis and building an index that maps between the members of each set and the expression matrix; (2) choosing the base GSE methods to combine and the ranking options; (3) running the EGSEA test and (4) reporting results in various ways to share with collaborators. The EGSEA functions involved in each of these steps are introduced with code examples to demonstrate how they can be deployed as part of a limma differential expression analysis to help with the interpretation of results. Gene sets representing well-defined biological states or processes that have coherent expression. Gene sets by chromosome and cytogenetic band.
Gene sets obtained from a variety of sources, including online pathway databases and the biomedical literature.

Gene expression profiling of the mouse mammary gland
The first experiment analysed in this workflow is an RNA-seq dataset from Sheridan et al. (2015) 18 that consists of 3 cell populations (Basal, Luminal Progenitor (LP) and Mature Luminal (ML)) sorted from the mammary glands of female virgin mice. Triplicate RNA samples from each population were obtained in 3 batches and sequenced on an Illumina HiSeq 2000 using a 100 base-pair single-ended protocol. Raw sequence reads from the fastq files were aligned to the mouse reference genome (mm10) using the Rsubread package 19 . Next, gene-level counts were obtained using featureCounts 20 based on Rsubread's built-in mm10 RefSeq-based annotation. The raw data along with further information on experimental design and sample preparation can be downloaded from the Gene Expression Omnibus (GEO, www.ncbi.nlm.nih.gov/geo/) using GEO Series accession number GSE63310 and will be preprocessed according to the RNA-seq workflow published by Law et al. (2016) 21 .
The second experiment analysed in this workflow comes from Lim et al. (2010) 22 and is the microarray equivalent of the RNA-seq dataset mentioned above. The same 3 populations (Basal (also referred to as "MaSC-enriched"), LP and ML) were sorted from mouse mammary glands via flow cytometry. Total RNA from 5 replicates of each cell population were hybridised onto 3 Illumina MouseWG-6 v2 BeadChips. The intensity files and chip annotation file available in Illumina's proprietary formats (IDAT and BGX respectively) can be downloaded from http://bioinf.wehi. edu.au/EGSEA/arraydata.zip. The raw data from this experiment is also available from GEO under Series accession number GSE19446.

Analysis of RNA-seq data with EGSEA
Our RNA-seq analysis follows on directly from the workflow of Law et al. (2016) which performs a differential gene expression analysis on this data set using the Bioconductor packages edgeR 23 , limma 24 and Glimma 25 with gene annotation from the Mus.musculus package 26 . The limma package offers a well-developed suite of statistical methods for dealing with differential expression for both microarray and RNA-seq datasets and will be used in the analyses of both datasets presented in this workflow.
Reading, preprocessing and normalisation of RNA-seq data To get started with this analysis, download the R data file from http://bioinf.wehi.edu.au/EGSEA/mam.rnaseq.rdata. The code below loads the preprocessed count matrix from Law et al. (2016), performs TMM normalisation 27 on the raw counts, and calculates voom weights for use in comparisons of gene expression between Basal and LP, Basal and ML, and LP and ML populations.
> v = voom(x, design, plot=FALSE) > names(v) [1] "genes" "targets" "E" "weights" "design" For further information on preprocessing see Law et al. (2016), as a detailed explanation of these steps is beyond the scope of this article.

Gene set testing
The EGSEA algorithm makes use of the voom object (v), a design matrix (design) and an optional contrasts matrix (contr.matrix). The design matrix describes how the samples in the experiment relate to the coefficients estimated by the linear model 29 . The contrasts matrix then compares two or more of these coefficients to allow relative assessment of differential expression. Base methods that utilize linear models such as those from limma and GSVA (gsva, plage, zscore and ssgsea) make use of the design and contrasts matrices directly. For methods that do not support linear models, these two matrices are used to extract the group information for each comparison.

Exploring, selecting and indexing gene set collections
The package EGSEAdata includes more than 25,000 gene sets organized in collections depending on their database sources. Summary information about the gene set collections available in EGSEAdata can be displayed as follows: > library(EGSEAdata) > egsea.data("mouse") The following databases are available in EGSEAdata for Mus musculus: Type ?<data object name> to get a specific information about it, e.g., ?kegg.pathways.
As the output above suggests, users can obtain help on any of the collections using the standard R help (?) command, for instance ?Mm.c2 will return more information on the mouse version of the c2 collection from MSigDB. The above information can be returned as a list: > info = egsea.data("mouse", returnInfo = TRUE) > names(info) [1] "kegg" "msigdb" "gsetdb" > info$msigdb$info$collections [1] "h" "c1" "c2" "c3" "c4" "c5" "c6" "c7" To highlight the capabilities of the EGSEA package, the KEGG pathways, c2 (curated gene sets) and c5 (Gene Ontology gene sets) collections from the MSigDB database are selected. Next, an index is built for each gene set collection using the EGSEA indexing functions to link the genes in the different gene set collections to the rows of our RNA-seq gene expression matrix. Indexes for the c2 and c5 collections from MSigDB and for the KEGG pathways are built using the buildIdx function which relies on Entrez gene IDs as its key. In the EGSEAdata gene set collections, Entrez IDs are used as they are widely adopted by the different source databases and tend to be more consistent and robust since there is one identifier per gene in a gene set. It is also relatively easy to convert other gene IDs into Entrez IDs.
> slotNames(gs.annots$c2) [1] "original" "idx" "anno" "featureIDs" "species" [6] "name" "label" "version" "date" Other EGSEA functions such as buildCustomIdx, buildGMTIdx, buildKEGGIdx, buildMSigDBIdx and buildGeneSetDBIdx can be also used to build gene set collection indexes. The functions buildCustomIdx and buildGMTIdx were written to allow users to run EGSEA on gene set collections that may have been curated within a lab or downloaded from public databases and allow use of gene identifiers other than Entrez IDs. Example databases include, ENCODE Gene Set Hub (available from https://sourceforge.net/projects/encodegenesethub/), which is a growing resource of gene sets derived from high quality ENCODE profiling experiments encompassing hundreds of DNase hypersensitivity, histone modification and transcription factor binding experiments 30 . Other resources include PathwayCommons (http://www.pathwaycommons.org/) 31 and the KEGGREST 32 package that provides access to up-to-date KEGG pathways across many species.

Configuring EGSEA
Before an EGSEA test is carried out, a few parameters need to be specified. First, a mapping between Entrez IDs and Gene Symbols is created for use by the visualization procedures. This mapping can be extracted from the genes data.frame of the voom object as follows: > colnames(v$genes) [1] "ENTREZID" "SYMBOL" "CHR" > symbolsMap = v$genes[, c(1, 2)] > colnames(symbolsMap) = c("FeatureID", "Symbols") > symbolsMap[, "Symbols"] = as.character(symbolsMap[, "Symbols"]) Another important parameter in EGSEA is the list of base GSE methods (baseMethods in the code below), which determines the individual algorithms that are used in the ensemble testing. The supported base methods can be listed using the function egsea.base as follows: > egsea.base() [1] "camera" "roast" "safe" "gage" "padog" "plage" [7] "zscore" "gsva" "ssgsea" "globaltest" "ora" "fry" The plage, zscore and ssgsea algorithms are available in the GSVA package and camera, fry and roast are implemented in the limma package 24 . The ora method is implemented using the phyper function from the stats package 33 , which estimates the hypergeometric distribution for a 2 × 2 contingency table. The remaining algorithms are implemented in Bioconductor packages of the same name. A wrapper function is provided for each individual GSE method to utilize this existing R code and create a universal interface for all methods.
Eleven base methods are selected for our EGSEA analysis: camera, safe, gage, padog, plage, zscore, gsva, ssgsea, globaltest, ora and fry. Fry is a fast approximation of roast that assumes equal gene-wise variances across samples to produce similar p-values to a roast analysis run with an infinite number of rotations, and is selected here to save time.
Since each base method generates different p-values, EGSEA supports six different methods from the metap package 34 for combining individual p-values (Wilkinson 35 is default), which can be listed as follows: > egsea.combine() [1] "fisher" "wilkinson" "average" "logitp" "sump" "sumz" [7] "votep" "median" Finally, the sorting of EGSEA results plays an essential role in identifying relevant gene sets. Any of EGSEA's combined scores or the rankings from individual base methods can be used for sorting the results.

EGSEA analysis has completed
In situations where the design matrix includes an intercept, a vector of integers that specify the columns of the design matrix to test using EGSEA can be passed to the contrasts argument. If this parameter is NULL, all pairwise comparisons based on v$targets$group are created, assuming that group is the primary factor in the design matrix. Likewise, all the coefficients of the primary factor are used if the design matrix has an intercept.
EGSEA is implemented with parallel computing features enabled using the parallel package 33 at both the methodlevel and experimental contrast-level. The running time of the EGSEA test depends on the base methods selected and whether report generation is enabled or not. The latter significantly increases the run time, particularly if the argument display.top is assigned a large value (> 20) and/or a large number of gene set collections are selected. EGSEA reporting functionality generates set-level plots for the top gene sets as well as collection-level plots.
The EGSEA package also has a function named egsea.cnt, that can perform the EGSEA test using an RNA-seq count matrix rather than a voom object, a function named egsea.ora, that can perform overrepresentation analysis with EGSEA reporting capabilities using only a vector of gene IDs, and the egsea.ma function that can perform EGSEA testing using a microarray expression matrix as shown later in the workflow.
Classes used to manage the results. The output of the functions egsea, egsea.cnt, egsea.ora and egsea.ma is an S4 object of class EGSEAResults. Several S4 methods can be invoked to query this object. For example, an overview of the EGSEA analysis can be displayed using the show method as follows: This command displays the number of genes and samples that were included in the analysis, the experimental contrasts, base GSE methods, the method used to combine the p-values derived from different GSE algorithms, the sorting statistic used and the size of each gene set collection. Note that the gene set collections are identified using the labels that appear in parentheses (e.g. c2) in the output of show.

Reporting EGSEA results
Getting top ranked gene sets. A summary of the top 10 gene sets in each collection for each contrast in addition to the EGSEA comparative analysis can be displayed using the S4 method summary as follows: Another way of exploring the EGSEA results is to retrieve the top ranked N sets in each collection and contrast using the method topSets. For example, the top 10 gene sets in the c2 collection for the comparative analysis can be retrieved as follows: > topSets(gsa, gs.label="c2", contrast = "comparison", names.only=TRUE) Extracting the top gene sets of the collection c2 Curated Gene Sets for the contrast comparison Sorted by med.rank The gene sets are ordered based on their med.rank as selected when egsea was invoked above. When the argument names.only is set to FALSE, additional information is displayed for each gene set including gene set annotation, the EGSEA scores and the individual rankings by each base method. As expected, gene sets retrieved by EGSEA included the LIM gene sets 22 that were derived from microarray profiles of analagous mammary cell populations (sets 1, 2, 4, 6 and 8) as well as those derived from populations with similar origin (sets 7 and 9) and behaviour or characteristics (sets 5 and 10).
Next, topSets can be used to search for gene sets of interest based on different EGSEA scores as well as the rankings of individual methods. For example, the ranking of the six LIM gene sets from the c2 collection can be displayed based on the med.rank as follows: > t = topSets(gsa, contrast = "comparison", + names.only=FALSE, number = Inf, verbose = FALSE) > t[grep("LIM_", rownames(t)), c("p.adj", "Rank", "med.rank", "vote.rank")] p. While five of the LIM gene sets are ranked in the top 10 by EGSEA, the values shown in the median rank (med.rank) column indicate that individual methods can assign much lower ranks to these sets. EGSEA's prioritisation of these gene sets demonstrates the benefit of an ensemble approach.
Visualizing results at the gene set level. Graphical representation of gene expression patterns within and between gene sets is an essential part of communicating the results of an analysis to collaborators and other researchers. EGSEA enables users to explore the elements of a gene set via a heatmap using the plotHeatmap method. Figure 2 shows examples for the LIM_MAMMARY_STEM_CELL_UP and LIM_MAMMARY_STEM_CELL_DN signatures which can be visualized across all contrasts using the code below.
> plotHeatmap(gsa, gene.set="LIM_MAMMARY_STEM_CELL_UP", gs.label="c2", + contrast = "comparison", file.name = "hm_cmp_LIM_MAMMARY_STEM_CELL_UP") Generating heatmap for LIM_MAMMARY_STEM_CELL_UP from the collection c2 Curated Gene Sets and for the contrast comparison > plotHeatmap(gsa, gene.set="LIM_MAMMARY_STEM_CELL_DN", gs.label="c2", + contrast = "comparison", file.name = "hm_cmp_LIM_MAMMARY_STEM_CELL_DN") Generating heatmap for LIM_MAMMARY_STEM_CELL_DN from the collection c2 Curated Gene Sets and for the contrast comparison When using plotHeatmap, the gene.set value must match the name returned from the topSets method. The rows of the heatmap represent the genes in the set and the columns represent the experimental contrasts. The heatmap colour-scale ranges from down-regulated (blue) to up-regulated (red) while the row labels (Gene symbols) are coloured in green when the genes are statistically significant in the DE analysis (i.e. FDR ≤ 0.05 in at least one contrast). Heatmaps can be generated for individual comparisons by changing the contrast argument of plotHeatmap. The plotHeatmap method also generates a CSV file that includes the DE analysis results from limma::topTable for all expressed genes in the selected gene set and for each contrast (in the case of contrast = "comparison"). This file can be used to create customised plots using other R/Bioconductor packages.
In addition to heatmaps, pathway maps can be generated for the KEGG gene sets using the plotPathway method which uses functionality from the pathview package 36 . For example, the third KEGG signalling pathway retrieved for the contrast BasalvsLP is Vascular smooth muscle contraction and can be visualized as follows: > plotPathway(gsa, gene.set = "Vascular smooth muscle contraction", + contrast = "BasalvsLP", gs.label = "kegg", + file.name = "Vascular_smooth_muscle_contraction") Generating pathway map for Vascular smooth muscle contraction from the collection KEGG Pathways and for the contrast BasalvsLP

. Heatmaps of log-fold-changes for genes in the LIM_MAMMARY_STEM_CELL_UP and LIM_MAMMARY_ STEM_CELL_DN gene sets across the three experimental comparisons (Basal vs LP, Basal vs ML and LP vs ML).
Pathway components are coloured based on the gene-specific log-fold-changes as calculated in the limma DE analysis (Figure 3). Similarly, a comparative map can be generated for a given pathway across all contrasts.
> plotPathway(gsa, gene.set = "Vascular smooth muscle contraction", + contrast = "comparison", gs.label = "kegg", + file.name = "Vascular_smooth_muscle_contraction_cmp") Generating pathway map for Vascular smooth muscle contraction from the collection KEGG Pathways and for the contrast comparison The comparative pathway map shows the log-fold-changes for each gene in each contrast by dividing the gene nodes on the map into multiple columns, one for each contrast (Figure 4).

Visualizing results at the experiment level.
Since EGSEA combines the results from multiple gene set testing methods, it can be interesting to compare how different base methods rank a given gene set collection for a selected contrast. The plotMethods command generates a multi-dimensional scaling (MDS) plot for the ranking of gene sets across all the base methods used ( Figure 5). Methods that rank gene sets similarly will appear closer together in this plot and we see that certain methods consistently cluster together across different gene set collections. The clustering of methods does not necessarily follow the style of null hypothesis tested though (i.e. self-contained versus competitive).
> plotSummary(gsa, gs.label = 3, contrast = 3, + file.name = "summary_kegg_LPvsML") Generating Summary plots for the collection KEGG Pathways and for the contrast LPvsML The summary plot visualizes the gene sets as bubbles based on the − log 10 (p-value) (X-axis) and the average absolute log fold-change of the set genes (Y-axis). The sets that appear towards the top-right corner of this plot are most likely to be biologically relevant. EGSEA generates two types of summary plots: the directional summary plot (Figure 6a), which colours the bubbles based on the regulation direction of the gene set (the direction of the majority of genes), and the ranking summary plot (Figure 6b), which colours the bubbles based on the gene set ranking in a given collection (according to the sort.by argument). The bubble size is based on the EGSEA significance score in the former plot and the gene set size in the latter. For example, the summary plots of the KEGG pathways for the LP vs ML contrast show few significant pathways ( Figure 6). The blue colour labels on the ranking plot represents gene sets that do not appear in the top 10 gene sets that are selected based on the sort.by argument, yet their EGSEA significance scores are among the top 5 in the entire collection based on the significance score. This is used to identify gene sets with high significance scores that were not captured by the sort.by score. The gene set IDs and more information about each set can be found in the EGSEA HTML report generated later.
By default, plotSummary uses a gene set's p.adj score for the X-axis. This behaviour can be easily modified by assigning any of the available sort.by scores into the parameter x.axis, for example, med.rank can be used to create an EGSEA summary plot (Figure 7a) as follows: > plotSummary(gsa, gs.label = 1, contrast = 3, + file.name = "summary_c2_LPvsML", + x.axis = "med.rank") Generating Summary plots for the collection c2 Curated Gene Sets and for the contrast LPvsML The summary plot tends to become cluttered when the size of the gene set collection is very large as in Figure 7a. The parameter x.cutoff can be used to focus in on the significant gene sets rather than plotting the entire gene set collection, for example ( Figure 7b): > plotSummary(gsa, gs.label = 1, contrast = 3, + file.name = "summary_sig_c2_LPvsML", + x.axis = "med.rank", x.cutoff=300) Generating Summary plots for the collection c2 Curated Gene Sets and for the contrast LPvsML Comparative summary plots can be also generated to compare the significance of gene sets between two contrasts, for example, the comparison between Basal vs LP and Basal vs ML (Figure 8a) shows that most of the KEGG  pathways are regulated in the same direction with relatively few pathways regulated in opposite directions (purple coloured bubbles in Figure 8a). Such figures can be generated using the plotSummary method as follows: > plotSummary(gsa, gs.label = "kegg", contrast = c(1,2), + file.name = "summary_kegg_1vs2") Generating Summary plots for the collection KEGG Pathways and for the comparison BasalvsLP vs BasalvsML The plotSummary method has two useful parameters: (i) use.names that can be used to display gene set names instead of gene set IDs and (ii) interactive that can be used to generate an interactive version of this plot.
The c5 collection of MSigDB and the Gene Ontology collection of GeneSetDB contain Gene Ontology (GO) terms. These collections are meant to be non-redundant, containing only a small subset of the entire GO and visualizing how these terms are related to each other can be informative. EGSEA utilizes functionality from the topGO package 37 to generate GO graphs for the significant biological processes (BPs), cellular compartments (CCs) and molecular functions (MFs). The plotGOGraph method can generate such a display (Figure 9) as follows: > plotGOGraph(gsa, gs.label="c5BP", contrast = 1, file.name="BasalvsLP-c5BP-top-") Generating GO Graphs for the collection c5 GO Gene Sets (BP) and for the contrast BasalvsLP based on the med.rank > plotGOGraph(gsa, gs.label="c5CC", contrast = 1, file.name="BasalvsLP-c5CC-top-") Generating GO Graphs for the collection c5 GO Gene Sets (CC) and for the contrast BasalvsLP based on the med.rank The GO graphs are coloured based on the values of the argument sort.by, which in this instance was taken as med.rank by default since this was selected when EGSEA was invoked. The top five most significant GO terms are highlighted by default in each GO category (MF, CC or BP). More terms can be displayed by changing the value of the parameter noSig. However, this might generate very complicated and unresolved graphs. The colour of the nodes varies between red (most significant) and yellow (least significant). The values of the sort.by scoring function are scaled between 0 and 1 to generate these graphs.   can be used to display the values of a specific EGSEA score on the heatmap cells. An example summary heatmap can be generated for the MSigDB c2 collection with the following code: > plotSummaryHeatmap(gsa, gs.label="c2", hm.vals = "avg.logfc.dir", + file.name="summary_heatmaps_c2") Generating summary heatmap for the collection c2 Curated Gene Sets sort.by: med.rank, hm.vals: avg.logfc.dir, show.vals: > plotSummaryHeatmap(gsa, gs.label="kegg", hm.vals = "avg.logfc.dir", + file.name="summary_heatmaps_kegg") Generating summary heatmap for the collection KEGG Pathways sort.by: med.rank, hm.vals: avg.logfc.dir, show.vals: Figure 10. Bar plot of the -log10(p-value) of the top 20 gene sets from the comparative analysis of the c2 collection.
We find the heatmap view at both the gene set and summary level and the summary level bar plots to be useful summaries to include in publications to highlight the gene set testing results. The top differentially expressed genes from each contrast can be accessed from the EGSEAResults object using the limmaTopTable method. Creating an HTML report of the results. To generate an EGSEA HTML report for this dataset, you can either set report=TRUE when you invoke egsea or use the S4 method generateReport as follows: > generateReport(gsa, number = 20, report.dir="./mam-rnaseq-egsea-report") EGSEA HTML report is being generated ...
The EGSEA report generated for this dataset is available online at http://bioinf.wehi.edu.au/EGSEA/mamrnaseq-egsea-report/index.html (Figure 12). The HTML report is a convenient means of organising all of the results generated up to now, from the individual tables to the gene set level heatmaps, pathway maps and summary level plots. It can easily be shared with collaborators to allow them to explore their results more fully. Interactive tables of results via the DT package (https://CRAN.R-project.org/package=DT) and summary plots from plotly (https://CRAN.R-project.org/package=plotly) are integrated into the report using htmlwidgets (https:// CRAN.R-project.org/package=htmlwidgets) and can be added by setting interactive = TRUE in the command above. This option significantly increases both the run time and size of the final report due to the large number of gene sets in most collections.
This example completes our overview of EGSEA's gene set testing and plotting capabilities for RNA-seq data. Readers can refer to the EGSEA vignette or individual help pages for further details on each of the above methods and classes.

Analysis of microarray data with EGSEA
The second dataset analysed in this workflow comes from Lim et al. (2010) 22 and is the microarray equivalent of the RNA-seq data analysed above. Support for microarray data is a new feature in EGSEA, and in this example, we show an express route for analysis according to the steps shown in Figure 1, from selecting gene sets and building indexes, to configuring EGSEA, testing and reporting the results. First, the data must be appropriately preprocessed for an EGSEA analysis and to do this we make use of functions available in limma.

Reading, preprocessing and normalisation of microarray data
To analyse this dataset, we begin by unzipping the files downloaded from http://bioinf.wehi.edu.au/EGSEA/arraydata. zip into the current working directory. Illumina BeadArray data can be read in directly using the readIDAT and readBGX functions from the illuminaio package 38 . However, a more convenient way is via the read.idat function in limma which uses these illuminaio functions and outputs the data as an EListRaw object for further processing.

> data = neqc(data)
We then filter out probes that are consistently non-expressed or lowly expressed throughout all samples as they are uninformative in downstream analysis. Our threshold for expression requires probes to have a detection p-value of less than 0.05 in at least 5 samples (the number of samples within each group). We next remove genes without a valid Entrez ID and in cases where there are multiple probes targeting different isoforms of the same gene, select the probe with highest average expression as the representative one to use in the EGSEA analysis. This leaves 7,123 probes for further analysis. >

Creating gene set collection indexes
We next extract the mouse c2, c5 and KEGG gene signature collections from the EGSEAdata package and build indexes based on Entrez IDs that link between the genes in each signature and the rows of our expression matrix.

Reporting EGSEA results
An HTML report that includes each of the gene set level and summary level plots shown individually for the RNA-seq analysis was then created using the generateReport function. We complete our analysis by displaying the top ranked sets for the c2 collection from a comparative analysis across all contrasts.

Discussion
In this workflow article, we have demonstrated how to use the EGSEA package to combine the results obtained from different gene signature databases across multiple GSE methods to find an ensemble solution.
A key benefit of an EGSEA analysis is the detailed and comprehensive HTML report that can be shared with collaborators to help them interpret their data. This report includes tables prioritising gene signatures according to the user specified analysis options, and both gene set specific and summary graphics, each of which can be generated individually using specific R commands. The approach taken by EGSEA is facilitated by the diverse range of gene set testing algorithms and plotting capabilities available within Bioconductor. EGSEA has been tailored to suit a limma-based differential expression analysis which continues to be a very popular and flexible platform for transcriptomic data. Analysts who choose an individual GSE algorithm to prioritise their results rather than an ensemble solution can still benefit from EGSEA's comprehensive reporting capability.

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Yes
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article? Yes No competing interests were disclosed.

Competing Interests:
We have read this submission. We believe that we have an appropriate level of expertise to confirm that it is of an acceptable scientific standard. EGSEA is a new gene set analysis tool that combines results from multiple individual tools in R as to yield better results. The authors have published EGSEA methodology previously. This paper focuses on the practical analysis workflow based on EGSEA with specific examples. As EGSEA is a compound and complicated analysis procedure, this work serves as a valuable guidance for the users to make full use of this tool. I've gone through the workflow line by line, it seems to work well. However, authors can improve their work by addressing the following issues.
There should be an R code script which includes all source code and concise comments like the one in company with the vignette in any Bioconductor package. It would be much easy for the users/reviewers to try the example code. It is not convenient to follow the code in this manuscript, the code need to be edit to remove the prompt symbols (> or +) at each line when copying/pasting. It takes too long to run the egsea analysis example on modest machine. It is advisable to show a lesser example in the workflow with only one gene set collection like kegg and just a few base methods like: gsa = egsea(voom.results=v, contrasts=contr.matrix, gs.annots=gs.annots$kegg, symbolsMap=symbolsMap, baseGSEAs=baseMethods[1:4], sort.by="med.rank", num.threads = 3, report = FALSE) The rank of the gsa results shown following the t = topSets(..) line is confusing. The p.adj for the top 1 gene set is not the smallest, actually much bigger than top 2, 6 and 8. Presumably, the gene sets are ranked by med.rank instead of p.adj here. However, the opposite was described in the text above near the egsea.sort() line: "Although p.adj is the default option for sorting EGSEA results for convenience, ..." In addition, there is big difference between the final rank and med.rank (e.g. 1 vs 36). This may 4.
In addition, there is big difference between the final rank and med.rank (e.g. 1 vs 36). This may suggest inconsistent results came from different base methods. This may also be due to the large number of gene sets being tested. Again, using a smaller gene set collection and a few base methods could make the ranking more consistent.
All visualization functions, i.e. plotHeatmap, plotPathway, plotGOGraph, plotMethods, plotSummary and plotBars share largely the same set of arguments, they can have a unified wrapper function like plot.gsa() with an extra argument type to specify the plot type.
Functions plotPathway, plotGOGraph are wrapper functions for those in the pathview and topGO package as the author noted in the text. It would be good to explicit show some message like "calling plotting function from pathview or topGO package etc", just like the message when running egsea().
HTML report of the results is a very valuable feature for the users. However, the code can run a long time, it would be helpful to add some progress reminder message to generateReport() function like egsea(). BTW, the KEGG Pathway graphs are not shown properly in the report example at . http://bioinf.wehi.edu.au/EGSEA/mam-rnaseq-egsea-report/index.html

Is the description of the software tool technically sound? Yes
Are sufficient details of the code, methods and analysis (if applicable) provided to allow replication of the software development and its use by others? Yes

Is sufficient information provided to allow interpretation of the expected output datasets and any results generated using the tool? Partly
Are the conclusions about the tool and its performance adequately supported by the findings presented in the article? Yes No competing interests were disclosed.

Competing Interests:
I have read this submission. I believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.

3.
This article describes a gene set enrichment analysis (GSEA) workflow for the "Ensembl of GSEA" (EGSEA) R/Bioconductor software . EGSEA is an ensemble-like method recently package published by the authors of this workflow that allows the user to simultaneously apply different GSEA algorithms on a high-throughput molecular profiling data set, by combining p-values associated with each algorithm using classical meta-analysis approaches such as the Fisher's method.
Because the statistical methodology is already described in detail in the corresponding publication, the present software tool article focuses on showing a step-by-step workflow with EGSEA. However, the vignette of the software package already provides a very detailed description about how to use EGSEA through its 39 pages. Therefore, it would be useful for the interested reader to find upfront when he/she should be consulting the vignette and when he/she should be consulting this workflow. Besides this introductory aspects, the following issues should be addressed before approval: The code given in the article breaks, at least in my computer, more concretely, at this line: gsa = egsea(voom.results=v, contrasts=contr.matrix, gs.annots=gs.annots, symbolsMap=symbolsMap, baseGSEAs=baseMethods, sort.by="med.rank", num.threads = 8, report while running it with the latest release version 1.6.0. This is strange since the package builds and runs the vignette without problems. So, this might be related to the different sample data sets. A possible hint may come from the fact that the 'buildIdx()' call is not returning the expected class of object, according to the workflow: class(gs.annots$s2) ## [1] "NULL" summary(gs.annots$s2) ## Length Class Mode ## 0 NULL NULL The workflow contains a rather high amount of code, often with a non-trivial use of externally instantiated objects and nested calls to functions. It would be helpful for the interested reader to be able to easily copy and paste the instructions, but the fact that R commands are given with the R shell '>' and '+' symbols makes it less easy. A non-expert user may even copy those characters and get an error. I would recommend removing those characters from the illustrated code, just as it happens with the vignette.
The workflow assumes that the user has a 'DGEList' object with gene metadata including the 1 No competing interests were disclosed. Competing Interests: I have read this submission. I believe that I have an appropriate level of expertise to confirm that it is of an acceptable scientific standard, however I have significant reservations, as outlined above.
The benefits of publishing with F1000Research: Your article is published within days, with no editorial bias You can publish traditional articles, null/negative results, case reports, data notes and more The peer review process is transparent and collaborative Your article is indexed in PubMed after passing peer review Dedicated customer support at every stage For pre-submission enquiries, contact research@f1000.com