Coder Social home page Coder Social logo

ospsuite-r's Introduction

OSPSuite-R

AppVeyor build status codecov

Overview

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

Installation

ospsuite requires following packages to be installed:

Under Windows

The release version of the package comes as a binary *.zip and can be downloaded from here. The package rClr can be downloaded from here and installed from binary *.zip. The package R6 can be installed from CRAN.

The package also requires the Visual C++ Runtime that is installed with OSPS and can be manually downloaded here.

# Install dependencies
install.packages(pathTorCLR.zip, repos = NULL)
install.packages('R6')
# Install ospsuite-r from local file
install.packages(pathToOSPSuite.zip, repos = NULL)

Under Linux

The ospsuite package has been tested under Linux distributions CentOS 7 and Ubuntu 18. Some functionality, such as creating individuals, is not availble under Linux. Installation under Linux requires several prerequisites, the detailed instructions can be found in the Wiki.

Build from source

You can clone the GIT repository and build the package from source.

How to update dependencies from nuget?

  • git submodule update --init --recursive to install all submodules
  • Make sure you have ruby install and that it is available in your path
  • Run rake postclean or simply double click on postclean.bat. This will update all nuget packages and copy the dependencies in the package inst/lib folder.

Usage

In general, every workflow starts with loading a simulation that has been exported to the *.pkml format. The method loadSimulation() returns the corresonding simulation that is used as input of other methods. The then can change values of parameters and initial conditions, run the simulation, and retrieve the simulated results.

library(ospsuite)

# Load a simulation
dataPath <- file.path(path.package("ospsuite", quiet = FALSE), "extdata", fsep = .Platform$file.sep)
simFilePath <- file.path(dataPath, "Aciclovir.pkml", fsep = .Platform$file.sep)
sim <- loadSimulation(simFilePath)

# Get the parameter "Dose"
doseParamPath <- "Applications|IV 250mg 10min|Application_1|ProtocolSchemaItem|Dose"
doseParam <- getParameter(doseParamPath, sim)

# Change the dose to 350mg. The values has to be converted to base unit, first
newValue <- toBaseUnit(quantity = doseParam, values = 350, unit = "mg")
setParameterValues(parameters = doseParam, values = newValue)

# Simulate
simResults <- runSimulation(simulation = sim)
# Retrieve the results
simulatedValues <- getOutputValues(simulationResults = simResults)

# Plot time-concentration profile
plot(simulatedValues$data$Time, simulatedValues$data$`Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)`,
type = "l",
xlab = "Time [min]",
ylab = "Concentration [µmol/l]")

More detailes description of the methods and the typical workflows can be found in the vignettes. You can see the list of all vigenttes available for ospsuite by calling

vignette(package = "ospsuite")

To open a specific vignette, call

# Insert the name of the vignette you want to view as the argument
vignette("introduction-ospsuite")

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

We encourage contribution to the Open Systems Pharmacology community. Before getting started please read the contribution guidelines. If you are contributing code, please be familiar with the coding standards.

License

OSPSuite-R is released under the GPLv2 License.

All trademarks within this document belong to their legitimate owners.

ospsuite-r's People

Contributors

msevestre avatar pavelbal avatar yuri05 avatar pchelle avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.