Skip to content
deleveldPublic

About

OpenPMX is a collection of numerical routines for estimation and simulation of mixed-effect pharmacokinetic and pharmacodynamic models.

Resources

Stars

16 stars

Watchers

3 watching

Forks

Latest commit

 

History

216 Commits

Folders and files

Repository files navigation

Hi everybody out there doing pharmacometrics,

I have been writing some free model estimation software as a side project. It wont be a big professional thing like NONMEM, nlmixr2, or Monolix. This has been brewing for a number of years and might be starting to get ready for broader use. I'd like feedback on what people like/dislike with the control, data, and table file structures. It somewhat resembles NONMEM due to practical reasons but it is written in C instead of FORTRAN.

I made some examples but I dont really know if its practical right now or if further development is needed. People can let me know what are some essential features that might be needed. Suggestions are welcome but I cant promise that I will (or that I'm smart enough to) implement them.

It allows multi-threaded estimation, and doesnt share code with any other projects except for the open-source BOBYQA algorithm and needling linking to GSL. Right now it only compiles with gcc.

Douglas Eleveld


OpenPMX

OpenPMX is a collection of numerical routines for estimation and simulation of mixed-effect pharmacokinetic and pharmacodynamic models.

If you just want to use the latest stable version then you should look at the Releases. This repository contains the work-in-progress (WIP) development version and could concievably be broken.

Features

  • First-order conditional estimation with interation (FOCEI) results similar to industry standard NONMEM
  • Code and simulate/estimate models using text files and C allows scripting and integration with other tools
  • System advancers for:
    • Analytic models for common comparmental models
    • Ordinary-Differential-Equation (ODE) solver for complex models
    • Eigensystem solver for linear models of any topology
  • Utilize multi-core CPUs via OpenMP or pthreads
  • Estimation speed comparable with NONMEM
  • Limited project scope and complexity, focused on simulation and estimation
  • Few dependencies: gcc, GSL

New features 0.1.7

  • Added an initial LAPLACE method the stage1.c, still testing to see if any performance is gained. Based on code submitted by Erik Olofsen (e.olofsen@weggetjes.nl).
  • Documentation of the FOCEI method derived from code and documentation submitted by Erik Olofsen (e.olofsen@weggetjes.nl)
  • Speed optimized advance functions for two- and three-compartment models and eigensystem solver.
  • Covariance matrix of estimation via covariance() to determine parameter limits.
    • For a given change in objective function value, the upper and lower bounds of the estimated THETA(), SIGMA(), and OMEGA() diagonal values are calculated
    • The default uses the Sandwitch matrix (R-1SR-1)
    • The near-null space of S and R are examined to determine non-idenifiable parameters
  • Likelihood profiles via profile() to determine parameter limits. Uses bracketing to find the paramater value for a delta objective function to a desired accuracy.
  • Use BLQ estimates in model estimation using the loglik_llq() function within the $PRED() record
  • Simulate Target-Controlled-Infusion (TCI) dosing on any model
  • Reload population models via reload() from previous (even incomplete) estimations

Presentations

License

OpenPMX is free software, you can redistribute it and/or modify it under the terms of the GNU General Public License. Unlike the licenses of proprietary pharmacometric software the license of OpenPMX does not restrict scientific cooperation. It allows you to share your programs freely with others. The GNU General Public License does not permit this software to be redistributed in proprietary programs.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Install

First, prepare for install:

  • Ubuntu:
    1. Install GSL with sudo apt-get install libgsl-dev
  • Windows MSYS2:
    1. Install MSYS2
    2. Install gcc, I used pacman -S mingw-w64-x86_64-gcc
    3. Install GSL, I used pacman -S mingw-w64-x86_64-gsl
  • Windows WSL:
    1. Install compiler and linker with sudo apt-get install build-essentials
    2. Install GSL, with sudo apt-get install libgsl-dev

Second, run install script:

Run ./install or ./install openmp or ./install singlethread

After install there will be a shell script openpmx with the installed paths.

Examples

Some examples are available.

Propofol

In the directory examples/schnider are the Schnider PK data reported in Schnider TW, Minto CF, Gambus PL, Andresen C, Goodale DB, Shafer SL, Youngs EJ. The influence of method of administration and covariates on the pharmacokinetics of propofol in adult volunteers. Anesthesiology 1998;88:1170-82.

In this example a 3-compartment allometric model is estimated. The covariance limits are also calculated.

  • ../../openpmx schnider.gr

The same example, but using the differential equation solver.

  • ../../openpmx schnider_diffeqn.gr

The same example, but using the eigensystem solver.

  • ../../openpmx schnider_eigen.gr

The same example, but using the eigensystem solver specialized to a three compartment model.

  • ../../openpmx schnider_eigen_threecomp.gr

The basic example, but with different population paramaters structure that is loaded before starting estimation.

  • ../../openpmx schnider_reload.gr

Theophylline

In directory examples/theo these are the Theophylline data from the NONMEM distribution.

  • ../../openpmx theo.gr

Warfarin

In directory examples/warfarin contains data obtained from here and here. The PK-PD analysis example is:

  • ../../openpmx warfarin.gr

Target-controlled-infusion (TCI) dosing

In directory examples/tci contains an example simulation of TCI infusion simulations.

The ./tcisimulation script reproduces Figure 5 of Eleveld DJ, Colin P, Absalom AR, Struys MM. Pharmacokinetic–pharmacodynamic model for propofol for broad application in anaesthesia and sedation. British journal of anaesthesia. 2018 May 1;120(5):942-59. but over a population from the NHANES data. The script requires R and Ghostscript.

Contributors

  • Your name (yourname@email.com) Very important thing elegantly coded.
  • Jona Joachim (jona@joachim.cc) Contributed the code in src/advan/ministan which is a modernized version of Stanpump. This is used in code for a TCI dosing controller. See the functions pmx_advan_tci_* and examples/tci.
  • Erik Olofsen (e.olofsen@weggetjes.nl) contributed documentation for the control file.
  • Jona Joachim (jona@joachim.cc) Contributed the eigensystem advancer $ADVAN(eigen) which uses eigendecomposition to obtain exact, analytical solutions for any linear compartmental model. It can replace both the analytical ADVANs and the ODE solver, and is exact (no step size error) and general (any number of compartments, any topology). See the blogpost.
  • Douglas Eleveld (deleveld@dds.nl) Initial codebase.

Wish-list / TODO

  • Make example showing how estimation of categorical variables is possible.
  • Calculate NPDE.
  • Generate VPCs.

Philosophy

  • Do one thing and do it well.
  • Fewer dependencies are better.
  • Default settings should work well.
  • Reproducibility is good.

About

OpenPMX is a collection of numerical routines for estimation and simulation of mixed-effect pharmacokinetic and pharmacodynamic models.

Resources

Stars

16 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages