View source: R/config_update.R
update_config | R Documentation |
By update is meant the following: if a default config contains a new parameter,
it will be appended to a local config.
If a parameter is present in both configs, its value from the local config will be used.
In case the local config does not exist, the default one will be simply copied.
See vignette("config", package = "scdrake")
for details.
update_config()
will update a single config file.
update_*_config()
functions update a specific config group (pipeline, single-sample, integration).
update_configs()
will run all update_*_config()
.
update_config(
default_file,
use_default_structure = FALSE,
force = FALSE,
yq_binary = getOption("scdrake_yq_binary"),
verbose = getOption("scdrake_verbose")
)
update_pipeline_config(
dir = getOption("scdrake_pipeline_config_dir"),
verbose = getOption("scdrake_verbose"),
...
)
update_single_sample_configs(
dir = getOption("scdrake_single_sample_config_dir"),
verbose = getOption("scdrake_verbose"),
...
)
update_integration_configs(
dir = getOption("scdrake_integration_config_dir"),
verbose = getOption("scdrake_verbose"),
...
)
update_configs(
pipeline_config_dir = getOption("scdrake_pipeline_config_dir"),
single_sample_config_dir = getOption("scdrake_single_sample_config_dir"),
integration_config_dir = getOption("scdrake_integration_config_dir"),
verbose = getOption("scdrake_verbose"),
...
)
default_file |
A character scalar: path to the default YAML config file. Must have a |
use_default_structure |
A logical scalar: if |
force |
A logical scalar: if |
yq_binary |
A character scalar: path to |
verbose |
A logical scalar: if |
dir |
A character scalar:
|
... |
Passed to |
pipeline_config_dir |
Passed to |
single_sample_config_dir |
Passed to |
integration_config_dir |
Passed to |
Internally, the yq tool (version 3) is used for merging of YAML files.
Invisibly NULL
.
Consider the following example of config update, showing also differences in the use_default_structure
parameter:
Default config:
# Comment 1. PARAM_1: 1 PARAM_2: 2 PARAM_3: 3
Local config:
# Comment 2. PARAM_2: 6 # Comment 3. PARAM_1: 5
With use_default_structure = TRUE
, the result of update will be:
# Comment 1. PARAM_1: 5 PARAM_2: 6 PARAM_3: 3
With use_default_structure = FALSE
:
# Comment 2. PARAM_2: 6 # Comment 3. PARAM_1: 5 PARAM_3: 3
NOTE: yq
tool, which is used internally for merging (updating) of YAML files,
cannot ovewrite comments, and thus we need to use this schema to preserve local structure.
download_yq()
, check_yq()
, yq_merge_cmd()
, vignette("scdrake_config")
# If a scdrake project is in the current working directory.
## Not run:
update_config("config/pipeline.default.yaml")
## End(Not run)
## Not run:
update_pipeline_config("config")
## End(Not run)
## Not run:
update_single_sample_configs("config/single_sample")
## End(Not run)
## Not run:
update_integration_configs("config/integration")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.