This is a test version of Biostars. For the public version, visit https://www.biostars.org.
using distinct versions of SEURAT on a SLURM cluster

Dear all, 'd appreciate having your suggestions on the following please :

I am running scRNA-seq analyses (in R 3.6.1) on a SLURM CLUSTER , and I do have 2 scripts :

a) a script that requires the package Seurat 2.3.4 (historically, for "compatibility" with older data), and

b) another script that requires (a newer version) Seurat 3.1.

When I submit the jobs to the SLURM cluster, how could specify in the R script the use of the library Seurat 2.3.4 versus Seurat 3.1 ?

(as we know, when we load the Seurat library , we just write : library("Seurat"), without specifying the version).

do I need to use a docker/singularity container for R.3.6.1 with Seurat 2.3.4, and another docker/singularity container with Seurat 3.1 ? thanks !

seurat scrnaseq

3 answers

Consider using packrat for managing your environment: https://rstudio.github.io/packrat/

thank you very much ! stay healthy, be safe !

I would probably make two separate environments, e.g. via conda and then install in each of them the version you need. You can then simply set RSCRIPT="/path/to/anaconda/environment(1/2)/bin/Rscript for the respective jobs. If possible I would try tough to convert the "older" data to a Seurat3 compatible format (just thinking aloud, you probably thought about that already).

thanks a lot for your suggestion on making 2 separate virtual environments ... very helpful !

Sounds like your cluster does not use modules. Otherwise you could do this at that level when you submit SLURM jobs.

It does use modules ; typically, we do write "module load r/3.6"

Ah I see. You are referring to using distinct versions of seurat with same R. I suppose you could build two modules for R with two separate versions of seurat. Analogous to conda solution suggested below. I suppose you can use the conda solution on your own where as for the modules you will need to get your sys admins to do that.

thank you very much for your suggestion ;)

Log in to answer this question.