R is a software environment for statistical computing. R is completely free and is available for Windows, Mac and Linux.
RStudio is a graphical interface for R, with several windows and buttons, that can help you work more efficiently.
Bioconductor is an add-on for R, consisting of a series of packages (also called libraries) that provide tools for biological data analysis inside R.
Frequently asked questions about R on different platforms can be accessed through the following links:
The current version of R (Sep 2021) is 4.1.1. If you already have a version of R installed that is not at least R 4.0 I strongly recommend that you remove it before installing a new version. I'll briefly describe how to remove R on different operating systems. These instructions might not suit your version of OS perfectly, so for more details you can visit the links mentioned above.
Windows
Go to the Control Panel and choose "Add/Remove Programs" (Windows XP) or "Programs and Features" (Windows Vista/7/10), locate R and remove it. An alternative is to look for the R folder that is part of the programs that appear in the Start Menu. Inside this folder there should be a link to Uninstall R.
Mac OS X
Open a Terminal (Applications / Utilities / Terminal) and in it type:
sudo rm -rf /Library/Frameworks/R.framework /Applications/R.appyou will need to provide your password.
Linux
Open a Terminal and type:
sudo apt-get --purge remove r-base r-base-devyou will need to provide your password.
Go to this website and choose one of the mirrors:
http://cran.r-project.org/mirrors.htmlIn the "Download and Install R" section, choose the link for Linux, MacOS X or Windows accordingly.
Windows
Click on base and download and install using the first link: Download R #.##.# for Windows
Mac OS X
In the Latest release: section, download and install the first file: R-#.##.#.pkg
Linux
Choose the distribution that you're using and follow the instructions... good luck! ;o)
Note: be sure to also install r-base-dev
Example in Ubuntu using apt-get
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/' sudo apt-get update sudo apt-get install r-base r-base-dev
Installing RStudio should be much easier. Simply download the appropriate installer for your operating system from:
Download RStudio Desktopand follow the instructions.
It is very important that you are sure you already have the latest version of R installed on your computer. If you are not sure, do not try to install Bioconductor, since you will only have to start again later.
When you start R or RStudio (recommended), you should see something like this:
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen" Copyright (C) 2021 The R Foundation for Statistical Computing ... R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. ...
Is yours the latest version?
Now, in order to install Bioconductor all you need to do is to paste the following commands inside an R session. In RStudio, this will be within the Console window.
install.packages("BiocManager")
BiocManager::install()
It may ask you if you want to update old packages. For now say [n]o.
You can now install and use any Bioconductor package starting with the same function:
BiocManager::install("Biobase")
library(Biobase)
and you should see:
Welcome to Bioconductor
Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Congratulations, you now have R, RStudio and Bioconductor installed and are almost ready to conquer Bioinformatics!
At some point, you will need to install additional Bioconductor packages, depending on the kind of analysis you want to perform. In order to install them, you need to use the install function that comes in the BiocManager package you have already installed.
Linux in particular might require you to install other software before you can install some of these packages. It is quite likely that if you are using Linux, you will need to install the following to make sure everything works fine. In a regular Terminal, not inside R!
sudo apt-get install libxml2-dev libcurl4-openssl-dev libssl-dev curl
If you need to install many packages, you can adapt the following code, and paste it into your R session:
pkgs = c("AnnotationDbi", "BiocParallel", "Biostrings", "DESeq2",
"edgeR", "GenomicAlignments", "GenomicFeatures", "GenomicRanges", "ggplot2",
"hexbin", "knitr", "magrittr", "org.Hs.eg.db", "pheatmap", "RColorBrewer",
"RCurl", "readr", "ReportingTools", "Rsamtools", "rtracklayer", "statmod")
BiocManager::install(pkgs)
This may take some time, depending on your internet connection.
The full instructions on how to install Bioconductor are also available here:
http://www.bioconductor.org/install/index.html