Open-Systems-Pharmacology / MoBi

MoBi® is a software tool for multiscale physiological modeling and simulation
Other
29 stars 9 forks source link

Why is the parameter `MeanHeight` stored in Spatial Structure? And other questions about physiological parameters #1401

Closed PavelBal closed 1 month ago

PavelBal commented 1 month ago

I am summarizing in the documentation how different parameters are stored in the new version. I came up with the following summary:

In particular, I am not sure I correctly understand the third type (parameters that will be added):

  1. Why is the parameter Organism|MeanHeight part of the SS BB?
  2. Why are all the Volume parameters not in the SS BB with the value NaN? They are shared across all species (I assume?)
Yuri05 commented 1 month ago
  • All parameters of the spatial structure that have the same value in all species and individuals are stored directly in the spatial structures BB

the same value or the same formula

  • Parameters that are present in all species but have different species-specific values are located in the SS BB, but their value is set to NaN.

As far as I remember, we agreed not to do this. So if a parameter is either present not in all species, or has different species-specific formulas or has different species-specific values - it will not appear in the SpStruct at all. Instead, it will be added dynamically when merging an individual.

  • Distributed physiological parameters. Parameters that are present only for certain species

Not necessarily distributed parameters, but in fact any parameters which differs between species (s. above)

  1. Why is the parameter Organism|MeanHeight part of the SS BB?

Actually it should not be there, because it's defined not for all species...

PavelBal commented 1 month ago

Okay so it seems that the concept is not correctly implemented. Basically, no NaN should be present in the SS BB, except if the parameter is defined by a formula that cannot be evaluated at this timepoint.

msevestre commented 1 month ago

Can we find the issue where we described everything?

PavelBal commented 1 month ago

Maybe this? https://github.com/orgs/Open-Systems-Pharmacology/projects/24/views/3?filterQuery=individual&pane=issue&itemId=35467851

PavelBal commented 1 month ago

17.07.2024: Remove all parameters with NaN (except those with a formula that evaluates to NaN) from the spatial structure -> Parameters coming from the Individual are not part of the SS BB.

msevestre commented 1 month ago

so MeanHeight is returned by the DB has been used by all species image

Here is the list of parameter that are NOT common. Clearly, meanHeight is this is why. I am going to try to see if I can understand why @Yuri05 Might have an idea why this is done like this?

As for NaN for value, this is done explicitly like this in code. I am going to change the code so that these parameters are REMOVED From the spatial structure

msevestre commented 1 month ago

image

msevestre commented 1 month ago

@Yuri05 I am losing my mind lol There are two VIEWS that are defined in the PKSimDB VIEW_INDIVIDUAL_PARAMETER_NOT_FOR_ALL_SPECIES VIEW_INDIVIDUAL_PARAMETER_SAME_FORMULA_OR_VALUE_FOR_ALL_SPECIES

Looking at the second one, I would expect to get all parameter that share the same formula or value across species. Volume Cell is not the case for instance. For Volume I only have

image

msevestre commented 1 month ago

ok so MeanHeight is only defined in tab_parameter_container_curve and not in any other table. This is why its' seen as the same as for all species because ContainerParameters_Species View does not take this table into account

msevestre commented 1 month ago
CREATE VIEW [ContainerParameters_Species]
AS
SELECT DISTINCT 
                [cpv].[container_id], 
                [cpv].[container_type], 
                [cpv].[container_name], 
                [cpv].[parameter_name], 
                [species]
FROM   [tab_container_parameter_values] AS [cpv],
       [tab_container_parameters] AS [cp]
msevestre commented 1 month ago

ok Volume is solved because they are not individual parameters

Yuri05 commented 1 month ago

ok so MeanHeight is only defined in tab_parameter_container_curve and not in any other table. This is why its' seen as the same as for all species because ContainerParameters_Species View does not take this table into account

Yep, that was a mistake. Fixed it in the open PR (added the highlighted part).

Details

Yuri05 commented 1 month ago

Yep, that was a mistake. Fixed it in the open PR (added the highlighted part).

Rollbacked the fix due to problems.

msevestre commented 1 month ago

what problems?

Yuri05 commented 1 month ago

Lot of integration tests where simulations were created failed because some parameters were missing.

msevestre commented 1 month ago

@Yuri05 Was it because of the change for MEanHeight or the other changes?

Yuri05 commented 1 month ago

Hard to say. I incorporated the changes from the last PR for MeanHeight before I run the tests

PavelBal commented 1 month ago

@msevestre @Yuri05 THis is solved, right?

msevestre commented 1 month ago

Yes should be resolved