An open API service indexing awesome lists of open source software.

https://github.com/jmw86069/multienrichjam

Multi-Enrichment Analysis of Gene Set Enrichment Analysis Results
https://github.com/jmw86069/multienrichjam

clusterprofiler enrichment-analysis geneset-enrichment geneset-enrichment-analysis multi-enrichment-analysis multi-omics multienrichment pathway-enrichment pathway-enrichment-analysis

Last synced: 6 months ago
JSON representation

Multi-Enrichment Analysis of Gene Set Enrichment Analysis Results

Awesome Lists containing this project

README

          

---
output:
github_document:
fig_width: 10
fig_height: 10
df_print: kable
dev: ragg_png
---

```{r knitr_init, echo=FALSE}
knitr::opts_chunk$set(
collapse=TRUE,
warning=FALSE,
message=FALSE,
comment="#>",
fig.path="man/figures/README-"
);
options(knitr.table.format='markdown')
```
# multienrichjam

The goal of multienrichjam is to enable Multi-Enrichment Analysis
of multiple gene set pathway enrichment datasets together.

This work was inspired by complementary tools based originally upon
"Enrichment Map", a Cytoscape plugin developed by the lab of Dr. Gary Bader.

* Bader lab [EnrichmentMap](https://www.baderlab.org/Software/EnrichmentMap)
from [Merico,et al, PLoS One, 2010](https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0013984)

Similar methods were implemented in R by the group of Dr. Guangchuang Yu,
notably within the suite of `clusterProfiler` tools which include
`enrichplot::emapplot()` and `ggtangle::cnetplot()` among numerous other
powerful tools.

* [Biomedical Knowledge Mining using clusterProfiler (e-book)](https://yulab-smu.top/biomedical-knowledge-mining-book/index.html)
* [clusterProfiler](https://bioconductor.org/packages/release/bioc/html/clusterProfiler.html)
* [enrichplot](https://bioconductor.org/packages/release/bioc/html/enrichplot.html)

Multi-enrichment analysis is designed to complement existing tools,
while focusing on the details of comparing multiple enrichment results
together.

## How to install

Install using the `remotes` package:

```
# if necessary, install 'remotes'
# install.package("remotes")
remotes::install_github("jmw86069/multienrichjam",
upgrade="always",
build_vignettes=TRUE,
dependencies=TRUE);
```

Alternatively, use the `pak` package:

```
# if necessary, install 'pak'
# install.package("pak")
pak::pkg_install("jmw86069/multienrichjam",
upgrade=TRUE,
dependencies=TRUE);
```

The argument `dependencies=TRUE` includes suggested packages, most notably
the 'openxlsx' package which is used to import
Ingenuity Pathway Analysis (IPA) results stored in Excel 'xlsx' format.

## Package Reference

Documentation is created using 'pkgdown' with all functions, articles,
and changelog.

[Full multienrichjam documentation](https://jmw86069.github.io/multienrichjam)

# Quick walkthrough

Start with one or more enrichment results.
Each enrichment result is either a `data.frame` or `enrichResult`
from clusterProfiler, and must have the following columns:

* **Pathway name**: some identifier, name, or label
* **Enrichment P-value**: Typically adjusted P-value, or FDR
* **genes**: one field with genes involved in enrichment of each pathway

Any `enrichResult` will have this data already.

## `multiEnrichMap()` to create `Mem` output

```{r import-ipa, echo=FALSE}
library(multienrichjam)

ipafiles <- system.file("extdata",
c("Newborns-IPA.txt",
"OlderChildren-IPA.txt"),
package="multienrichjam");
names(ipafiles) <- c("Newborns", "OlderChildren")
ipa_l <- lapply(ipafiles, importIPAenrichment);
erlist <- lapply(ipa_l, function(i){
i[["Canonical Pathways"]];
});
er_Newborns <- erlist$Newborns;
er_OlderChildren <- erlist$OlderChildren;

## Turn off ComplexHeatmap warnings
ComplexHeatmap::ht_opt("message"=FALSE)
```

```{r mem}
Mem <- multiEnrichMap(list(
Newborns=er_Newborns,
OlderChildren=er_OlderChildren))
```

The output can be summarized by printing the object.

```{r print-mem}
Mem
```

## `prepare_folio()` to create `MemPlotFolio` output

This step determines pathway clusters, and defines other custom
features used to produce a "Mem Plot Folio" - which is a collection
of data visualization plots to navigate the results.

```{r prepare-folio}
Mpf <- prepare_folio(Mem)
```

## `GenePathHeatmap()`

This step displays the underlying gene-versus-pathway data,
and forms the basis for most of the **multienrichjam** analysis.

```{r gp-heatmap, fig.alt="Heatmap with gene-versus-pathway incidence matrix."}
GenePathHeatmap(Mpf)
```

Pathways are clustered according to gene content.
This step is intended to reduce redundancy, and to organize
enrichment results based upon shared subsets of genes.

Genes are also clustered according to shared pathways,
which can provide insights into the core genes involved
across multiple pathways.

## `EnrichmentHeatmap()`

This step displays the enrichment P-values in -log10 scale,
using the same pathway clusters as defined in the gene-pathway heatmap.

```{r enrichment-heatmap, fig.alt="Heatmap with enrichment P-values."}
EnrichmentHeatmap(Mpf)
```

## `CnetCollapsed()`

The "Cnet collapsed" network represents the Concept Network (Cnet) plot
using collapsed pathway clusters.
The first step `prepare_folio()` is critical to define or customize the
pathway cluster assignment.

```{r cnet-collapsed-show, eval=FALSE}
CnetCollapsed(Mpf)
```

```{r cnet-collapsed, echo=FALSE, fig.alt="Concept network (Cnet) with pathways collapsed by cluster."}
igraph::V(Mpf@cnet_collapsed[[1]])[29:32]$label.dist <- 0
CnetCollapsed(Mpf,
vertex.label.font=2, use_shadowText=TRUE)
```

By default, the cluster titles ("A", "B", "C", "D") are displayed,
however the pathways can be used to form a label.

```{r cnet-collapsed-set-show, eval=FALSE}
CnetCollapsed(Mpf, type="set")
```

```{r cnet-collapsed-set, echo=FALSE, fig.alt="Concept network (Cnet) showing pathways collapsed by set, using pathway names for each cluster label."}
CnetCollapsed(Mpf, type="set",
label_factor_l=list(nodeType=c(Gene=1, Set=0.7)),
use_shadowText=TRUE, vertex.label.font=2)
```

## `CnetExemplar()`

A "Cnet exemplar" plot uses one exemplar pathway per cluster,
providing an alternative network summary view.

```{r cnet-exemplar-show, eval=FALSE}
CnetExemplar(Mpf)
```

```{r cnet-exemplar, echo=FALSE, fig.alt="Concept network (Cnet) showing one exemplar pathway to represent each pathway cluster."}
CnetExemplar(Mpf,
vertex.label.font=2, use_shadowText=TRUE)
```

A Cnet exemplar plot can also be created using user-defined
pathways of interest.

### Custom Cnet Exemplar

```{r cnet-exemplar-custom-show, eval=FALSE}
custom_sets <- c(
"RAR Activation",
"mTOR Signaling",
"Growth Hormone Signaling",
"Tight Junction Signaling")
cnet <- mem2cnet(Mem[, custom_sets, ], spread_labels=TRUE)

jam_igraph(cnet)
```

```{r cnet-exemplar-custom, echo=FALSE, fig.alt="Concept network (Cnet) showing a custom subset of exemplar pathways chosen by the scientist."}
custom_sets <- c(
"RAR Activation",
"mTOR Signaling",
"Growth Hormone Signaling",
"Tight Junction Signaling")
cnet <- mem2cnet(Mem[, custom_sets, ])

jam_igraph(spread_igraph_labels(cnet),
label_factor_l=list(nodeType=c(Gene=1, Set=1)),
use_shadowText=TRUE, vertex.label.font=2)
```

Note that this process is two-steps:

1. Create the `cnet` network data.
2. Plot using `jam_igraph()`.

## `CnetCluster()`

A "Cnet cluster" network displays the pathways only in one pathway
cluster. It is not used very often, and typically is helpful when
there might be different sub-networks within one cluster.

```{r cnet-cluster-show, eval=FALSE}
CnetCluster(Mpf, cluster="C")
```

```{r cnet-cluster, echo=FALSE, fig.alt="Concept network (Cnet) showing all pathways from the pathway cluster 'C'."}
CnetCluster(Mpf, cluster="C",
vertex.label.font=2, use_shadowText=TRUE)
```