mllg / batchtools

Tools for computation on batch systems
https://mllg.github.io/batchtools/
GNU Lesser General Public License v3.0
171 stars 51 forks source link

Suggestion: allow a custom "Rscript" command in templates #189

Closed jgrn307 closed 6 years ago

jgrn307 commented 6 years ago

We have to use R/RScript via a singularity container, so we have to append:

singularity exec /some/simg RScript

I can (and have) tweaked the template file to do this, but would you consider adding in a parameter to allow custom RScript calls?

mllg commented 6 years ago

What would be the benefit if this would be a parameter? And a parameter to which function?

jgrn307 commented 6 years ago

So it could be passed to a brew template -- not sure where, exactly, it would live? Maybe as a "resource" to a cluster?

jgrn307 commented 6 years ago

Second use case: sometimes in SLURM systems you may want to run Rscript via srun, e.g. srun --exclusive Rscript [stuff]

mllg commented 6 years ago

You can already do stuff like this with templating:

# provide command as resource
submitJobs(resources = list(rscript = "srun --exclusive Rscript -e"))

# last line in template
<%= resources$rscript %> 'batchtools::doJobCollection("<%= uri %>")'
jgrn307 commented 6 years ago

Perfect! That's all I needed!