Skip to contents

Overview

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

Installation

The ospsuite package requires R version 4.x.x and supports Windows and Linux (Ubuntu) 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 8). Install these dependencies using the following instructions:

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 to ~/.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

Development Setup

When developing the ospsuite package, you need to prepare platform-specific library files before using devtools::load_all(). The package uses configure scripts during installation to rename platform-specific DLLs, but devtools::load_all() bypasses this process.

Run the development setup script:

source("tools/setup_dev.R")
setup_dev()

When to run setup_dev(): - After cloning the repository for the first time - After switching to a different branch - After pulling changes that might affect library files

The script automatically detects your operating system and renames the appropriate DLL: - Windows: Renames System.Data.SQLite.windows_linux.dllSystem.Data.SQLite.dll - Linux: Renames System.Data.SQLite.windows_linux.dllSystem.Data.SQLite.dll - macOS: Renames System.Data.SQLite.mac.dllSystem.Data.SQLite.dll

Embedded binaries

The ospsuite package requires shared libraries to access PK-Sim functionality. To obtain the latest libraries (.dll on Windows or .so on Linux), run the update_core_files.R script included with this package.

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

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.