arrow
Return

PKPy: a Python-based framework for automated population pharmacokinetic analysis

delete2025-10-27
delete0
delete
OA
AI
H
Hyunseung Kong
I
Inyoung Kim *
B
Byoung‐Tak Zhang
DOI:10.7717/peerj.20258delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
We present PKPy, an open-source Python framework designed to automate population pharmacokinetic analysis workflows. The framework emphasizes user accessibility by minimizing the need for manual parameter initialization while maintaining analytical rigor. PKPy implements both one-compartment and two-compartment pharmacokinetic models (with and without first-order absorption) with integrated capabilities for parameter estimation, covariate analysis, and comprehensive diagnostics. The framework's performance was evaluated through simulation studies across varying sample sizes (20-100 subjects) and model complexities. Results demonstrated robust parameter estimation for clearance and volume of distribution, with bias consistently below 3% and recovery rates exceeding 98% in one-compartment models. The framework successfully identified true covariate relationships with 100% accuracy across all scenarios, while maintaining high model fit quality (R-2 >= 0.97). For two-compartment models, the framework showed comparable performance with slightly higher parameter bias (5-10%) but maintained excellent fit quality (R-2 >= 0.99). Advanced validation metrics including average fold error (AFE) and absolute average fold error (AAFE) were implemented, with AFE values ranging from 1.01-1.03 and AAFE < 1.05 across test scenarios, indicating excellent prediction accuracy. The key pharmacokinetic parameters estimated by the framework include clearance (CL), volume of distribution (V or V1/V2 for two-compartment models), inter-compartmental clearance (Q), and when applicable, the absorption rate constant (Ka). Application to the classic Theophylline dataset demonstrated PKPy's practical utility, achieving comparable results whether or not initial parameter estimates were provided. The framework successfully estimated population parameters with good model fit (R-2 = 0.933) and automatically identified physiologically plausible covariate relationships. Comprehensive comparisons with existing software packages (Saemix+PKNCA, and simulated comparisons with nlmixr2) revealed PKPy's advantages in computational efficiency, with installation times of 16s versus 96s and analysis times of 13-15s versus 101-102s. While PKPy employs a two-stage approach rather than full nonlinear mixed-effects modeling, it achieved consistent parameter estimates with minimal bias for data-rich scenarios. PKPy leverages Python's scientific computing ecosystem to provide an accessible, transparent platform for pharmacokinetic analysis. The framework's automated approach, support for multiple compartment models, and comprehensive workflow integration demonstrate the potential for reducing barriers to entry in pharmacometric analysis while maintaining scientific rigor.
Keywords:
Population pharmacokinetics
Pharmacometrics
Python

Journal

P
PeerJ
IF:
2.4
Papers:
1.3K
Citations:
4.9W

Organization

S
seoul national university (snu)
Scholars:
7.2W
Papers: 6.6W
Citations: 86