The sample data you'll need is available from this book's GitHub repository at https://github.com/danmaclean/R_Bioinformatics_Cookbook. If you want to use the code examples as they are written, then you will need to make sure that this data is located in your working directory's subdirectory.
Here are the R packages that you'll need. In general, you can install these with install.packages("package_name"). The packages listed under Bioconductor need to be installed with the dedicated installer, as described here. If you need to do anything else, the installation will be described in the recipes in which the packages are used:
- Bioconductor
- EnsDb.Hsapiens.v86
- MSnID
- MSnbase
- mzR
- proteoQC
- rtracklayer
- data.table
- dplyr
- ggplot2
- protViz
Bioconductor is huge and has its own installation manager. You can install the manager with the following code:
if (!requireNamespace("BiocManager")) install.packages("BiocManager")
Then, you can install the packages with this code:
BiocManager::install("package_name")
Normally in R, a user will load a library and use the functions directly by name. This is great in interactive sessions, but it can cause confusion when many packages are loaded. To clarify which package and function I'm using at a given moment, I will occasionally use the packageName::functionName() convention.
letters[1:5]
This will give us the following output:
## a b c d e
Note that the output lines are prefixed with ##.