Skip to content

Repository files navigation

OSPSuite R package

Build Badge Codecov test coverage Badge

Overview

The {ospsuite}R package provides the functionality of loading, manipulating, and running the simulations created in the Open Systems Pharmacology Software tools PK-Sim and MoBi.

Documentation

For complete documentation, see the online documentation.

Essential Guides

For advanced workflows:

Data handling and visualization:

Reference:

Installation

The ospsuite package requires R version 4.4 or later and supports Windows, Linux (Ubuntu), and macOS (Apple Silicon) operating systems.

ospsuite is not available on CRAN, and neither are the OSP packages it depends on. Both are published on the OSP R-universe, so the recommended installation below resolves the whole stack in one call.

Pre-requisites

The {ospsuite} package requires {rSharp} and its external dependencies (Visual C++ Redistributable and .NET 10). Install these dependencies using the following instructions:

From the OSP R-universe (recommended)

Install the released version from the OSP R-universe:

install.packages(
  "ospsuite",
  repos = c(OSP = "https://open-systems-pharmacology.r-universe.dev", getOption("repos"))
)

Development version

To install the unreleased development version from GitHub, use pak:

# install.packages("pak")
options(repos = c(
  OSP = "https://open-systems-pharmacology.r-universe.dev",
  getOption("repos")
))

pak::pak("Open-Systems-Pharmacology/OSPSuite-R")

Known issues

Loading ospsuite might fail if the system locale is not set to English

  • On Windows, set Settings > Language > Administrative language settings > Current language for non-Unicode programs to English (United States) and reboot.

  • On Linux, set the environment variable LC_ALL in ~/.bashrc before starting R:

    export LC_ALL=en_US.UTF-8

  • add the path to the lib subfolder of installed ospsuite package to LD_LIBRARY_PATH export LD_LIBRARY_PATH=/usr/local/lib/R/site-library/ospsuite/lib/:$LD_LIBRARY_PATH

Saving and loading the workspace in RStudio does not restore objects

The ospsuite package uses the features implemented in PK-Sim and MoBi by creating .NET objects (e.g. a simulation) and using them from R. These objects cannot be saved as part of the workspace and reloaded on next start. Upon restoring the workspace, the objects will be NULL and cannot be re-used.

Development

Embedded binaries

The {ospsuite} package requires shared libraries (binary files) to access PK-Sim and MoBi functionalities.

Note: Because {ospsuite} contains binary files, it is classified as a binary package and cannot be submitted to CRAN.

Updating embedded binaries

The embedded binaries are built from NuGet packages specified in the DependencyManager project. To update the binaries to a new version:

  1. Open shared/DependencyManager/src/DependencyManager.csproj.
  2. Update the Version attribute in the PackageReference elements to the desired version numbers.
  3. Commit and push the changes to a branch.
  4. Manually dispatch the Build Libraries workflow (.github/workflows/build-libraries.yaml, via the Actions tab) on that branch. The workflow:
    • Builds the DependencyManager project, which downloads the specified NuGet packages
    • Extracts the required binary files and dependencies
    • Copies them to the inst/lib/ directory
    • Commits the updated binaries to a new branch and opens a pull request targeting the branch the workflow was dispatched on

Alternatively, build the DependencyManager solution locally and commit the regenerated inst/lib/ together with the .csproj change (see AGENTS.md).

Note: The workflow is not triggered by pushes — it only runs when dispatched manually.

Versioning

The package follows the versioning process described in the OSP R collaboration guide.

For development versions, this GitHub action automatically increments the .9000 version suffix when pull requests are merged.

Code of Conduct

Everyone interacting in the Open Systems Pharmacology community (codebases, issue trackers, chat rooms, mailing lists etc.) is expected to follow the Open Systems Pharmacology code of conduct.

Contribution

Contributions to the Open Systems Pharmacology community are welcome. Before contributing, read the contribution guidelines. Code contributors should follow the R coding standards and collaboration guide.

License

OSPSuite-R is released under the GPLv2 License.

All trademarks within this document belong to their legitimate owners.

About

R package for the OSPSuite

Resources

Stars

58 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages