Objectives: The new R package NMsim [1] provides the capability to perform NONMEM simulations directly from R, without need of model reimplementation. This functionality allows a pharmacometrics simulation to be performed without having to transcribe and validate models using different software platforms and modeling syntax. As a result, efficient automated workflows can be developed to perform simulation-based analyses and visualize key results. Simulation runs may be executed in parallel on a computing grid.
The objectives are to create automated simulation workflows for use in pharmacometrics. • Analyze covariate effects: Multiple simulations are performed with parameter uncertainty using NMsim and visualized as a forest plot using the coveffectsplot package [2]. • Visual predictive check: Estimation datasets are reused for simulation using NMsim and VPC plots are produced via the tidyvpc R package [3].
Methods: Forest plot: • 500 simulations of a NONMEM model with parameter uncertainty were executed from R using NMsim. • Outputs from all runs were collected in an R data table, summarized, and visualized as a forest plot using coveffectsplot.
Visual predictive check: • Estimation data was reused to perform 500 VPC simulations of a NONMEM model in R. • The resulting outputs were visualized using tidyvpc.
Results: Two use cases of NMsim – simulation of parameter uncertainty and VPCs – are presented, showing how it can be seamlessly integrated with other R packages to automate simulation-based pharmacometrics analyses. Examples of code, table outputs, and visualizations are presented to illustrate how automated workflows can easily be built and implemented in a single R script without the need of any reimplementation or modification of the NONMEM model.
The workflows are also available in the vignettes section of the NMsim R package and can hopefully serve as useful examples for modelers who wish to streamline their analyses.
Conclusions: By combining the simulation capabilities of NMsim with other pharmacometrics packages in R, it is possible to build automated analysis pipelines with minimal code. We hope these examples will aid pharmacometricians in producing quick, clean, and efficient simulation workflows, and reduce coding burden.
Citations: [1] Delff P (2024). NMsim: Seamless 'Nonmem' Simulation Platform. R package version 0.1.0, https://philipdelff.github.io/NMsim/ [2] Marier J-F, Teuscher N, Mouksassi M-S. Evaluation of covariate effects using forest plots and introduction to the coveffectsplot R package. CPT Pharmacometrics Syst Pharmacol. 2022; 11: 1283-1293. doi:10.1002/psp4.12829 [3] Barriere O, Rich B, Craig J, Mouksassi S (2024). tidyvpc: VPC Percentiles and Prediction Intervals. R package version 1.5.1, https://github.com/certara/tidyvpc