Zuup
Zuup

Reputation: 77

Globally load R libraries in Snakemake

I'm currently building my NGS pipeline using Snakemake and have an issue regarding the loading of R libraries. Several of the scripts, that my rules call, require the loading of R libraries. As I found no way of globally loading them, they are loaded inside of the R scripts, which of course is redundant computing time when I'm running the same set of rules on several individual input files.

Is there a way to keep one R session for the execution of several rules and load all required libraries priorly?

Cheers, zuup

Upvotes: 1

Views: 319

Answers (1)

Johannes Köster
Johannes Köster

Reputation: 1927

I'm afraid not. This has performance reasons on (a) local systems (circumventing the Python GIL) and (b) cluster systems (scheduling to separate nodes). Even if there was a solution on local machines, it would need to take care that no sessions are shared between parallel jobs. If you really need to safe that time, I suggest to merge those scripts.

Upvotes: 1

Related Questions