-
Notifications
You must be signed in to change notification settings - Fork 5
Home
Welcome to the OSPSuite.ReportingEngine wiki!
The core of the reporting engine is the workflow. A workflow is composed of a series of tasks, which are units of work that are executed in sequence on (possibly multiple) entities that are called simulation sets.
Two standard workflows have been implemented:
- A mean model workflow that performs tasks on a simulation set that consists of a pkml simulation, possibly combined with observed data.
- A population workflow that performs tasks on a simulation set that consists of a pkml simulation and a population and, optionally, observed data. The parameters specific to individuals in a population are stored in a CSV file that is in PKSim's population data file format.
The tasks that can be performed in a workflow consist of primary tasks. Each primary task is associated with smaller secondary tasks that are based on the results of their respective primary task.
The tasks of the mean model workflow are
-
Primary task 1: Simulation of the mean model. The output of this stage is a CSV file containing the model's simulated outputs over the simulation time of the experiment.
- Secondary task a: Create a time profile plot of outputs of the simulated model.
- Secondary task b: Create an absorption plot for the simulated model.
-
Primary task 2: Calculation of mass balance. The output of this stage is a CSV file containing the simulation over time of all amounts of all molecules over the simulation time of the experiment.
- Secondary task a: Create a mass balance plot for the simulated model.
-
Primary task 3: Calculation of PK parameters from a mean model simulation (from Task 1). The output of this stage is a CSV file containing the PK parameter evaluated for each simulated output of the model.
- Secondary task a: Create plots and tables based on calculated PK parameters.
-
Primary task 4: Sensitivity analysis of the PK parameters of a mean model. The output of this stage is a CSV file containing the sensitivities of each PK parameter to user-specified model parameters.
- Secondary task a: Create plots and tables based on sensitivity analysis.
The tasks of the population workflow operate on simulation sets that contain at least a pkml model and a population data CSV file. The tasks are as follows:
-
Primary task 1: Create demography plots/tables for the population.
-
Primary task 2: Simulation of the model for a population. The output of this stage is a CSV file that contains the simulated outputs of the model, over time, for each individual in the population.
- Secondary task a: Create a time profile plot of the outputs of the simulated model for the entire population.
-
Primary task 3: Calculation of PK parameters for each simulated model output for each individual in a population. A CSV file stores the results of the output of this stage.
- Secondary task a: Create plots and tables based on calculated PK parameters.
-
Primary task 4: Sensitivity analysis of the PK parameters of a population. For each PK parameter and simulation output, the reporting engine will select the individuals from the population that yield PK parameters that lie closest to the 5%. 50% and 95% quantiles (or other user-set quantiles). A sensitivity analysis will then be conducted on each of the selected individuals. The sensitivity analysis results for each individual are stored in a separate CSV file.
- Secondary task a: Create plots and tables based on sensitivity analysis.
In this example, we first create a simulation set. This simulation set is then used to create a mean model workflow. We then modify the workflow to specify what parameters we wish to vary in the sensitivity analysis. Finally, we run the workflow.
To create the simulation set, we first create a path to the pkml simulation file. A PKsim whole-body model pkml simulation, individualPksimSim.pkml
, is available in the ospsuite.reportingengine
./data
directory. In R
, a path to this file is first created:
simFilePath1 <- "[PATH TO FILE]/individualPksimSim.pkml"
We next create a mean model simulation set object and name it "SET1", as follows:
meanModelSimulationSet1<- MeanModelSet$new(simulationFile = simFilePath1, simulationSetName = "SET1")
Next, a mean model workflow is initialized:
meanModelWorkflow1 <- MeanModelWorkflow$new(simulationSets = list(meanModelSimulationSet1))
The mean model workflow now has active tasks that are ready to be run. These are R6 classes and include a model simulation task, a PK parameter calculation task, and a sensitivity analysis task. These tasks can be accessed like so:
meanModelWorkflow1$meanModelSimulation
meanModelWorkflow1$meanModelPKParameters
meanModelWorkflow1$meanModelSensitivityAnalysis
These tasks can be modified, activated or inactivated from their properties and methods. For example, in order to only vary two parameter paths ("Organism|Hematocrit"
and "Organism|Pancreas|Volume"
) in the sensitivity analysis, we modify the sensitivity analysis task:
meanModelWorkflow1 $meanModelSensitivityAnalysis$variableParameterPaths <- c("Organism|Hematocrit", "Organism|Pancreas|Volume")
Finally, we run the workflow as follows:
meanModelWorkflow1$runWorkflow()
This creates a folder in the working directory entitled Workflow_[DATE]_[TIME]
, where the results of the workflow are found.
As with the mean model workflow, we create a path to the model file:
simFilePath1 <- "[PATH TO FILE]/individualPksimSim.pkml"
Since this is a population workflow example, we also need to create a path to the population file. The population file popData.csv
, is available in the ospsuite.reportingengine
./data
directory:
popFilePath <- "[PATH TO FILE]/popData.csv"
Next, we create a simulation set:
populationSimulationSet <- PopModelSet$new(simulationFile = simFilePath1, populationFile = popFilePath)
Next, a population workflow is created:
popWorkflow1 <- PopulationWorkflow$new(simulationSets = list(populationSimulationSet ))
The tasks of the population workflow can now be accessed from:
popWorkflow1$populationSimulation
popWorkflow1$populationPKParameters
popWorkflow1$populationSensitivityAnalysis
To limit the parameters to be varied in the sensitivity analysis to "Organism|Hematocrit"
and "Organism|Pancreas|Volume"
, we modify the sensitivity analysis task using
popWorkflow1$populationSensitivityAnalysis$variableParameterPaths <- c("Organism|Hematocrit","Organism|Pancreas|Volume")
Finally, the workflow is run using
popWorkflow1$runWorkflow()
Once the run is complete, the results of the workflow will be saved in the folder Workflow_[DATE]_[TIME]
in the working directory.