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

Does it make sense to have a value defined as constant and as distributed parmaeter for the same species #2702

Open msevestre opened 1 year ago

msevestre commented 1 year ago

Example: Gastric emptying time

image

and

image

We have code that removes one to add the other but....I can't help but feel we should not have a constant parameter in the first place. Or what am I missing? It's only distributed for a sub section of the populations? Weird

Yuri05 commented 1 year ago

I think it does not make sense indeed; the entry for human should be removed from tab_container_parameter_values

Yuri05 commented 1 year ago

currently, distribution "wins" over the const value due to https://github.com/Open-Systems-Pharmacology/PK-Sim/blob/4dda6236eb76e2f8ed2208584acf52f73ec91995/src/PKSim.Core/Services/ParameterContainerTask.cs#L183-L185

Could make sense if e.g. a parameter is defined as distributed just for 1 population and as a const value for all other populations. But here it's defined for ALL populations, so the const value does not make any sense.

msevestre commented 1 year ago

Yes it wins but I am wondering if we should remove it completely? Feels more like a db issue to me. This value is never used. Do we have parameters that are distributed for one population and constant for another?

Yuri05 commented 1 year ago
OK, so looking at the (human) parameters which are currently present both as const values and distributions, we have 3 groups of parameters: ``` SELECT tv.container_id AS id, tv.container_name, tv.parameter_name, COUNT (DISTINCT population||gender) AS pop_gender, COUNT (DISTINCT mean_value) AS different_mean, max(standard_deviation) AS [max(std)] FROM tab_container_parameter_values AS tv, tab_container_parameter_curves AS tc WHERE tv.species = tc.species AND tv.container_id = tc.container_id AND tv.parameter_name = tc.parameter_name GROUP BY tv.container_id, tv.container_type, tv.container_name, tv.parameter_name ORDER BY different_mean, pop_gender, tv.parameter_name, tv.container_id ```

Group 1

: just one mean_value and deviation=0 for all combinations of {population, gender}
These parameters can be safely removed from distributions (tab_container_parameter_curves)
id | container_name | parameter_name | pop_gender | different_mean | max(std) -- | -- | -- | -- | -- | -- 3950 | Duodenum | Fraction mucosa | 2 | 1 | 0 3973 | UpperJejunum | Fraction mucosa | 2 | 1 | 0 3996 | LowerJejunum | Fraction mucosa | 2 | 1 | 0 4019 | UpperIleum | Fraction mucosa | 2 | 1 | 0 4042 | LowerIleum | Fraction mucosa | 2 | 1 | 0 4066 | Caecum | Fraction mucosa | 2 | 1 | 0 4089 | ColonAscendens | Fraction mucosa | 2 | 1 | 0 4112 | ColonTransversum | Fraction mucosa | 2 | 1 | 0 4135 | ColonDescendens | Fraction mucosa | 2 | 1 | 0 4158 | ColonSigmoid | Fraction mucosa | 2 | 1 | 0 4181 | Rectum | Fraction mucosa | 2 | 1 | 0 158 | LargeIntestine | Mucosa blood flow fraction | 2 | 1 | 0 168 | SmallIntestine | Mucosa blood flow fraction | 2 | 1 | 0 149 | Brain | Vf (lipid) | 2 | 1 | 0 149 | Brain | Vf (protein) | 2 | 1 | 0 149 | Brain | Vf (water) | 2 | 1 | 0

Group 2:

we have distribution values for all combinations of {population, gender} (currently 15 such combinations available) and either more than 1 mean_value or deviation>0
These parameters can be safely removed from const values tab_container_parameter_values
id | container_name | parameter_name | pop_gender | different_mean | max(std) -- | -- | -- | -- | -- | -- 4482 | Stomach | Gastric emptying time | 15 | 1 | 1,6 168 | SmallIntestine | Small intestinal transit time | 15 | 1 | 1,6 4483 | Duodenum | Effective surface area enhancement factor | 15 | 3 | 0 4484 | UpperJejunum | Effective surface area enhancement factor | 15 | 3 | 0 4485 | LowerJejunum | Effective surface area enhancement factor | 15 | 3 | 0 4486 | UpperIleum | Effective surface area enhancement factor | 15 | 3 | 0 4487 | LowerIleum | Effective surface area enhancement factor | 15 | 3 | 0 4488 | Caecum | Effective surface area enhancement factor | 15 | 3 | 0 4489 | ColonAscendens | Effective surface area enhancement factor | 15 | 3 | 0 4490 | ColonTransversum | Effective surface area enhancement factor | 15 | 3 | 0 4491 | ColonDescendens | Effective surface area enhancement factor | 15 | 3 | 0 4492 | ColonSigmoid | Effective surface area enhancement factor | 15 | 3 | 0 4493 | Rectum | Effective surface area enhancement factor | 15 | 3 | 0

Group 3:

we have distribution values only for some combinations of {population, gender} and more than one different mean value
These parameters must be kept in both tables (unless we want to duplicate the values for all remaining {population, gender} combinations
id | container_name | parameter_name | pop_gender | different_mean | max(std) -- | -- | -- | -- | -- | -- 156 | Heart | Vf (water) | 2 | 23 | 0 162 | Pancreas | Vf (water) | 2 | 23 | 0 167 | Skin | Vf (water) | 2 | 27 | 0 148 | Bone | Vf (lipid) | 2 | 31 | 0 148 | Bone | Vf (protein) | 2 | 31 | 0 152 | Fat | Vf (protein) | 2 | 55 | 0 148 | Bone | Vf (water) | 2 | 57 | 0 167 | Skin | Vf (lipid) | 2 | 61 | 0 167 | Skin | Vf (protein) | 2 | 61 | 0 162 | Pancreas | Vf (lipid) | 2 | 91 | 0 162 | Pancreas | Vf (protein) | 2 | 91 | 0 156 | Heart | Vf (lipid) | 2 | 97 | 0 156 | Heart | Vf (protein) | 2 | 97 | 0 159 | Liver | Vf (lipid) | 2 | 99 | 0 159 | Liver | Vf (protein) | 2 | 99 | 0 157 | Kidney | Vf (lipid) | 2 | 101 | 0 169 | Spleen | Vf (lipid) | 2 | 101 | 0 157 | Kidney | Vf (protein) | 2 | 101 | 0 169 | Spleen | Vf (protein) | 2 | 101 | 0 158 | LargeIntestine | Vf (lipid) | 2 | 105 | 0 168 | SmallIntestine | Vf (lipid) | 2 | 105 | 0 170 | Stomach | Vf (lipid) | 2 | 105 | 0 158 | LargeIntestine | Vf (protein) | 2 | 105 | 0 168 | SmallIntestine | Vf (protein) | 2 | 105 | 0 170 | Stomach | Vf (protein) | 2 | 105 | 0 155 | Gonads | Vf (lipid) | 2 | 107 | 0 155 | Gonads | Vf (protein) | 2 | 107 | 0 160 | Lung | Vf (lipid) | 2 | 109 | 0 160 | Lung | Vf (protein) | 2 | 109 | 0