-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreport-NO10.R
84 lines (76 loc) · 2.86 KB
/
report-NO10.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#' @title report-NO10
#' @description
#' Report from Test NO10 initial RE testing
# Clean environent and (re-)load the ospsuite.reportingengine package
rm(list = ls())
library(ospsuite.reportingengine)
ospsuite::removeAllUserDefinedPKParameters()
# Define inputs for workflow
simulationFile <- "Models/Adults_SingleIV_Bolus.pkml"
adultPopulation <- "Data/test-NO9/Adults_18_100_years-Population.csv"
child03Population <- "Data/test-NO9/Kids_0_3_years-Population.csv"
child36Population <- "Data/test-NO9/Kids_3_6_years-Population.csv"
child69Population <- "Data/test-NO9/Kids_6_9_years-Population.csv"
reportFolder <- "tests/Reports/Test-NO10"
reportTitle <- "Report NO10"
# Define the simulation outputs possibly with their PK parameters
pkCMax <- PkParameterInfo$new(pkParameter = "C_max", displayUnit = "µg/l")
pkTmax <- PkParameterInfo$new(pkParameter = "t_max", displayUnit = "h")
pkCtend <- PkParameterInfo$new(pkParameter = "C_tEnd", displayUnit = "µg/l")
pkAUC <- PkParameterInfo$new(pkParameter = "AUC_tEnd", displayUnit = "µg*h/l")
pkCL <- PkParameterInfo$new(pkParameter = "CL", displayUnit = "ml/min/kg")
pkVss <- PkParameterInfo$new(pkParameter = "Vss", displayUnit = "ml/kg")
output <- Output$new(
path = "Organism|PeripheralVenousBlood|C1|Plasma (Peripheral Venous Blood)",
displayName = "C1 plasma", displayUnit = "µg/l",
pkParameters = c(pkAUC, pkCMax, pkCtend, pkTmax, pkCL, pkVss)
)
# Define the simulation sets possibly mapping simulations to observed data
adulSet <- PopulationSimulationSet$new(
referencePopulation = TRUE,
simulationSetName = "single IV administration",
populationName = "adult",
simulationFile = simulationFile,
outputs = output,
populationFile = adultPopulation
)
child03Set <- PopulationSimulationSet$new(
simulationSetName = "children_0_3y",
populationName = "0-3y",
simulationFile = simulationFile,
outputs = output,
populationFile = child03Population
)
child36Set <- PopulationSimulationSet$new(
simulationSetName = "children_3_6y",
populationName = "3-6y",
simulationFile = simulationFile,
outputs = output,
populationFile = child36Population
)
child69Set <- PopulationSimulationSet$new(
simulationSetName = "children_6_9y",
populationName = "6-9y",
simulationFile = simulationFile,
outputs = output,
populationFile = child69Population
)
# Define the workflow and its result folder
workflow <- PopulationWorkflow$new(
workflowType = PopulationWorkflowTypes$pediatric,
simulationSets = c(adulSet, child03Set, child36Set, child69Set),
workflowFolder = reportFolder,
reportTitle = reportTitle,
# To speed up the report generation, we skip the Word report here
createWordReport = FALSE
)
# Define the workflow tasks
workflow$inactivateTasks()
workflow$activateTasks(tasks = c(
"simulate",
"calculatePKParameters",
"plotTimeProfilesAndResiduals",
"plotPKParameters"
))
# Run the workflow
workflow$runWorkflow()