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.
For complete documentation, see the online documentation.
- Get Started - Complete beginner tutorial with working examples
- Loading a simulation and accessing entities
- Changing parameter and molecule start values
- Running a simulation
For advanced workflows:
Data handling and visualization:
- Working with data sets and import from excel
- Working with
DataCombinedclass - Visualizations with
DataCombined
Reference:
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.
The {ospsuite} package requires {rSharp} and its external
dependencies (Visual C++ Redistributable and .NET 10). 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"))
)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")-
On Windows, set
Settings > Language > Administrative language settings > Current language for non-Unicode programstoEnglish (United States)and reboot. -
On Linux, set the environment variable
LC_ALLin~/.bashrcbefore 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
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.
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.
The embedded binaries are built from NuGet packages specified in the DependencyManager project. To update the binaries to a new version:
- Open
shared/DependencyManager/src/DependencyManager.csproj. - Update the
Versionattribute in thePackageReferenceelements to the desired version numbers. - Commit and push the changes to a branch.
- 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.
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.
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.
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.
OSPSuite-R is released under the GPLv2 License.
All trademarks within this document belong to their legitimate owners.