Troubleshooting Installing R Packages on Quest and Quest Analytics

Installing R Packages on the RStudio instance on the QUEST analytics node and QUEST Log-In Nodes.

Content
1. Preamble
2. Install
2.1 Seurat
2.2 Monocle3 2.3 SF
2.4 RGDAL
2.5 RJAGS

Preamble

Due to technical limitations in RStudio Server, some R packages installed on Quest login nodes may not work when loaded in RStudio Server on the Quest Analytics nodes. If you would still like to use the interface of RStudio but are unable to load all the R packages you need, you will need to launch RStudio within a graphical session on Quest. The simplest way is to use FastX: https://kb.northwestern.edu/quest-login.

The R environment of the Quest Analytics nodes includes the following modules:

R/3.6.3
gdal/2.4.1
proj/6.2.1
geos/3.8.0

Installing R Packages for R 3.6.3 On Quest

Please check for files where you may have at some point accidentally hardcoded paths before starting these instructions. This includes ~/.bash_profile, ~/.bashrc, ~/.Renviron, ~/.Rprofile, or ~/.R/makevars.

If issues arise, you can delete the folder where R/3.6.x packages get installed, which is (usually) ~/R/x86_64-pc-linux-gnu-library/3.6, and start again.

Seurat

Note: the commands below must be run in a terminal session on a Quest login node.

module purge all
module load anaconda3
module load R/3.6.3
conda create --name Seurat-dependecies python=3.7 --yes
source activate Seurat-dependecies
pip install leidenalg numpy python-igraph
module purge all
module load R/3.6.3
Rscript --vanilla "build.R"
Where build.R is a file containing the following:
install.packages("BiocManager", repos="https://cloud.r-project.org/")
install.packages("Rcpp", repos="https://cloud.r-project.org/")
install.packages("png", repos="https://cloud.r-project.org/")
BiocManager::install("multtest")
install.packages("Seurat", repos="https://cloud.r-project.org/")

Monocle3

Note: the commands below should be run within an interactive R session, either on a Quest login node or an RStudio Server session:

install.packages("devtools", repos="https://cloud.r-project.org/")
install.packages("Rcpp", repos="https://cloud.r-project.org/")
install.packages("grr", repos="https://cloud.r-project.org/")
install.packages("https://cran.r-project.org/src/contrib/Archive/Matrix.utils/Matrix.utils_0.9.7.tar.gz",
	repos = NULL, type="source")
install.packages(c("RCurl", "matrixStats", "futile.logger", "snow", "ggbeeswarm", "viridis", "RcppAnnoy",
	"RcppHNSW", "irlba", "rsvd", "igraph"), repos="https://cloud.r-project.org/")
install.packages(c("dplyr", "ggrepel", "lmtest", "pbapply", "pbmcapply", "pheatmap", "plotly", "plyr",
	"proxy", "pscl", "RANN", "reshape2", "rsample", "RhpcBLASctl", "Rtsne", "slam",
	"spdep", "speedglm", "uwot", "tidyr"), repos="https://cloud.r-project.org/")
install.packages("BiocManager", repos="https://cloud.r-project.org/")
BiocManager::install('DelayedArray', update = FALSE, ask = FALSE)
BiocManager::install(c("BiocNeighbors", "BiocSingular", "scater"), update = FALSE, ask = FALSE)
BiocManager::install(c('BiocGenerics', 'DelayedMatrixStats', 'limma', 'S4Vectors', 'SingleCellExperiment', 'SummarizedExperiment', 'batchelor'), update = FALSE, ask = FALSE)
devtools::install_github('cole-trapnell-lab/leidenbase')
devtools::install_github('cole-trapnell-lab/monocle3')

SF

Note: the commands below should be run within an interactive R session, either on a Quest login node or an RStudio Server session:

install.packages(c("devtools", "classInt", "DBI", "units"), repos="https://cloud.r-project.org/")
Sys.setenv(CPPFLAGS = "-I/software/proj/6.2.1/include")
Sys.setenv(PATH = "/software/gdal/2.4.1/bin:/hpc/software/gcc/6.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin")
devtools::install_github("r-spatial/sf",
	configure.args="--with-proj-lib=/software/proj/6.2.1/lib64 --with-proj-include=/software/proj/6.2.1/include --with-geos-config=/software/geos/3.8.0/bin/geos-config")

RGDAL

Note: the command below should be run within an interactive R session, either on a Quest login node or an RStudio Server session:

install.packages("rgdal", repos="https://cloud.r-project.org/",
	configure.args=c(rgdal = "--with-proj_api=/software/proj/6.2.1/include/proj_api.h --with-proj-include=/software/proj/6.2.1/include --with-proj-lib=/software/proj/6.2.1/lib64 --with-proj-share=/software/proj/6.2.1/share/proj"))

RJAGS

Note: the commands below must be run in a terminal session on a Quest login node.

module purge all
module load R/3.6.3
module load jags
Rscript --vanilla "build.R"

Where build.R is a file containing the following:

install.packages("Rcpp", repos="https://cloud.r-project.org/")
install.packages("rjags", repos="https://cloud.r-project.org/")




Keywords:research computing, quest, r, rstudio, analytics, nodes   Doc ID:98203
Owner:Research Computing .Group:Northwestern
Created:2020-02-24 12:22 CDTUpdated:2020-04-06 13:01 CDT
Sites:Northwestern
CleanURL:https://kb.northwestern.edu/troubleshooting-installing-r-packages
Feedback:  0   0