Open msevestre opened 2 years ago
I have a PR exposing this stuff https://github.com/Open-Systems-Pharmacology/OSPSuite.Core/pull/1583
I will need help for naming however
@msevestre I cannot get it running from R.
ReturnOutputValues = TRUE
:sim <- loadTestSimulation("simple")
sensitivity <- SensitivityAnalysis$new(sim)
sensitivityAnalysisOptions <- SensitivityAnalysisRunOptions$new(showProgress = FALSE)
sensitivityAnalysisOptions$returnOutputValues <- TRUE
results <- runSensitivityAnalysis(sensitivity, sensitivityAnalysisOptions)
> results
SensitivityAnalysisResults:
Number of calculated sensitivities: 72
Available PK parameters: C_max t_max C_tEnd AUC_tEnd Thalf AUC_inf MRT FractionAucLastToInf
> tmp <- rClr::clrCall(results$ref, "OutputParameterSensitivitiesFor", "Organism|B", "R1-k1")
> tmp
list()
The sensitivity for the combination of output path and parameter does exist:
> results$pkParameterSensitivityValueFor("C_max", "Organism|B", "R1-k1")
[1] 0.125683
We also need the simulated time, which is currently not exposed.
tmp <- rClr::clrCall(results$ref, "OutputParameterSensitivitiesFor", "Organism|B", "R1-k1")
This should be the parameter path as second argument
but we can use the PI PArameter name instead if this makes more sense
and it probably makes sense if we have results$pkParameterSensitivityValueFor("C_max", "Organism|B", "R1-k1")
@IndrajeetPatil @PavelBal @Yuri05
This is definitely possible with the current implementation At the moment, we create a huge "Variation Table" that is being passed to the PopulationRunner Each Column is a parameter, each row is a simulation. (or Individual so to speak). Each Row represents the variation of only one parameter
https://github.com/Open-Systems-Pharmacology/OSPSuite.Core/blob/develop/src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisEngine.cs#L68
The [runResults] https://github.com/Open-Systems-Pharmacology/OSPSuite.Core/blob/develop/src/OSPSuite.Core/Domain/Services/SensitivityAnalyses/SensitivityAnalysisEngine.cs#L69
are of type
PopulationRunResults
. which has a property internally that is well known in R Results of typeSimulationResults
We are already using this object from ospsuite-R. There is for sure some mapping to be performed to understand what row corresponds to which variation but everything is already here somehow
We could also add this info directly to the
SensitivityAnalysisRunResult
which is also used directly in RSo all in all, I think this could be exposed easily to R