3 Set up
The command-line chapters of this workshop (gprofiler2, clusterProfiler and enrichplot, Novel species FEA, FGSEA, and STRINGdb) use a number of R packages. On the day, these are already installed on the workshop-provided computers/VMs, so no action is needed. This page is for anyone who wants to run the code on their own computer, either during the workshop or afterwards.
This workshop was built and tested with R 4.6.1 and Bioconductor 3.23. Any recent R release (4.4 or later) with a matching Bioconductor release should work; see the Bioconductor release/R version table if you are installing on an older R version.
3.1 CRAN packages
Most of these come from the tidyverse plus a handful of enrichment-specific packages:
install.packages(c(
"tidyverse", # includes dplyr, ggplot2, readr, tidyr, and friends
"data.table",
"gprofiler2",
"ggupset",
"ggtangle",
"ggridges", # needed by enrichplot::ridgeplot()
"msigdbr",
"ontologyIndex",
"WebGestaltR",
"DT",
"ggrepel"
))Note on WebGestaltR: it includes Rust source code that gets compiled during installation, so a working Rust toolchain (including cargo) is required beforehand. If installation fails with a “cargo command is not available” or similar error, install/update Rust via rustup rather than an older distro-packaged cargo, then retry install.packages("WebGestaltR").
3.2 Bioconductor packages
Bioconductor packages are installed via BiocManager rather than install.packages():
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install(c(
"clusterProfiler",
"enrichplot",
"biomaRt",
"org.Hs.eg.db",
"fgsea",
"BiocParallel",
"STRINGdb",
"ReactomePA",
"AnnotationDbi",
"graphite"
))org.Hs.eg.db is the human genome-wide annotation package; it matches the human Pezzini et al. 2017 dataset used throughout the workshop.
3.3 Optional: GitHub-only package
The clusterProfiler/enrichplot chapter mentions multienrichjam, a package that converts ORA results from other tools into enrichplot-compatible objects. It is not required for this workshop, has a large dependency footprint, and is not installed on the workshop VMs. If you’d like to try it on your own computer:
# install.packages("remotes")
# remotes::install_github("jmw86069/multienrichjam", dependencies = TRUE)
3.4 Raw Data
# where are you? what folder are you working in
getwd()
## Download and untar the data
options(timeout = 3600)
download.file(
"https://bioinformatics.erc.monash.edu/home/hval0004/FEA_Workshop/data.tar", "data.tar"
)
untar("data.tar")
## Download workshop.R script. This file contains all the example code for this workshop.
download.file(
"https://monashbioinformaticsplatform.github.io/Functional_Enrichment_Web_and_Command_Line/workshop.R", "workshop.R"
)
# list downlowded files
list.files()
list.files("data")