This link is to a MUCH easier route. Using conda environments can make this process WAY easier. I will update this page with a step by step for using this route as opposed to the one outlined below.
NOTE: THIS IS A WORK IN PROGRESS. Ella DeWolf and Gordon Custer are working to identify errors and complications in the installation process.
Step by step guide for installing R packages on Teton. Installing packages in this fashion will allow you to install only once and avoid length installs every time you want something that isn't available by default.
In your home directory (the directory you access when logging onto Teton), create a directory called “R_LIBS”.
In your home directory create a hidden file called “.Renviron”
Edit this hidden file by using “vim .Renviron”
The only text in this hidden file should be “R_LIBS=/home/Yourhomedirectory/R_LIBS”
Navigate into the R_LIBS directory and make sure you can load R
Type “R” to load R. If successful quit by typing “q()” and select “n” to avoid saving the workspace.
You will then need to download the tarball for whatever package you would like to install.
Dada2 example: “wget https://github.com/benjjneb/dada2/archive/v1.16.tar.gz”
This will download the files into the R_LIBS folder. If its downloaded to your home folder move it to the R_LIBS directory.
Use “ls” to check that the package was downloaded and to check the name of the file.
To install the package use “R CMD INSTALL v1.16.tar.gz”
This will likely fail the first time as you will need to install the required dependencies by hand.
To find the tarballs for new packages, google the package name. This should get you to either the CRAN or bioconductor page for the package. Scroll down to find the link to the source code (.tar.gz). You can then click and drag the link to your terminal window. You can then put “wget” in front of the address to download the file.
For packages available via CRAN you can download the tarballs from the manual page (e.g. for the psych package: https://cran.r-project.org/web/packages/psych/index.html).
This step is what takes forever.
As a work around, you could copy the R_LIBS folder found at “//project/microbiome/R_LIBS” to your own home folder this folder should have all of the tarballs needed to install dada2 (and potentially tidyverse and DESeq2 but no promises).
You will have to install each package that is not found using R CMD INSTALL.
The error reads “ERROR: dependencies ‘pckgname’ are not available
This means you will have to install each package listed manually.
The folder R_LIBS includes all the necessary packages to do this for dada2
Most packages are easy to find, just type R CMD INSTALL then start typing the name of the package and tab to autocomplete.
Ella DeWolf and Reilly Dibner, this is what I was talking about. We can go through this together if you want.