Closed PavelBal closed 2 years ago
Currently, it works without any issues if one of the PK parameters is not available:
library(ospsuite)
library(esqlabsR)
# run time-consuming simulations just once
simPath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite")
simulation <- loadSimulation(simPath)
outputPaths <- "Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)"
parameterPaths <- c(
"Aciclovir|Lipophilicity",
"Applications|IV 250mg 10min|Application_1|ProtocolSchemaItem|Dose",
"Neighborhoods|Kidney_pls_Kidney_ur|Aciclovir|Glomerular Filtration-GFR|GFR fraction"
)
set.seed(123)
results <- sensitivityCalculation(
simulation = simulation,
outputPaths = outputPaths,
parameterPaths = parameterPaths,
variationRange = c(0.1, 2, 20),
pkParameters = c("AUC_tEnd", "AUC_tEnd_norm", "C_min_norm"),
)
unique(results$pkData$PKParameter)
#> [1] "AUC_tEnd" "AUC_tEnd_norm"
Created on 2022-02-25 by the reprex package (v2.0.1.9000)
But instead of this higher level function signalling the unavailability of certain PK parameters, I am wondering if it would be better if the low-level functions in ospsuite
issues warnings related to this?
Related issue here: https://github.com/Open-Systems-Pharmacology/OSPSuite-R/issues/792
But as you are using pkAnalysesToDataFrame
, there is not in between step to check if the provided PK-parameter name is not included.
Also see my comment in the PR - I just realized that there are scenarios where the PK-parameter name provided here is not a "standard" pk param. So we should not check if its in ospsuite::StandardPKParameter
but show a warning here that this parameter is not calculated.
Eg. here
C_min_norm
is not available. It should continue but show a warning. Separater PR please.