This package implements the vissE algorithm to summarise results of gene-set analyses. Usually, the results of a gene-set enrichment analysis (e.g using limma::fry, singscore or GSEA) consist of a long list of gene-sets. Biologists then have to search through these lists to determines emerging themes to explain the altered biological processes. This task can be labour intensive therefore we need solutions to summarise large sets of results from such analyses.
This package provides an approach to provide summaries of results from gene-set enrichment analyses. It exploits the relatedness between gene-sets and the inherent hierarchical structure that may exist in pathway databases and gene ontologies to cluster results. For each cluster of gene-sets vissE identifies, it performs text-mining to automate characterisation of biological functions and processes represented by the cluster.
An additional power of vissE is to perform a novel type of gene-set enrichment analysis based on the network of similarity between gene-sets. Given a list of genes (e.g. from a DE analysis), vissE can characterise said list by first identifying all other gene-sets that are similar to it, following up with clustering the resulting gene-sets and finally performing text-mining to reveal emerging themes.
In addition to these analyses, it provides visualisations to assist the users in understanding the results of their experiment. This document will demonstrate these functions across the two use-cases. The vissE package can be downloaded as follows:
2 Summarising the results of a gene-set enrichment analysis
Often, the results of a gene-set enrichment analysis (be it an over representation analysis of a functional class scoring approach) is a list of gene-sets that are accompanied by their statistics and p-values or false discovery rates (FDR). These results are mostly scanned through by biologists who then extract relevant themes pertaining to the experiment of interest. The approach here, vissE, will allow automated extraction of themes.
The example below can be used with the results of any enrichment analysis. The data below is simulated to demonstrate the workflow.
library(msigdb) library(GSEABase) #load the MSigDB from the msigdb package msigdb_hs = msigdb.v7.2.hs.SYM() #append KEGG gene-sets msigdb_hs = appendKEGG(msigdb_hs) #select h, c2, and c5 collections (recommended) msigdb_hs = subsetCollection(msigdb_hs, c('h', 'c2', 'c5')) #randomly sample gene-sets to simulate the results of an enrichment analysis set.seed(360) geneset_res = sample(sapply(msigdb_hs, setName), 2500) #create a GeneSetCollection using the gene-set analysis results geneset_gsc = msigdb_hs[geneset_res] geneset_gsc #> GeneSetCollection #> names: GO_CARBOHYDRATE_TRANSPORT, GO_NEURON_DEVELOPMENT, ..., KARLSSON_TGFB1_TARGETS_DN (2500 total) #> unique identifiers: OCLN, SLC35B1, ..., TLCD3A (18844 total) #> types in collection: #> geneIdType: SymbolIdentifier (1 total) #> collectionType: BroadCollection (1 total)
A vissE analysis involves 3 steps:
- Compute gene-set overlaps and the gene-set overlap network
- Identify clusters of gene-sets based on their overlap
- Characterise clusters using text mining
- (Optional) Visualise gene-level statistics
2.1 Compute gene-set overlap
The default approach to computing overlaps is using the Jaccard index. Overlap is computed based on the gene overlap between gene-sets. Alternatively, the overlap coefficient can be used. The latter can be used to highlight hierarchical overlaps (such as those present in the gene ontology).
The overlap network plot above is annotated using the MSigDB category. If gene-set statistics are available, they can be projected onto the network too. Gene-set statistics can be passed onto the plotting function as a named vector.
#simulate gene-set statistics geneset_stats = rnorm(2500) names(geneset_stats) = geneset_res head(geneset_stats) #> GO_CARBOHYDRATE_TRANSPORT #> -1.9008283 #> GO_NEURON_DEVELOPMENT #> 0.7106184 #> SOTIRIOU_BREAST_CANCER_GRADE_1_VS_3_UP #> -0.5727491 #> GO_POSITIVE_REGULATION_OF_LONG_TERM_SYNAPTIC_DEPRESSION #> -0.6548686 #> SHIPP_DLBCL_CURED_VS_FATAL_UP #> 1.3053294 #> HP_PTERYGIUM #> -0.1599839 #plot the network and overlay gene-set statistics set.seed(36) #set seed for reproducible layout plotMsigNetwork(gs_ovnet, genesetStat = geneset_stats)
2.2 Identify clusters of gene-sets
Related gene-sets likely represent related processes. The next step is to identify clusters of gene-sets so that they can be assessed for biological themes. The specific clustering approach can be selected by the user though we recommend graph clustering approaches to use the information provided in the overlap graph. We recommend using the
igraph::cluster_walktrap() algorithm as it works well with dense graphs. Many other algorithms are implemented in the igraph package and these can be used instead of the walktrap algorithm.
library(igraph) #identify clusters grps = cluster_walktrap(gs_ovnet) #extract clustering results grps = groups(grps) #sort by cluster size grps = grps[order(sapply(grps, length), decreasing = TRUE)] #plot the top 12 clusters set.seed(36) #set seed for reproducible layout plotMsigNetwork(gs_ovnet, markGroups = grps[1:6], genesetStat = geneset_stats)
2.3 Characterise gene-set clusters
Gene-set clusters identified can be assessed for their biological similarities using text-mining approaches. Here, we perform a frequency analysis (adjusted for using the inverse document frequency) on the gene-set names or their short descriptions to assess recurring biological themes in clusters. These results are then presented as word clouds.
2.4 Visualise gene-level statistics for gene-set clusters
Gene-level statistics for each gene-set cluster can be visualised to better understand the genes contributing to significance of gene-sets. Gene-level statistics can be passed onto the plotting function as a named vector. A jitter is applied on the x-axis (due to its discrete nature).
library(ggplot2) #simulate gene-set statistics set.seed(36) genes = unique(unlist(geneIds(geneset_gsc))) gene_stats = rnorm(length(genes)) names(gene_stats) = genes head(gene_stats) #> OCLN SLC35B1 SLC35A1 SORBS1 ARPP19 SLC35D2 #> 0.3117314 0.8498291 0.7055331 1.6999284 -1.3455710 -0.5698134 #plot the gene-level statistics plotGeneStats(gene_stats, msigdb_hs, grps[1:6]) + geom_hline(yintercept = 0, colour = 2, lty = 2)
2.5 Combine results to interpret results
Results of a vissE analysis are best presented and interpreted as paneled plots that combine all of the above plots. This allows for collective interpretation of the gene-set clusters.
library(ggpubr) #create independent plots set.seed(36) #set seed for reproducible layout p1 = plotMsigWordcloud(msigdb_hs, grps[1:6], type = 'Name') p2 = plotMsigNetwork(gs_ovnet, markGroups = grps[1:6], genesetStat = geneset_stats) p3 = plotGeneStats(gene_stats, msigdb_hs, grps[1:6]) + geom_hline(yintercept = 0, colour = 2, lty = 2) #combine using functions from ggpubr ggarrange(p1, p2, p3, ncol = 3, common.legend = TRUE, legend = 'bottom')