nlmixrdevelopment / nlmixr

nlmixr: an R package for population PKPD modeling
https://nlmixrdevelopment.github.io/nlmixr/
GNU General Public License v2.0
114 stars 45 forks source link

popPK Dose simulation and PK paramters calculation #601

Closed AprilCCC closed 2 years ago

AprilCCC commented 2 years ago

Hi nlmixr team,

Dose nlmixr can do popPK dose simulation from observed real data, and do the PK calculation based on the simulated results? A similar result shows below: Figure 1 observed data compared with simulated data Figure 2 PK parameters ratio between observed and simulated data image image

I've looked at all the samples from the nlmixr, but couldn't get any clue to do the simulation like this. Any idea would be appreciated!

mattfidler commented 2 years ago

Hi @AprilCCC

Once the model has been fit, you can certainly directly simulate from it:

https://nlmixrdevelopment.github.io/nlmixr/articles/xgxr-nlmixr-ggpmx.html#simulation-of-a-new-scenario-with-rxode

Once the simulation is performed you can use any of the many NCA tools to get the noncompartmental values post and pre-simulation.

@billdenney is working on a PKNCA and nlmixr2 interaction and some function that performs this automatically may come in the future but isn't there now.

AprilCCC commented 2 years ago

Hi @mattfidler Thanks for the suggestion, that's very helpful.
After the simulation was performed, as shown below, I tried to fit data into PKNCA, but the simulated data is lacking of the amount of dose for the PKNCAdose formula (formula=dose.amount~time|groups). Should I export the simulated data and then add the dose manually, or is there any other way to add the dose amount data for the simulated data set? Also, How to export the simulated data set to csv. ?

image
billdenney commented 2 years ago

@AprilCCC , PKNCA doesn't require the dose, but you will likely want some ability to separate by treatment. You can run as.data.frame() to get a data.frame from your simulation. For PKNCA, it would likely be better to discuss how to use the data for NCA in a new issue over there: https://github.com/billdenney/pknca/issues

mattfidler commented 2 years ago

You can also add dosing information by rxSolve(..., addDosing=TRUE)

mattfidler commented 2 years ago

The documentation for this function is here: https://nlmixrdevelopment.github.io/RxODE/reference/rxSolve.html

AprilCCC commented 2 years ago

Hi @mattfidler and @billdenney , those are very helpful, thanks.