run_pipeline: Run the 'scdrake' pipeline.

View source: R/run.R

run_single_sampleR Documentation

Run the scdrake pipeline.

Description

There are two ways how to run scdrake pipeline:

The first, reproducible way is via run_single_sample_r() or run_integration_r(). In the end, drake::r_make() is called and sources "_drake_single_sample.R" or "_drake_integration.R" scripts in a fresh new R session. Those scripts are entry points for drake. See scdrake_r_make() for more details.

(Soft-deprecated since scdrake 1.4.0) The second way is to run pipeline in the current R session via run_single_sample() or run_integration(), which is a shortcut for:

  • Loading configs: load_pipeline_config(), and load_single_sample_configs() or load_integration_configs().

  • Obtaining the pipeline plan: get_single_sample_plan() or get_integration_plan().

  • Creating a basic directory structure (based on paths loaded from config files): create_single_sample_dirs() or create_integration_dirs().

  • Running the pipeline: scdrake_make().

This way is considered as nonreproducible, because the pipeline is run in the current session and there might be interfering variables or loaded packages. Internally, the run_single_sample() and run_integration() functions are basically replicating the code that is in "_drake_single_sample.R" and "_drake_integration.R" scripts, respectively, while protecting from side effects (e.g. setting options() etc.) on your current session (i.e. all environment modifications are limited to function's scope).

Usage

run_single_sample(
  pipeline_config_dir = getOption("scdrake_pipeline_config_dir"),
  single_sample_config_dir = getOption("scdrake_single_sample_config_dir"),
  project_root = getOption("scdrake_project_root"),
  do_update_configs = TRUE,
  verbose = getOption("scdrake_verbose"),
  .dry = FALSE,
  ...
)

run_integration(
  pipeline_config_dir = getOption("scdrake_pipeline_config_dir"),
  integration_config_dir = getOption("scdrake_integration_config_dir"),
  project_root = getOption("scdrake_project_root"),
  do_update_configs = TRUE,
  verbose = getOption("scdrake_verbose"),
  .dry = FALSE,
  ...
)

run_single_sample_r(
  drake_file = "_drake_single_sample.R",
  project_root = getOption("scdrake_project_root"),
  ...
)

run_integration_r(
  drake_file = "_drake_integration.R",
  project_root = getOption("scdrake_project_root"),
  ...
)

Arguments

pipeline_config_dir

A character scalar: path to directory with pipeline config file (pipeline.yaml).

single_sample_config_dir

A character scalar: path to directory with ⁠00_main.yaml⁠, ⁠01_input_qc.yaml⁠, ⁠02_norm_clustering.yaml⁠, cluster_markers.yaml, and contrasts.yaml files.

project_root

A character scalar: path to directory in which the pipeline will be run, i.e. a new working directory. The working directory will be used only temporarily. Default value of the scdrake_project_root options is the current working directory.

do_update_configs

A logical scalar: if TRUE, run update_single_sample_configs() or update_integration_configs() before loading configs.

verbose

A logical scalar: if TRUE, be verbose. The default value is obtained from getOption("scdrake_verbose").

.dry

A logical scalar: if TRUE, omit the last step in the description and just return TRUE.

...

Passed to scdrake_make() or scdrake_r_make().

integration_config_dir

A character scalar: path to directory with ⁠00_main.yaml⁠, ⁠01_integration.yaml⁠, ⁠02_int_clustering.yaml⁠, cluster_markers.yaml, and contrasts.yaml files.

drake_file

A character scalar: path to entry script for drake.

Value

TRUE if pipeline finishes successfully.


bioinfocz/scdrake documentation built on Sept. 19, 2024, 4:43 p.m.