Chapter 3 Getting started
3.1 Checklist (before the course)
Install the following software in advance in order to avoid unnecessary delays and leaving more time for the course contents.
RStudio; choose “Rstudio Desktop” to download the latest version. Optional but preferred. For further details, check the Rstudio home page.
Install and load the required R packages
After a successful installation you can start with the case study examples in this training material
3.2 Support and resources
For additional reading and online material, see Material section
For online support on installation and other matters, you can join us at:
- Users: miaverse Gitter channel
- Developers: Bioconductor Slack #microbiomeexperiment channel (ask for an invitation)
3.3 Installing and loading the required R packages
This section shows how to install and load all required packages into the R session. Only uninstalled packages are installed.
# List of packages that we need from cran and bioc
<- c("BiocManager", "bookdown", "dplyr", "ecodist", "ggplot2",
cran_pkg "gridExtra", "kableExtra", "knitr", "scales", "vegan")
<- c("ANCOMBC", "ape", "DESeq2", "DirichletMultinomial", "mia", "miaViz")
bioc_pkg
# Gets those packages that are already installed
<- cran_pkg[ cran_pkg %in% installed.packages() ]
cran_pkg_already_installed <- bioc_pkg[ bioc_pkg %in% installed.packages() ]
bioc_pkg_already_installed
# Gets those packages that need to be installed
<- setdiff(cran_pkg, cran_pkg_already_installed)
cran_pkg_to_be_installed <- setdiff(bioc_pkg, bioc_pkg_already_installed) bioc_pkg_to_be_installed
# If there are packages that need to be installed, installs them from CRAN
if( length(cran_pkg_to_be_installed) ) {
install.packages(cran_pkg_to_be_installed)
}
# If there are packages that need to be installed, installs them from Bioconductor
if( length(bioc_pkg_to_be_installed) ) {
::install(bioc_pkg_to_be_installed, ask = F)
BiocManager }
Now all required packages are installed, so let’s load them into the session. Some function names occur in multiple packages. That is why miaverse’s packages mia and miaViz are prioritized. Packages that are loaded first have higher priority.
# Reorders bioc packages, so that mia and miaViz are first
<- c(bioc_pkg[ bioc_pkg %in% c("mia", "miaViz") ],
bioc_pkg !bioc_pkg %in% c("mia", "miaViz") ] )
bioc_pkg[
# Loading all packages into session. Returns true if package was successfully loaded.
<- sapply(c(bioc_pkg, cran_pkg), require, character.only = TRUE)
loaded as.data.frame(loaded)
## loaded
## mia TRUE
## miaViz TRUE
## ANCOMBC TRUE
## ape TRUE
## DESeq2 TRUE
## DirichletMultinomial TRUE
## BiocManager TRUE
## bookdown TRUE
## dplyr TRUE
## ecodist TRUE
## ggplot2 TRUE
## gridExtra TRUE
## kableExtra TRUE
## knitr TRUE
## scales TRUE
## vegan TRUE