11 clusterProfiler and enrichplot
clusterProfiler is a comprehensive suite of enrichment tools. It has functions to run ORA or GSEA over commonly used databases (GO, KEGG, KEGG Modules, DAVID, Pathway Commons, WikiPathways) as well as universal enrichment functions to perform ORA or GSEA with novel species or custom gene sets. We will use these universal tools in the final activity of this workshop, focusing on the supported organisms and datbases for the present activity.
One of the key advantages of using R over web tools is flexibility with visualisations.
The same authors have released a plotting package enrichplot dedicated to plotting enrichment results. In this activity, we will perform GSEA with clusterProfiler then explore many different visualisation options. At the end of the activity, we will have a poll to see which of the many plot types are the favourites! đ
Â
11.1 Supported databases, species and namespaces
One of the challenges when working with clusterProfiler for FEA is that each enrichment function has different supported organisms and different namespace requirements, so you can not necessarily use all of the functions over the same gene list. In this activity, we will review the FEA functions and investigate their requirements, before performing a gene ID conversion with the bitr function to enable compatability with our Pezzini et al 2017 dataset.
Letâs start by reviewing the dedicated database enrichment functions and what inbuilt support they have.
| Database | GO | KEGG | KEGG Modules | Pathway Commons | WikiPathways | DAVID |
|---|---|---|---|---|---|---|
| GSEA function | gseGO | gseKEGG | gseMKEGG | gsePC | gseWP | NA |
| ORA function | enrichGO | enrichKEGG | enrichMKEGG | enrichPC | enrichWP | enrichDAVID |
| Supported species | Those with Bioconductor annotation package (20) | KEGG Organisms (thousands) | KEGG Organisms (thousands) | Human (or convert to UniProt IDs) | entrez | Those supported by DAVID |
| Supported namespaces | differs depending on species | âkeggâ (compatible with entrez), âncbi-geneidâ, âncib-proteinidâ or âuniprotâ | âkeggâ (compatible with entrez), âncbi-geneidâ, âncib-proteinidâ or âuniprotâ | âhgncâ or âuniprot | entrez | Those supported by DAVID |
To obtain this information, 3 sources were required:
- The clusterProfiler user guide
- External websites (Bioconductor and KEGG Organisms)
-
clusterProfilerfunctions (egget_wp_organisms(),keytypes(org.Hs.eg.db))
This highlights the need to carefully review the tool you are using and explore the user guide and functionality.
Â
11.2 Activity overview
Since we have covered ORA with gprofiler, we will perform a GSEA with clusterProfiler using gseKEGG.
- Explore the functions of
clusterProfilerincluding which FEA functions support which organisms and which namespaces - Load input dataset (a gene matrix with adjusted P values and log2 fold change values)
- Extract the gene IDs and sort by log2 fold change to create the GSEA ranked gene list R object
- Use
bitrto convert gene IDs from ENSEMBL to ENTREZ for compatability withgseKEGG - Perform GSEA with
gseKEGG - Visualise results with many different plot types from
enrichplot
Â
11.3 Analysis workflow
The complete executable analysis is included below. Run the code chunks interactively while working through the chapter, or render the full Bookdown project to execute the analysis and retain the code, parameters, results, figures, and software-version information in the book output.
11.4 0. Working directory
Bookdown evaluates relative file paths from the book project directory. Confirm that the input files used below are available from that directory, or update the file paths to match your project structure:
#> [1] "/home/runner/work/Functional_Enrichment_Web_and_Command_Line/Functional_Enrichment_Web_and_Command_Line"
#> [1] "/home/runner/work/Functional_Enrichment_Web_and_Command_Line/Functional_Enrichment_Web_and_Command_Line"
11.5 1. Load input data and extract ranked gene list
We will once again load the Pezzini RNAseq dataset.
#> # A tibble: 6 Ă 10
#> Gene.ID Gene.Name Log2FC FDR `undif-r1` `undif-r2` `undif-r3` `dif-r1` `dif-r2` `dif-r3`
#> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 ENSG0000000⌠TSPAN6 0.929 9.00e-4 370 343 367 722 774 669
#> 2 ENSG0000000⌠DPM1 0.0858 4.53e-1 1001 912 998 1004 1136 1107
#> 3 ENSG0000000⌠SCYL3 -0.0244 8.13e-1 453 421 409 390 463 476
#> 4 ENSG0000000⌠C1orf112 -1.21 3.78e-3 674 589 603 159 380 353
#> 5 ENSG0000000⌠CFH 6.01 3.41e-3 0 0 0 70 28 21
#> 6 ENSG0000000⌠FUCA2 0.730 7.04e-2 499 469 416 1185 690 651
This time, instead of filtering for DEGs, we will extract all genes, and sort them by fold change (largest to smallest) to make our ranked gene list for GSEA.
What class of R object does our ranked gene list need to be in?
We can see geneList = order ranked geneList. Not informative!
Unfortunately, the required type of object is detailed under the enrichKEGG function, not the gseKEGG function! For enrichKEGG, the parameter gene is described as requiring âa vector of entrez gene idâ, yet for gseKEGG, the description for geneList is âorder ranked geneListâ. There is a little bit of sleuthing required at times!
#> ENSG00000079931 ENSG00000205403 ENSG00000169903 ENSG00000165973 ENSG00000163273 ENSG00000169908
#> 10.263151 9.472641 9.395927 9.019168 8.983136 8.793216
#> ENSG00000151615 ENSG00000125538 ENSG00000250366 ENSG00000012223 ENSG00000108688 ENSG00000169429
#> -7.436121 -7.685643 -7.759835 -7.829832 -7.887188 -8.350671
11.6 2. Check gseKEGG function arguments and requirements
Review the parameters:
Most of those defaults look suitable to start.
We have human so the default organism = "hsa" argument is correct. If you were working with a species other than human, you first need to obtain your organism code. You can derive this from KEGG Organisms or using the clusterProfiler function search_kegg_organism.
Pick your favourite species and search for the KEGG organism code by editing the variable âfaveâ then executing the code chunk:
#> kegg_species.rda is not found, download it online...
#> kegg_code scientific_name common_name
#> 139 ecb Equus caballus horse
#> 140 epz Equus przewalskii Przewalski's horse
#> 160 rfq Rhinolophus ferrumequinum greater horseshoe bat
#> 459 hcq Hippocampus comes tiger tail seahorse
#> 780 lpol Limulus polyphemus Atlantic horseshoe crab
#> 985 ecad Erigeron canadensis horseweed
Now back to the parameters - the defaults for P value correction and filtering, and gene set size limits are acceptable. We donât want to use internal data (i.e. we want to search against the latest KEGG online) so FALSE is apt here, and we do want to use the fgsea algorithm for analysis.
For the seed parameter, we should provide a value, to ensure results are the same each time the command is run. By setting a seed, you fix the sequence of random numbers generated within the GSEA algorithm.
We also need to check the keyType (gene namespace) against the input data that we have. From the help page, we can see the supported namespaces for the KEGG database are one of âkeggâ, âncbi-geneidâ, âncib-proteinidâ or âuniprotâ.
Going back to where we loaded the input data and ran head to view the first few rows, we can see our input has ENSEMBL gene IDs as well as official gene symbols. ENSEMBL gene IDs are generally preferable for bioinformatics analyses because they are more unique and stable compared to gene symbol.
Since our input data does not match any of the valid namespaces, we need to convert gene IDs! clusterProfiler has the bitr function to do this. BiomaRt is also a popular R package for this task.
11.7 3. Convert gene IDs
Check the usage for the bitr function:
We need to understand what the valid fromType and toType values are, and it turns out we need an Org.db to use bitr! This is a Bioconductor annotation package, of which there are currently only 20. So while the gseKEGG function supports all organisms in KEGG, performing gene ID conversion within clusterProfiler may not be possible for non-model species and you would need to seek a different method.
We have already loaded the org.Hs.eg.db annotation library. We can use this to search keytypes:
#> [1] "ACCNUM" "ALIAS" "ENSEMBL" "ENSEMBLPROT" "ENSEMBLTRANS" "ENTREZID"
#> [7] "ENZYME" "EVIDENCE" "EVIDENCEALL" "GENENAME" "GENETYPE" "GO"
#> [13] "GOALL" "IPI" "MAP" "OMIM" "ONTOLOGY" "ONTOLOGYALL"
#> [19] "PATH" "PFAM" "PMID" "PROSITE" "REFSEQ" "SYMBOL"
#> [25] "UCSCKG" "UNIPROT"
Converting to ENTREZ will be compatible with kegg. So our fromType is ENSEMBL and toType is ENTREZID. Note that these are case sensitive!
If we were to run enrichGO or gseaGO that require a Bioconductor Org.db package, we would not need to do a conversion, as both of the gene ID types within our input data (ENSEMBL and SYMBOL) are natively supported.
Gene ID conversion often results in duplicates. The below code performs the reformatting and handles duplicates by keeping only the first occurrence of duplicate Entrez IDs within the input. Note that this is not ideal and for a real experiment you should print out a list of duplicates, carefully review these and choose which and how to retain based on your biological context.
First, convert the ENSEMBL gene IDs from our ârankedâ list to ENTREZ gene IDs:
#> 'select()' returned 1:many mapping between keys and columns
#> Warning in bitr(names(ranked), fromType = "ENSEMBL", toType = "ENTREZID", : 0.8% of input gene IDs
#> are fail to map...
<1% failing to map is pretty good.
The 1:many mappings warning means that some of our gene IDs matched more than 1 ENTREZ ID. We need to ensure that the final list we provide to GSEA does not contain duplicates. This needs to happen at two stages: first of all, ensuring that each ENSEMBL ID is mapped to only one ENTREZ ID, and then once the final converted vector has been created, check it for duplicated ENTREZ IDs, which could occur when two different ENSEMBL IDs from our input map to the the same ENTREZ ID.
The below code does this by selecting the first of each set of duplicates. This is not ideal. In a real experiment, you should print out the duplicates and directly manage how to handle them by reviewing the gene IDs involved and deciding whether it is valid to select one ID over another, or at times you may choose to merge the values for duplicate genes.
#> 26002 3426 7104 4745 4880 4071
#> 10.263151 9.472641 9.395927 9.019168 8.983136 8.793216
#> 5458 3553 100507043 4057 6354 3576
#> -7.436121 -7.685643 -7.759835 -7.829832 -7.887188 -8.350671
Looks good! Now we are ready to enrich!
11.8 4. Run GSEA over KEGG database
Now run GSEA over the KEGG database with gseKEGG function, setting a seed value and kegg as our gene ID type. this may take a minute or two to run.
#> Reading KEGG annotation online: "https://rest.kegg.jp/link/hsa/pathway"...
#> Reading KEGG annotation online: "https://rest.kegg.jp/list/pathway/hsa"...
#> Warning in prepare_gsea_inputs(geneList, scoreType, exponent): There are ties in the preranked
#> stats (0.01% of the list). The order of those tied genes will be arbitrary, which may produce
#> unexpected results.
#> Warning in gsea(geneList = geneList, gene_sets = geneSets, weight = weight, : For some pathways, in
#> reality P-values are less than 1e-10. You can set the eps argument to zero for better estimation.
We have 3 warnings, one about ties in the ranked list, which we could resolve manually by reviewing the raw data, or just ignore it as it is only 0.01% of the list.
The second warning may be resolved by following the suggestion to set nPermSimple = 10000. How frustrating that this parameter is not described within the gseKEGG help menu, nor the clusterProfiler PDF at all!
Letâs rerun following both suggestions, to use permutations (nPermSimple = 1000) and set eps = 0. We will keep the rest of the arguments the same as before.
#> Warning in prepare_gsea_inputs(geneList, scoreType, exponent): There are ties in the preranked
#> stats (0.01% of the list). The order of those tied genes will be arbitrary, which may produce
#> unexpected results.
#> Warning in gsea(geneList = geneList, gene_sets = geneSets, weight = weight, : For some pathways, in
#> reality P-values are less than 1e-10. You can set the eps argument to zero for better estimation.
Great, those last 2 warnings have resolved and we only have the expected one about tied rankings.
11.9 5. Visualise GSEA KEGG results
11.9.1 Tabular results
First, letâs preview the results.
#> #
#> # Gene Set Enrichment Analysis
#> #
#> #...@organism hsa
#> #...@setType KEGG
#> #...@keytype kegg
#> #...@geneList Named num [1:14288] 10.26 9.47 9.4 9.02 8.98 ...
#> - attr(*, "names")= chr [1:14288] "26002" "3426" "7104" "4745" ...
#> #...nPerm 1000
#> #...pvalues adjusted by 'BH' with cutoff < 0.05
#> #...92 enriched terms found
#> 'data.frame': 92 obs. of 12 variables:
#> $ ID : chr "hsa04657" "hsa04061" "hsa04110" "hsa03040" ...
#> $ Description : chr "IL-17 signaling pathway" "Viral protein interaction with cytokine and cytokine receptor" "Cell cycle" "Spliceosome" ...
#> $ setSize : int 65 31 154 141 36 52 129 38 100 44 ...
#> $ enrichmentScore: num -0.684 -0.742 -0.562 -0.537 -0.679 ...
#> $ NES : num -2.47 -2.31 -2.31 -2.19 -2.19 ...
#> $ pvalue : num 2.48e-10 8.69e-07 1.00e-10 8.43e-10 4.46e-06 ...
#> $ p.adjust : num 4.37e-08 6.12e-05 3.52e-08 9.89e-08 1.96e-04 ...
#> $ qvalue : num 4.00e-08 5.60e-05 3.22e-08 9.06e-08 1.80e-04 ...
#> $ rank : int 251 113 1956 4811 1944 2613 1534 1144 5328 3225 ...
#> $ leading_edge : chr "tags=18%, list=2%, signal=18%" "tags=39%, list=1%, signal=38%" "tags=42%, list=14%, signal=37%" "tags=62%, list=34%, signal=42%" ...
#> $ core_enrichment: chr "2353/4318/7128/6347/5743/3627/2920/4312/7124/3553/6354/3576" "6373/9547/6366/6347/3627/6355/6352/2920/7852/7124/6354/3576" "11200/9587/10971/10735/23244/64682/1387/5933/9126/9232/27085/7027/10274/994/5591/8379/9134/4175/5347/7465/80174"| __truncated__ "6429/4116/4809/10569/84991/6626/25804/22827/11017/9092/8563/9984/9775/102724594/51729/151903/22938/26121/11157/"| __truncated__ ...
#> $ log2err : num 0.814 0.659 NaN 0.801 0.611 ...
#> #...Citation
#> S Xu, E Hu, Y Cai, Z Xie, X Luo, L Zhan, W Tang, Q Wang, B Liu, R Wang, W Xie, T Wu, L Xie, G Yu. Using clusterProfiler to characterize multiomics data. Nature Protocols. 2024, 19(11):3292-3320
At the line ## 'data.frame': 43 obs. of 11 variables, 43 is the number of significant enriched terms, and 11 is the number of columns in the output dataframe.
Extract results to a TSV file. This will print the significant enrichments, sorted by adjusted P value.
You can view the table in the editor pane by clicking on it from the Files pane.
11.9.2 Plots
One of the key advantages of using R over web tools is flexibility with visualisations. Next we will produce a range of plot types from the enrichplot package, developed by the same authors as clusterProfiler.
In this package, some of the plots can be used to plot ORA or GSEA results, and others only for one type or the other.
To determine which plot functions are compatible with which FEA results type, you can check the help menu. If you see ## S4 method for signature 'enrichResult' this plot is compatible with ORA results object. If you see ## S4 method for signature 'gseaResult' this plot is compatible with GSEA results object.
Review the help menu for the dotplot function, which can plot both ORA and GSEA:
And review the help menu for ridgeplot which can only plot GSEA results:
Unfortunately, enrichplot is only compatible with the enrichment results from the packages produced by this development team, although the desire to use enrichplot with the output of other tools is widespread. The R package multienrichjam has a function enrichDF2enrichResult that converts ORA dataframe results from other FEA tools to the format required for enrichplot.
multienrichjam has a lot of dependencies and has not been installed on these VMs so we will not be performing this today. However, this functionality and flexibility is pretty cool, so if you wanted to install this on your own computer outside the workshop, below is the code for installing :-)
11.9.2.1 dotplot
A dotplot is an easy to interpret plot. The size of the dot is proportional to the number of genes (count) in that term. A higher GeneRatio indicates that a larger portion of the gene set is significantly altered or associated with the observed changes in gene expression.
We can change the number of top terms that are plotted with the showCategory parameter.

11.9.2.2 upsetplot
The upset plot shows the pattern of shared genes among the enriched terms (since a gene can belong to multiple terms or pathways).
For GSEA, the plot includess fold change distributions on the Y axis.
n controls the number of terms plotted - here we have restricted to 10 for ease of viewing. Plot view is quite small within a notebook, but if you wanted to plot more terms, you could print to an A4 size output file for enhanced clarity.

11.9.2.3 emapplot
The enrichment map plot organises enriched terms into a network with edges connecting overlapping gene sets. Overlapping gene sets cluster together.
It is required to run the function pairwise_termsim before producing the plot.
When running pairwise_termsim, we donât need to save the output to a new object, because the information is added to the object and does not change any other attributes.
Each node is a term, and the number of genes associated with the term is shown by the dot size, with P values by dot colour.

11.9.2.4 treeplot
The treeplot provides the same information as the emapplot but presented in a different way.
Terms that share more genes or biological functions will be closer together in the tree structure. Clades are colour coded and âcluster tagsâ assigned. You can control the number of words in the tag (default is 4). The user guide describes the argument nWords however running that will throw an error (it says âwarningâ but it is fatal so to me thatâs an error!):
âWarning: Use âcluster.params = list(label_words_n = your_value)â instead of ânWordsâ. The nWords parameter will be removed in the next version.â
This plot also requires the pairwise similarity matrix calculation that emapplot does. Since we have already run it, it is hashed out in the code chunk below.
Plot view within the notebook affects the clarity of the cluster tags, however printing this plot to a file would resolve that.
Note also that enrichplotâs treeplot API has itself changed between versions - the cluster.params argument used above has since been replaced by a simpler nCluster argument:

11.9.2.5 cnetplot
The cnetplot depicts the linkages of genes and terms as a network. This is helpful to understanding which genes are involved in the enriched terms, ading a level of detail not offered by the plots we have generated so far.
For GSEA, where all genes (not just DEGs) are used, only the âcoreâ enriched genes are used to create the network plot. These are the âleading edge genesâ, those genes up to the point where the Enrichment Score (ES) gets maximised from the base zero. In other words, the subset of genes that are most strongly associated with a specific term.
There are a few parameters to play around with here to get a readable plot.
Try changing the number of terms plotted (showCategory).
Try changing the node_label which controls whether labels are put on terms (category), genes (item), or both (all).
Since the information that is attempted to be plotted is complex, having a large number of terms and attempting to label everything wonât look very informative! If you want to plot both gene IDs and term names, you will need to plot a small number of categories.
Like treeplot, the cnetplot API has also changed between enrichplot versions - the cex_label_gene, cex_label_category and colorEdge arguments used previously have been removed, and label sizing/edge colouring is now handled by the companion ggtangle package:

With 8 terms and no gene IDs, we donât get any more detail than from the treeplot or emapplot.
This plot is really useful for showing a detailed look at a small number of terms. Just plotting the top 3 terms may not look very helpful (try plotting the top 3!)
A useful application is plotting the interaction between specific terms. This is helpful to obtain gene ID level resolution for term interactions of interest.
The 3 terms listed below are for âIL-17 signaling pathwayâ, âViral protein interaction with cytokine and cytokine receptorâ and âChemokine signaling pathwayâ which are among the top 10 enrichments with a relationship of shared genes, evident from the plot above.
Run the code below or select a handful of terms of your choosing from the results table we printed earlier. We need the KEGG ID (column 1).
#> Warning: showCategory (5) is larger than available items (3). Using 3

Now we can clearly see the gene IDs for this network.
11.9.2.6 heatplot
Like the upset plot, the heatplot shows shared genes across enriched terms. When there are a lot of genes, it can be poorly readable, especially within the notebook. This function does not include a parameter to restrict to âcoreâ genes like the cnetplot or ridgeplot so even when plotting a very small number of enriched terms, the X-axis is too cramped to be readable.

The gseKEGG result contains a data column containing the core/leading edge genes:
#> [1] "ID" "Description" "setSize" "enrichmentScore" "NES"
#> [6] "pvalue" "p.adjust" "qvalue" "rank" "leading_edge"
#> [11] "core_enrichment" "log2err"
So we can extract those and provide these to the heatmap to try to improve clarity. The downside of course is that we then lose some of the information about which genes are shared across terms.

Saving to a file only improves things slightly.
#> png
#> 2
11.9.2.7 ridgeplot
This function is specific for GSEA. It does not apply to ORA, since it plots NES.
The height of the ridge in the ridge plot represents the density of genes from the gene set at different points in the ranked list.
The area under the curve represents the distribution of these genes across the ranked list.
Higher peaks and more concentrated areas under the curve at the top of the list indicate stronger enrichment.
#> Picking joint bandwidth of 0.585

11.9.2.8 gseaplot
Another GSEA-specific plot, which shows the contribution to the normalised enrichment score (NES) of genes across the gene list.
The gseaplot can plot one term at a time. You would run GSEA plots for key terms of interest in your results.
The term âhsa04020â (Calcium signaling pathway) has a positive NES, an adjusted P value of 0.00046 and a set size of 279.

The term âhsa04062â (Chemokine signaling pathway) has a negative NE, a highly significant adjusted P value of 1.11E-06 and a set size of 129.

The term âhsa05163â has a slightly negative NES and a borderline adjusted P value of 0.046.

11.9.2.9 volcano plot
The volplot function within enrichplot does not support GSEA result objects, but we can use ggplot2 for this.
ggplot2 is a highly flexible R package for visualisations, and unlike enrichplot is not constrained to a specific plot type.
The volcano plot has the advantage of showing whether the genes in the enriched terms were predominantly from the top (upregulated) or bottom (downregulated) end of the list.

11.10 6. Save versions and session details
11.10.1 Database query dates
Unlike gprofiler, clusterProfiler does not have a function to list the version of the queried databases.
For this reason, we will save the analysis date to our rendered notebook, so the external database version could be back-calculated from the date if required:
#> Date of analysis:
#> [1] "2026-07-27"
11.10.2 R version and R package versions
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 24.04.4 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8 LC_COLLATE=C.UTF-8
#> [5] LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8 LC_PAPER=C.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats4 stats graphics grDevices datasets utils methods base
#>
#> other attached packages:
#> [1] ggupset_0.4.1 org.Hs.eg.db_3.23.1 AnnotationDbi_1.74.0 IRanges_2.46.0
#> [5] S4Vectors_0.50.1 Biobase_2.72.0 BiocGenerics_0.58.1 generics_0.1.4
#> [9] biomaRt_2.68.0 enrichplot_1.32.0 clusterProfiler_4.20.0 tidyr_1.3.2
#> [13] ggplot2_4.0.3 gprofiler2_0.2.4 readr_2.2.0 lubridate_1.9.5
#> [17] dplyr_1.2.1 downlit_0.4.5 kableExtra_1.4.1 knitr_1.51
#> [21] fs_2.1.0 yaml_2.3.12
#>
#> loaded via a namespace (and not attached):
#> [1] RColorBrewer_1.1-3 rstudioapi_0.19.0 jsonlite_2.0.0
#> [4] tidydr_0.0.6 magrittr_2.0.5 ggtangle_0.1.2
#> [7] farver_2.1.2 rmarkdown_2.31 vctrs_0.7.3
#> [10] memoise_2.0.1 RCurl_1.98-1.19 ggtree_4.2.0
#> [13] progress_1.2.3 htmltools_0.5.9 curl_7.1.0
#> [16] gridGraphics_0.5-1 sass_0.4.10 bslib_0.11.0
#> [19] htmlwidgets_1.6.4 plyr_1.8.9 httr2_1.3.0
#> [22] plotly_4.12.1 cachem_1.1.0 igraph_2.3.3
#> [25] lifecycle_1.0.5 pkgconfig_2.0.3 gson_0.2.0
#> [28] Matrix_1.7-5 R6_2.6.1 fastmap_1.2.0
#> [31] digest_0.6.39 aplot_0.3.1 ggnewscale_0.5.2
#> [34] patchwork_1.3.2 aisdk_1.4.12 ps_1.9.3
#> [37] textshaping_1.0.5 crosstalk_1.2.2 RSQLite_3.53.3
#> [40] filelock_1.0.3 labeling_0.4.3 timechange_0.4.0
#> [43] httr_1.4.8 polyclip_1.10-7 compiler_4.6.1
#> [46] bit64_4.8.2 fontquiver_0.2.1 withr_3.0.3
#> [49] S7_0.2.2 DBI_1.3.0 ggforce_0.5.0
#> [52] MASS_7.3-66 rappdirs_0.3.4 tools_4.6.1
#> [55] otel_0.2.0 ape_5.8-1 scatterpie_0.2.6
#> [58] glue_1.8.1 callr_3.8.0 nlme_3.1-170
#> [61] GOSemSim_2.38.3 grid_4.6.1 cluster_2.1.8.2
#> [64] reshape2_1.4.5 gtable_0.3.6 tzdb_0.5.0
#> [67] data.table_1.18.4 hms_1.1.4 xml2_1.6.0
#> [70] utf8_1.2.6 XVector_0.52.0 ggrepel_0.9.8
#> [73] pillar_1.11.1 stringr_1.6.0 yulab.utils_0.2.4
#> [76] vroom_1.7.1 splines_4.6.1 tweenr_2.0.3
#> [79] BiocFileCache_3.2.0 treeio_1.36.1 lattice_0.22-9
#> [82] renv_1.1.5 bit_4.6.0 tidyselect_1.2.1
#> [85] fontLiberation_0.1.0 GO.db_3.23.1 Biostrings_2.80.1
#> [88] fontBitstreamVera_0.1.1 gridExtra_2.3.1 bookdown_0.47
#> [91] Seqinfo_1.2.0 svglite_2.2.2 xfun_0.60
#> [94] stringi_1.8.7 lazyeval_0.2.3 ggfun_0.2.1
#> [97] evaluate_1.0.5 qvalue_2.44.0 gdtools_0.5.1
#> [100] tibble_3.3.1 BiocManager_1.30.27 ggplotify_0.1.3
#> [103] cli_3.6.6 systemfonts_1.3.2 processx_3.9.0
#> [106] jquerylib_0.1.4 Rcpp_1.1.2 dbplyr_2.6.0
#> [109] png_0.1-9 parallel_4.6.1 blob_1.3.0
#> [112] prettyunits_1.2.0 DOSE_4.6.0 bitops_1.0-9
#> [115] viridisLite_0.4.3 tidytree_0.4.8 ggiraph_0.9.6
#> [118] enrichit_0.2.0 ggridges_0.5.7 scales_1.4.0
#> [121] purrr_1.2.2 crayon_1.5.3 rlang_1.3.0
#> [124] KEGGREST_1.52.2
11.10.3 RStudio version
Typically, we would simply run RStudio.Version() to print the version details. However, when we knit this document to HTML, the RStudio.Version() function is not available and will cause an error. So to make sure our version details are saved to our static record of the work, we will save to a file, then print the file contents back into the chapter.
11.11 Build the Bookdown output
Save all changes before rendering. Build the complete book from the RStudio Build pane using Build Book, or run the project-specific Bookdown render command used by this workshop.
The chapter will render successfully only when all required packages and input files are available and the executable code chunks complete without errors. Output tables and figures written by the analysis will be saved relative to the Bookdown project directory unless a different path is specified.
â If the build fails, use the first error message in the render log to identify the missing file, package, object, or failed code chunk.
11.12 End of activity summary
- We have explored the supported organisms, namespaces and databases of the
clusterProfilerenrichment functions - We have extracted a ranked gene list for GSEA and converted the gene IDs for compatability with
gseKEGG - We have performed GSEA on the KEGG database with
gseKEGGand visualised the results with multiple plot types - We have captured all version details relevant to the session within the R notebook and knit the file to HTML for record keeping
Â
