Hi, I am new to Nextflow and I am slowly building a simple pipeline. I am on an HPC environment. I want to add one last process which invokes an R script that uses a couple of channels.
I realised that in order to use R, it is a better to use containers via singularity. Despite using singularity/apptainer, I cannot install the R package I require: magick. As I said I am on an HPC and I don’t have root privileges.
This is my nextflow.config file
apptainer {
enabled = true
autoMounts = true
}
process {
withName: MakePDF {
container = "rstudio_latest.sif"
containerOptions = "--no-home"
}
This the error message I am getting - notice that I am installing the R package “magick” within my R script that’s invoked.
Command exit status:
1
Command output:
(empty)
Command error:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages("magick", repos = "http://cran.us.r-project.org") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Error in install.packages("magick", repos = "http://cran.us.r-project.org") :
unable to install packages
Execution halted
I feel a bit stuck as I don’t know much about containers or singularity and I don’t understand the documentation just yet.
Someone suggested to download an image with the R package pre-installed but also that such things do not exist with only one package?
Can anyone help me please?
Thanks