step_tmpl_map: Step template to run an R function with a set of arguments

Description Usage Arguments Value Step Template

View source: R/step_templates.R

Description

This step template uses a syntax similar to the base::Map / base::mapply functions to run a function with a given set of arguments as a workflow step. You must make sure that all variables required by the function are passed to it either as one of its arguments or loaded later by the function itself.

Usage

1
2
3
4
5
6
7
step_tmpl_map(
  FUN,
  ...,
  MoreArgs = NULL,
  setup_script = NULL,
  max_array_size = Inf
)

Arguments

FUN

The R function to be run by the workflow step

...

arguments to vectorize over (vectors or lists of strictly positive length, or all of zero length). See also ‘Details’.

MoreArgs

a list of arguments to the function call. The names attribute of args gives the argument names.

setup_script

(optional) a bash script to be run first. This can be used to load the required modules (like R, python, etc).

max_array_size

maximum number of array jobs to be submitted at the same time. Should be strictly less than the maximum number of jobs you are allowed to submit to slurm on your HPC.

Value

a template function to be used by add_workflow_step

Step Template

Step Templates are helper functions to be used within add_workflow_step. Some basic ones are provided by the slurmworkflow package. They instruct the workflow to run either a bash script, a set of bash lines given as a character vector or an R script. Additional Step Templates can be created to simplify specific tasks, see the vignette("making-a-custom-step-template") for details.


AdrienLeGuillou/slurmworkflow documentation built on Jan. 13, 2022, 5:13 p.m.