Open-Systems-Pharmacology / PK-Sim

PK-Sim® is a comprehensive software tool for whole-body physiologically based pharmacokinetic modeling
Other
103 stars 50 forks source link

Calculate VssPhysChem for populations #2414

Open rwmcintosh opened 1 year ago

rwmcintosh commented 1 year ago

See the discussion in PR #2413 relating to the calculation of VssPhysChem.

rwmcintosh commented 1 year ago

@Yuri05 wrote:

Is there an easy way? Am I missing something?

Well, as far as I can see Individual Ids used/generated by the pop runner are always 0,..., N-1 - so an Individual Id can be just used as index when pulling a values array for a parameter? Which is of course error prone and could be improved, but it's how the population runner works at the moment, right?

https://github.com/Open-Systems-Pharmacology/PK-Sim/blob/1227a5c738c63a68b4c6e46bb2d5395d2bdc96b6/src/PKSim.Core/Services/IPopulationExportTask.cs#L150-L163

Yes, we have the correct individualId all over, but in that code there's this code which extracts the parameters from the model:

https://github.com/Open-Systems-Pharmacology/PK-Sim/blob/1227a5c738c63a68b4c6e46bb2d5395d2bdc96b6/src/PKSim.Core/Services/VSSCalculator.cs#L95-L108

Which is not as easy because the parameters are pulled from this singular 'organism' which is not scaled. During my initial investigation why the median values were not calculated correctly, this particular PKParameter was actually the same for all individuals. While I can access the scaled body weight parameter easily, getting everything else in the model scaled is not something that's already available.

https://github.com/Open-Systems-Pharmacology/PK-Sim/blob/1227a5c738c63a68b4c6e46bb2d5395d2bdc96b6/src/PKSim.Core/Services/VSSCalculator.cs#L83-L86

@msevestre FYI