Submits a model to be run by calling out to bbi.

submit_model(
  .mod,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = NULL
)

# S3 method for bbi_nonmem_model
submit_model(
  .mod,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = NULL
)

# S3 method for character
submit_model(
  .mod,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = get_model_directory()
)

# S3 method for numeric
submit_model(
  .mod,
  .bbi_args = NULL,
  .mode = c("sge", "local"),
  ...,
  .config_path = file.path(get_model_directory() %||% ".", "babylon.yaml"),
  .wait = TRUE,
  .dry_run = FALSE,
  .directory = get_model_directory()
)

Arguments

.mod

The model object to submit. Could be a bbi_{.model_type}_model object, a file path to a model, an integer corresponding to a file name of a model.

.bbi_args

A named list specifying arguments to pass to babylon formatted like list("nm_version" = "nm74gf_nmfe", "json" = T, "threads" = 4). Run print_nonmem_args() to see valid arguments.

.mode

Either "sge", the default, to submit model(s) to the grid or "local" for local execution.

...

args passed through to bbi_exec()

.config_path

Optionally specify a path to a babylon.yml config. If not specified, the config in the model directory will be used by default. Path MUST be either an absolute path or relative to the model directory.

.wait

If TRUE, the default, wait for the bbi process to return before this function call returns. If FALSE function will return while bbi process runs in the background.

.dry_run

Returns an object detailing the command that would be run, insted of running it. This is primarily for testing but also a debugging tool.

.directory

Model directory which .mod path is relative to. Defaults to options('rbabylon.model_directory'), which can be set globally with set_model_directory(). Only used when passing a file path for .mod instead of a bbi_{.model_type}_model object.

Methods (by class)

  • bbi_nonmem_model: Takes a bbi_nonmem_model object.

  • character: Takes a file path to a model that can be loaded with read_model(). Should be path to YAML (with or without .yaml extension), or a valid model file (control stream, etc.).

  • numeric: Takes an integer corresponding to the file name of a model that can be loaded with read_model(). This will only work if you are calling from the same directory as the models, or if you have set options('rbabylon.model_directory') to the directory constaining the relevant model.