Introduction to

2023-06-22

esqlabsR ?

{esqlabsR} What ?



{esqlabsR} Why ?


  • Simple functions to design, run and save simulations,
  • Interact with the OSPS features using Excel files,
  • Generate standardized plots automatically.


➡️ Streamlined Simulation Workflow 🚀

{esqlabsR} Where ?



{esqlabsR} How ?


install.packages("remotes")
install.packages("https://github.com/Open-Systems-Pharmacology/rClr/releases/download/v0.9.2/rClr_0.9.2.zip",
                 repos = NULL,
                 type = "binary"
)

remotes::install_github("esqLABS/esqlabsR")


📦 Installation

{esqlabsR} How ?



esqlabsR Workflow

Get Started

I. Initialize Project

Project Structure


library(esqlabsR)
init_project()


init_project() will create the expected simulation project’s folder structure.


Note

init_project() is a new feature available in esqlabsR v5.0.0

Project Structure

Each one of these folders contains a series of .xlsx files with specific purpose.

my_project
├── ProjectConfiguration.xlsx
├── Data
├── Models
├── Parameters
   ├── ApplicationParameters.xlsx
   ├── Individuals.xlsx
   ├── ModelParameters.xlsx
   ├── Plots.xlsx
   ├── PopulationParameters.xlsx
   ├── Populations
   │   └── PopulationScenario_population.csv
   └── Scenarios.xlsx
└── Results
├── Figures
└── SimulationResults

Project Structure

Project’s files are linked by the ProjectConfiguration.xlsx file.

my_project
├── ProjectConfiguration.xlsx
├── Data
├── Models
├── Parameters
   ├── ApplicationParameters.xlsx
   ├── Individuals.xlsx
   ├── ModelParameters.xlsx
   ├── Plots.xlsx
   ├── PopulationParameters.xlsx
   ├── Populations
   │   └── PopulationScenario_population.csv
   └── Scenarios.xlsx
└── Results
├── Figures
└── SimulationResults

Project Structure

Everything is already configured !

ProjectConfiguration


createDefaultProjectConfiguration(path)

  • targets ProjectConfiguration.xlsx file,
  • creates a ProjectConfiguration object,
  • Needed for all next steps !


my_project_configuration <- 
  createDefaultProjectConfiguration(path = "path/to/ProjectConfiguration.xlsx")

ProjectConfiguration

my_project_configuration


ProjectConfiguration: 
Project Configuration File: TestProject/Code/projectConfiguration.xlsx 
Model folder: TestProject/Models/Simulations 
Parameters folder: TestProject/Parameters 
Parameters file name: TestProject/Parameters/ModelParameters.xlsx 
Individual parameters file name: TestProject/Parameters/Individuals.xlsx 
...

II. Design Scenarios

Scenarios


Simulations are defined by Scenarios.

Scenarios are setup in the Parameters/Scenarios.xslx file.

Scenarios parameterization

  • Model
  • Model parameters
  • Application protocol
  • Time range
  • Individual characteristics
  • Population

All in files !

Parameters files

III. Run Simulations

Read Scenarios

my_scenarios <- createScenarios(
  readScenarioConfigurationFromExcel(
    scenarioNames = "TestScenario",
    projectConfiguration = my_project_configuration
  )
)

Scenarios Recap

my_scenarios
ScenarioConfiguration: 
   Model file name: Aciclovir.pkml 
   Scenario name: TestScenario 
   Parameters sheets: Global 
   Individual Id: Indiv1 
   Population Id: 
   Read population from csv file: FALSE 
   Application protocol: Aciclovir_iv_250mg 
   Simulation time intervals: 
     Interval: 1 
       Start: 0 
       End: 24 
       Resolution: 60 
   Simulation time intervals unit: h 
   Simulate steady-state: FALSE 
   Steady-state time: 1000 

Run Simulations

myScenarioResults <- runScenarios(my_scenarios)


IV. Plot Results

OSPS plotting functions

Simulation results are compatible with {ospsuite} plotting workflow.

my_datacombined <- DataCombined$new()

my_datacombined$addSimulationResults(myScenarioResults$TestScenario$results,
  names = "Simulated",
  groups = "Aciclovir"
)

OSPS plotting functions

plotIndividualTimeProfile(my_datacombined)

New in 5.0.0


Create plots (or plotgrids) from excel files !



Release soon !



Feedback Wanted

Help us improve esqlabsR


Thank You