nlmixr2 / babelmixr2

The goal of babelmixr2 is to interface nlmixr2 with other pharmacometric tools
https://nlmixr2.github.io/babelmixr2/
8 stars 1 forks source link

What is the purpose of `.nonmemSetCmtProperty()`? #33

Closed billdenney closed 2 years ago

billdenney commented 2 years ago

In this code, why is .nonmemSetCmtProperty() needed rather than directly generating the code for things like lag time and bioavailability?

https://github.com/nlmixr2/babelmixr2/blob/5adebcf375d6ef6331940d2d6fe4d16d223c3af4/R/nonmem.R#L547-L614

mattfidler commented 2 years ago

This uses the same method as with monolix. I believe that monolix may put this in different places in the file (just like NONMEM), so it sets the compartment property as parsing the code and then later it generates the code in a different location

mattfidler commented 2 years ago

Unfortunately that means that merge #22 will have to bring this back...

billdenney commented 2 years ago

Yeah. That was functionality that I lost in my changes in #22. (Shoot!)

If I follow what you're saying and the code correctly, then these are all moved into the $PK block in the NONMEM control stream, most of the rest goes into the $DES block, and a bit goes into the residual error model block. Is that correct?

Overall, it seems to be handled here, is that right? https://github.com/nlmixr2/babelmixr2/blob/3676d28b7689143b90ce2549cc0e9ccf5991f27c/R/nonmemRxUiGetPk.R#L134-L159

And so, we need the .prop and .pk2 assignment to work correctly (which they won't now), is that right?