Best way to install R packages on an HPC?
2
1
Entering edit mode
26 days ago

Hi everyone,

I have been trying to practice single cell analysis using R, and I realized that most of my time goes to installing packages using BiocManager::install or install.packages. A single package can take as long as 45 minutes.

I am using an HPC to do this. When I've tried using mamba install to install packages, I always run into the error:

EnvironmentNotWritableError: The current user does not have write permissions to the target environment.

Does anyone else know how to quickly install R packages on an HPC, or a way around this "not writable" error?

Thank you.

R HPC • 621 views
ADD COMMENT
0
Entering edit mode

I have no idea if they have some environment manager like conda. but I usually make a specific path for R packages for each project,

# setting R-packages path    
lib_path <- paste0(project_dir,'/bin/r_libs')
.libPaths(c(lib_path))

setting this every time you want to install the R packages or import the packages, then it is not violate the admin's R lib.

ADD REPLY
0
Entering edit mode

There is some additional detail in https://services.dartmouth.edu/TDClient/1806/Portal/KB/ArticleDet?ID=141373

While using a personal library to install R-packages, as mentioned by others, is likely the solution for this issue, you will likely run into cases where you may need to switch R versions, compile packages etc. Above doc should be helpful with that.

ADD REPLY
1
Entering edit mode
25 days ago

I am using an HPC to do this. When I've tried using mamba install to install packages, I always run into the error:

EnvironmentNotWritableError: The current user does not have write permissions to the target environment.

My guess is that you are using a mamba installation setup by the HPC admin and that installation is configured to write to a directory where regular users do not have writing permission. Have a look at the output of which mamba and mamba info to see if that could be the case. If so, just install your own conda and work with that.

(As an aside, I lost count of how many times I recommended people to use mamba instead of conda. Now it turns out that conda has incorporated the improvements of mamba and so we should probably get back to prefer conda. In fact, newer versions of snakemake support conda but not mamba to run rules in a separate conda environment.)

ADD COMMENT
0
Entering edit mode

FWIW, I've recently still been running into environment solving issues with conda (even with the incorporated libmamba changes) that mamba breezed through

ADD REPLY
0
Entering edit mode
25 days ago
Charles Plessy ★ 2.9k

At my workplace I created a Singularity image that has most of the C/C++ libraries installed, and R's library path pointing to an image-specific subdirectory in the user's home directory. https://github.com/oist/BioinfoUgrp/tree/master/RStudio

ADD COMMENT

Login before adding your answer.

Traffic: 1266 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6