library(clusterProfiler)
get_wp_organisms()16 Analysis with Other Knowledge Bases
16.1 Chapter overview
| Aspect | External and supplementary knowledge sources |
|---|---|
| Questions | How can WikiPathways and third-party enrichment services complement standard resources, and how can service results enter the common object workflow? |
| Input | Organism-specific WikiPathways annotations or gene lists/tables accepted by services such as DAVID. |
| Methods | WikiPathways ORA/GSEA; external service enrichment and result import/visualization. GSON packaging is covered separately. |
| Main functions | enrichWP(), gseWP(), get_wp_organisms(), enrichDAVID(); see also import helpers in enrichplot-import.qmd. |
| Output | Canonical enrichment objects where supported, or service-specific result tables for remote workflows. |
| Main limitations | Remote availability, limits, schemas, and update cadence can change. Preserve queries/background details and cite the service; DAVID update cadence is a known limitation. |
16.2 WikiPathways analysis
WikiPathways is a continuously updated pathway database curated by a community of researchers and pathway enthusiasts. WikiPathways produces monthly releases of GMT files for supported organisms at data.wikipathways.org. The clusterProfiler package (Yu et al. 2012) supports enrichment analysis (either ORA or GSEA) for WikiPathways using the enrichWP() and gseWP() functions. These functions will automatically download and parse the latest WikiPathways GMT file for the selected organism.
Supported organisms can be listed by. This query is network-backed, so it is disabled during the routine book build; run it explicitly when refreshing the supported-organism list.
16.2.1 WikiPathways over-representation analysis
enrichWP() and gseWP() download the WikiPathways GMT file over the network, and that download can fail transiently, so these calls are wrapped in retry() (defined in _common.R); feel free to drop the wrapper in your own analysis.
data(geneList, package="DOSE")
gene <- names(geneList)[abs(geneList) > 2]
retry(enrichWP(gene, organism = "Homo sapiens")) 16.2.2 WikiPathways gene set enrichment analysis
retry(gseWP(geneList, organism = "Homo sapiens"))If your input gene ID type is not Entrez gene ID, you can use the bitr() function to convert gene ID. If you want to convert the gene IDs in output result to gene symbols, you can use the setReadable() function, see also Section 18.2.
16.3 DAVID functional analysis
DAVID is a popular bioinformatics resource for functional annotation and enrichment analysis. Although we recommend using enrichGO and enrichKEGG which use up-to-date data maintained by Bioconductor, clusterProfiler provides enrichDAVID to support DAVID analysis for users who prefer it.
Users need to register an account on DAVID website and use the email address to access the web service.
require(clusterProfiler)
data(geneList, package="DOSE")
gene = names(geneList)[abs(geneList) > 2]
david = enrichDAVID(gene = gene,
idType="ENTREZ_GENE_ID",
listType="Gene",
annotation="KEGG_PATHWAY",
david.user = "clusterProfiler@hku.hk")The result can be visualized using the same functions as other enrichment results.
barplot(david)
cnetplot(david, foldChange=geneList)barplot(david) above is the ordinary barplot() generic: because david is an enrichResult, it dispatches to the barplot.enrichResult() method supplied by enrichplot, which is what draws the enrichment bar chart. (The automatic code link on this page sends barplot to graphics::barplot because the class of david is not statically known in the chunk; the method that actually runs is barplot.enrichResult().)
16.3.1 DAVID Web Service Limitations
DAVID Web Service has the following limitations:
- A job with more than 3000 genes to generate gene or term cluster report will not be handled by DAVID due to resource limit.
- No more than 200 jobs in a day from one user or computer.
- DAVID Team reserves right to suspend any improper uses of the web service without notice.
For more details, please refer to http://david.abcc.ncifcrf.gov/content.jsp?file=WS.html.
16.3.2 Custom Background
The enrichDAVID function also supports a custom background (universe) using the universe parameter.
enrichDAVID(gene = gene,
universe = names(geneList),
idType = "ENTREZ_GENE_ID",
listType = "Gene",
annotation = "KEGG_PATHWAY")16.3.3 Comparing DAVID Functional Profiles
Comparison of functional profiles among different gene clusters is also supported via compareCluster.
data(gcSample)
x=compareCluster(gcSample, fun="enrichDAVID", annotation="KEGG_PATHWAY")
plot(x)16.3.4 Note on Data Updates
As highlighted in a Nature Methods study (Wadi et al. (2016)), DAVID has a very low update frequency, often going more than 5 years between updates, leading to a continuous decline in knowledge completeness. This means analysis results may only reflect outdated biological knowledge, which could introduce biases in current research. As shown in previous comparisons, using clusterProfiler with Bioconductor annotation data often yields more comprehensive results (more annotated genes and enriched pathways) compared to DAVID.
16.4 GSON knowledge packaging
The generalized enrichment interface is now documented in the dedicated GSON chapter. That chapter treats GSON as the knowledge representation and exchange layer: it explains how to create or download GSON objects, combine resources with gsonList(), freeze resources for reproducibility, and pass them to the enrichment and visualization layers.
This chapter focuses on the remaining external databases and result-import workflows. Use GSON when the goal is to make a knowledge resource reusable, versioned, shareable, or combinable with other resources; use the external-resource sections below when the goal is to compare or import a result from a third-party service.
16.5 Next steps
- For reusable, versioned resources, see GSON.
- For network failures, service limits, and provenance records, see external-service troubleshooting.
- To adapt external result schemas, see result import.
- For custom annotations beyond these connectors, see universal enrichment.