From dd3314e38850f9f5a594c068625d3ce8a8d10e10 Mon Sep 17 00:00:00 2001 From: grst Date: Mon, 20 Jan 2025 12:49:35 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Boehring?= =?UTF-8?q?er-Ingelheim/dso-r@dfc96e05723ee3003caae3adbc08f15398fa97f9=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.html | 6 ++- index.html | 39 +++++++++++++----- pkgdown.yml | 2 +- reference/read_safe_yaml.html | 78 +++++++++++++++++++++++++++++++++++ search.json | 2 +- sitemap.xml | 1 + 6 files changed, 114 insertions(+), 14 deletions(-) create mode 100644 reference/read_safe_yaml.html diff --git a/CHANGELOG.html b/CHANGELOG.html index 3dd02f8..d562734 100644 --- a/CHANGELOG.html +++ b/CHANGELOG.html @@ -40,6 +40,10 @@

v0.7

Backwards-incompatible changes

+
+

Fixes

+

v0.6

@@ -49,7 +53,7 @@

New Features -

Fixes

+

Fixes

diff --git a/index.html b/index.html index 32da846..40f8cf0 100644 --- a/index.html +++ b/index.html @@ -48,17 +48,7 @@ -

The purpose of this package is to provide access to files and configuration organized in a dso project. It provides two main functions:

- -

Additionally, dso-r provides an R interface to some of the most important CLI commands of dso.

+

dso is a command line helper for building reproducible data analysis projects on top of dvc. To learn more about dso, please refer to the dso documentation. {dso-r} is the R companion package for dso. The purpose of this package is to provide access to files and configuration organized in a dso project.

Installation

@@ -66,6 +56,33 @@

Installation
 remotes::install_github("Boehringer-Ingelheim/dso-r")

+
+

Typical usage +

+

The DSO R-Package provides convenient access to stage parameters from R scripts or notebooks. Using read_params the params.yaml file of the specified stage is compiled and loaded into a dictionary. The path must be specified relative to the project root – this ensures that the correct stage is found irrespective of the current working directory, as long as it the project root or any subdirectory thereof. Only parameters that are declared as params, dep, or output in dvc.yaml are loaded to ensure that one does not forget to keep the dvc.yaml updated.

+
+library(dso)
+
+params <- read_params("subfolder/my_stage")
+
+# Access parameters
+params$thresholds
+params$samplesheet
+

By default, DSO compiles paths in configuration files to paths relative to each stage (see configuration). From R, you can use stage_here to resolve paths relative to the current stage independent of your current working directory. This works, because read_params has stored the path of the current stage in a configuration object that persists in the current R session. stage_here can use this information to resolve relative paths.

+
+samplesheet <- readr::read_csv(stage_here(params$samplesheet))
+

When modifying the dvc.yaml, params.in.yaml, or params.yaml files during development, use the reload(params) function to ensure proper application of the changes by rebuilding and reloading the configuration.

+
+reload(params)
+

Creating a stage within the R environment can be performed using create_stage and supplying it with the relative path of the stage from project root and a description.

+
+create_stage(name = "subfolder/my_stage", description = "This stage does something")
+
+
+

API documentation +

+

Please refer to the documentation website

+