Introducing PoPy for PK/PD

PoPy is a suite of powerful, robust software tools, written in Python, for population modelling of pharmacokinetic/pharmacodynamic (PK/PD) data.

For decades, mathematical modelling for PK/PD has been dominated by NONMEM – a massive breakthrough for the field in the 1970s. (Some of the original FORTRAN code, written by Stuart Beale, is still in use today!) Although alternative modelling packages exist they often differ in their interface and algorithm choices, making it difficult for users to make the transition and introducing uncertainty about the results.

When we conceived PoPy, we wanted it to have properties that bridge this gap: powerful modelling that uses robust, deterministic algorithms and an easy-to-use interface that can be explained in terms of software most users are familiar with, all written in a modern language that makes the package easy to maintain and extend as new methods and tools are invented.

Free for Academic and Educational Use

Because we believe in the value of PK/PD modelling, we think the tools to learn the necessary skills should be as widely available as possible. That is why, from day one, a version of PoPy will be available under a licence that is free for academic and educational use. With PoPy, students can learn about population modelling using a language that is transparent, elegant, explicit, and free of the idiosyncracies of legacy software packages.

Keep Me Posted

Powerful Features

PoPy’s intuitive interface and automated visualization make it perfect for people who are new to PK/PD, and it contains all of the features that are required for day-to-day modelling:

  • Nonlinear mixed-effect models
  • Bolus and infusion dosing regimens
  • Interoccasion variability
  • Continuous, categorical and time-to-event modelling
  • Mixed PK and PD models

Also, however, PoPy has advanced functionality for more experienced users, including features that many other PK/PD modelling packages do not.

Explicit Hierarchical Models

Hierarchical models that use several occasions for each of many individuals can be difficult to encode when you need to keep track of the associated random effects. With PoPy, you need only define one random effect at each level of the hierarchy and the software takes care of the rest, making the model more explicit and self-documenting.

Complex Dosing

As well as supporting common dosing regimens, we also provide built-in support for multiple, overlapping doses that use complex functions such as the Weibull and Gamma curves. Taking away the need for you to write custom code for complex dosing makes better use of your time and reduces errors.

Data Synthesis

PoPy makes it easy to generate artificial data from a model of your design using a variety of statistical models for variability and error. You can then use these simulated datasets, created from known underlying parameters, to explore the properties of your model and the performance of different fitting methods.

Fitting to synthetic data for exploration is especially easy using PoPy’s tutorial format where all parameters of the modelling processing can be put into a single control file.

Keep Me Posted

Intuitive Interface

Making the transition to a new modelling interface can be a steep learning curve. We have taken care to make this transition as easy as possible by building PoPy around a command-line interface that processes a structured input file with clear and well-documented parallels to those used by NONMEM, as well as providing conversion tools to support the transition from other packages.

Where possible, however, we have made changes that make modelling easier and more productive.

Easy to Install and Validate

PoPy comes as a single binary installer, making it incredibly easy to get up and running. To test your PoPy installation and make sure that differences in computer architecture don’t mean differences in the outcomes, we also include a validation tool that runs with a single line at the command prompt – perfect for avoiding the tedium of computer system validation that is required under many Standard Operating Procedures.

One click and one line, and you’re ready to go.

Variables Have Names and Types

Variables should have names, not numbers. PoPy’s syntax makes it clear what purpose each variable serves in the model, with descriptive names of your choice to avoid confusion. This also makes it easy to change the model later because variables can be moved or deleted without having to re-index vector elements.

Variables have names and types in PoPy

Hierarchical Model Syntax

Many models, such as those with inter-occasion (within-subject) variability, are naturally described by a tree structure. In PoPy, we have made this explicit with a hierarchical model syntax, so that you don’t need to encode the various levels of the model with clumsy ‘if’ statements.

Hierarchical model structure used in PoPy

Built-In Distributions

Many other PKPD packages assume measurement errors are normally distributed, such that you need to write your own formulae for any other error distribution. PoPy, however, provides a suite of built-in probability distributions so that you can easily combine different error models for applications with continuous, categorical, counted and time-to-event observations.

Keep Me Posted

Effortless Visualization

Because pages of plain text make results less accessible and insights less obvious, results are often best presented graphically. With this in mind, PoPy generates commonly used, configurable, print-ready plots and diagrams for you without any need for third party packages (e.g. R or PsN).

From smooth prediction/observation plots for individuals, to Visual Predictive Checks for populations, to automatically generated compartment diagrams, PoPy will create the graphs you need to get your message across.

Automated Summaries

At the end of a run, PoPy also produces an easy-to-read summary of the outputs in hyperlinked HTML. The summary includes tables of initial and final parameter values, plus individual and population plots of the PK/PD simulations, so that you can see the results of your run at a glance.

HTML summary generated automatically by PoPy

Keep Me Posted

Extensive Support

PoPy combines the power of industry-standard modelling packages with an easy-to-use interface and numerous examples, while being free to use for academic and educational purposes. Getting the best out of PoPy’s features, however, requires more than just an intuitive interface so we provide clear instructions and support to help you both when you’re getting started and when things go wrong.

Thorough Documentation

PoPy comes with extensive documentation in the form of detailed tutorials, a broad range of case studies to illustrate PoPy’s many features, and a comprehensive reference manual in both hyperlinked HTML and printable PDF formats.

Step-by-Step Tutorials

PoPy is an ideal package for students who wish to learn PK/PD, from basic principles to advanced modelling techniques. To make it especially easy to get started with PoPy we include a tutorial format that, with a single line at the command prompt, showcases every stage of the modelling process: data synthesis, fitting, simulation and visualization.

We know, however, that academics are the experts in education so we look forward to working with those teaching PK/PD in order to develop course material around PoPy to benefit the next generation of PK/PD scientists.

Informative Error Messages

Things do occasionally go wrong and, when they do, you want to to know exactly what has happened. We know from experience that knowing you had a “segmentation fault” or a “stack overflow” isn’t helpful when developing complex models for PK/PD. PoPy’s error reporting is therefore designed to catch errors early and explain them in straightforward language, so that you can find the bugs in your model as quickly as possible.

Keep Me Posted

Data Synthesis

Although PoPy is well-suited to academic and educational use, we know that there may not be a dataset to hand that illustrates a particular PKPD feature.

PoPy, however, makes it easy to generate artificial data from a model of your design, including dosing regimens and sampling schemes, using a variety of statistical models for error and variability. You can then use these simulated datasets, from known underlying parameters, to explore the properties of your model and the performance of different fitting methods.

Fitting to synthetic data for exploration is especially easy using PoPy’s tutorial format where all parameters of the modelling processing can be put into a single control file.

Keep Me Posted

Stay Informed

PoPy was released in May 2019 under a licence that is free for academic and educational use. If you would like us to keep you informed on developments, sign up to our electronic mailing list below and follow PoPy updates on Facebook and Twitter.