Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Make projectConfiguration object contain _ALL_ the project's parameters #560

Open
Felixmil opened this issue Oct 25, 2023 · 1 comment · May be fixed by #651
Open

Idea: Make projectConfiguration object contain _ALL_ the project's parameters #560

Felixmil opened this issue Oct 25, 2023 · 1 comment · May be fixed by #651

Comments

@Felixmil
Copy link
Collaborator

This would allow the user to navigate in the projectConfiguration easily using only one entry point:

projectConfigurations$scenarios[["my_scenario"]]

projectConfigurations$individuals

projectConfigurations$modelParameters

projectConfigurations$plots$exportConfiguration

...

This would exploit the most of the OOP structure of our project since we could use active bindings to validate projectConfiguration.

For example:

  • Check if and individualId used for a scenario is actually defined in the object.
  • Check if model a scenario picked in Plots is defined in Scenarios
  • etc...

Also, this would simplify the code in many parts where we pass projectConfiguration to other methods or functions.

This would also make things easier to import/export all the configuration and wrangle between format (json, excel, R object).

@Felixmil Felixmil changed the title Idea: Make projectConfiguration object contain **ALL** the project's parameters Idea: Make projectConfiguration object contain *ALL* the project's parameters Oct 25, 2023
@Felixmil Felixmil changed the title Idea: Make projectConfiguration object contain *ALL* the project's parameters Idea: Make projectConfiguration object contain __ALL__ the project's parameters Oct 25, 2023
@Felixmil Felixmil changed the title Idea: Make projectConfiguration object contain __ALL__ the project's parameters Idea: Make projectConfiguration object contain _ALL_ the project's parameters Oct 25, 2023
@Felixmil Felixmil moved this to In Progress in Project Based Workflow Apr 19, 2024
@Felixmil
Copy link
Collaborator Author

Quick demo of what I got so far:

devtools::load_all()
#> ℹ Loading esqlabsR
#> Loading required package: ospsuite
#> 
#> Loading required package: rClr
#> 
#> Loading the dynamic library for Microsoft .NET runtime...
#> Loaded Common Language Runtime version 4.0.30319.42000

myProject <-  Project$new(projectConfiguration = testProjectConfiguration())

myProject$models
#> [1] "Aciclovir.pkml"

names(myProject$configurations)
#> [1] "modelParameters" "individuals"     "applications"

myProject$configurations$modelParameters
#> $Global
#> $Global$`EHC continuous fraction`
#> $Global$`EHC continuous fraction`$containerPath
#> [1] "Organism|Liver"
#> 
#> $Global$`EHC continuous fraction`$parameterName
#> [1] "EHC continuous fraction"
#> 
#> $Global$`EHC continuous fraction`$value
#> [1] 1
#> 
#> $Global$`EHC continuous fraction`$units
#> [1] NA
#> 
#> 
#> 
#> $MissingParam
#> $MissingParam$bar
#> $MissingParam$bar$containerPath
#> [1] "foo"
#> 
#> $MissingParam$bar$parameterName
#> [1] "bar"
#> 
#> $MissingParam$bar$value
#> [1] 2
#> 
#> $MissingParam$bar$units
#> [1] NA
#> 
#> 
#> 
#> $Aciclovir
#> $Aciclovir$Lipophilicity
#> $Aciclovir$Lipophilicity$containerPath
#> [1] "Aciclovir"
#> 
#> $Aciclovir$Lipophilicity$parameterName
#> [1] "Lipophilicity"
#> 
#> $Aciclovir$Lipophilicity$value
#> [1] -0.1
#> 
#> $Aciclovir$Lipophilicity$units
#> [1] "Log Units"

myProject$configurations$individuals
#> $Indiv1
#> $Indiv1$characteristics
#> IndividualCharacteristics: 
#>    Species: Human 
#>    Population: European_ICRP_2002 
#>    Gender: MALE 
#>    Age: 30.00 [year(s)] 
#>    Gestational age: 40.00 [week(s)] 
#>    Weight: 73.00 [kg] 
#>    Height: 176.00 [cm] 
#> 
#> $Indiv1$parameters
#> $Indiv1$parameters$GFR
#> $Indiv1$parameters$GFR$containerPath
#> [1] "Organism|Kidney"
#> 
#> $Indiv1$parameters$GFR$parameterName
#> [1] "GFR"
#> 
#> $Indiv1$parameters$GFR$value
#> [1] 90
#> 
#> $Indiv1$parameters$GFR$units
#> [1] "ml/min"

subsetScenarios <- c("TestScenario", "TestScenario2")
myProject$setScenarioConfigurations(subsetScenarios)

myProject$runScenarios()
#> Creating scenarios
#>  ■■■■■■■■■■■■■■■■                  50% |  ETA:  3s                                                   Running simulations
#> Simulation Results computed for:
#>   - TestScenario,
#>   - TestScenario2

names(myProject$simulationResults)
#> [1] "TestScenario"  "TestScenario2"

Created on 2024-04-22 with reprex v2.1.0

@Felixmil Felixmil linked a pull request May 15, 2024 that will close this issue
@Felixmil Felixmil added this to the Project Based Workflow milestone Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant