2023 - A Coruña - Spain

PAGE 2023: Methodology - Other topics
Stephen Amori

apmx: an open-source R package for automated PK and PKPD dataset assembly

Stephen Amori (1), Ethan DellaMaestra (1), Daniel Litow (1), Jonah Lyon (1), Nidal Huniti (1)

(1) Amador Bioscience

Introduction: Several NONMEM [1] tools have been developed in recent years in R to support PK and PKPD analyses [2], [3]. However, there are few open-source R packages dedicated to creating datasets from clinical trial data for analysis in NONMEM. Manual creation of analysis datasets takes considerable time and is prone to mistakes. The potential for error is compounded in datasets for population analyses, which often incorporate multiple trial designs, use different source data formats, and are built by multiple scientists. A uniform method for dataset assembly and documentation is required for scientists to collaborate on a single analysis and produce accurate, reproducible results. Consistent dataset specifications are also essential for downstream automation. 

Objectives: Create a package of R functions, apmx [4], to accomplish the following tasks:

  • Assemble reproducible population PK and PKPD datasets for analysis in NONMEM from experimental data
  • Identify individual records and dataset specifications that will prevent successful estimation in NONMEM
  • Automate the production of dataset documentation to support regulatory submissions

Methods: The package leverages the data standards for clinical data established by CDISC [5] and ISO [6] for simplified assembly from SDTM and ADaM datasets. The functions also accept data arguments from non-CDISC standardized data to support pre-clinical, pre-processed, or real-world data. Dataset assembly functions are built with the assistance of dplyr [7] and tidyr [8] R packages, and documentation functions primarily depend on the flextable [9] and officer [10] packages.

Results: The following functions in apmx were created and validated in R to support dataset assembly and documentation:

  • pk_build: builds a single PK or PKPD dataset from dose events, various PK and PD endpoints, and covariates to support analysis in NONMEM. Covariates are automatically detected as categorical or continuous. The function can handle the imputation of missing event times in multiple ways, depending on user input. The function issues warnings and flags for problematic records that will prevent successful model estimation in NONMEM [11].
  • pk_combine: combines study-level NONMEM datasets into a single population dataset and ensures key variables are programmed consistently between studies.
  • cov_apply: applies additional covariates to a NONMEM dataset produced by pk_build. Covariates are joined either at the subject level or time-varying. Time-varying covariates can be filled by date-time, cumulative actual time, or cumulative nominal times.
  • cov_find: identifies categorical or continuous covariates in a NONMEM dataset produced by pk_build.
  • pk_write: publishes the NONMEM dataset to a pre-specified file path as a .csv file.
  • pk_define: publishes the dataset definition file of the NONMEM dataset produced by pk_build as a .docx file. Definitions are pulled from a global variable list maintained by the user. The table of definitions are added to a template document pre-specified by the user.

Conclusions: apmx successfully creates reproducible population PK and PKPD analysis datasets in R for analysis in NONMEM. These datasets have been successfully used in NONMEM to generate PK and PD parameter estimates. Dataset definition files are automatically developed for instantaneous and consistent documentation. apmx is still under active development, pending CRAN approval. Future developments will expand the scope of the automated flags and warnings for problematic records. Future developments will also support dataset assembly for different analyses, including QTC prolongation and TTE.



References:
[1] Bauer, R (2019). NONMEM Tutorial Part I: Description of Commands and Options, With Simple Examples of Population Analysis. CPT Pharmacometrics Syst. Pharmacol. (2019) 8, 525–537.
[2] Lindbom L, Pihlgren P, Jonsson EN. PsN-Toolkit--a collection of computer intensive statistical methods for non-linear mixed effect modeling using NONMEM. Computer Methods Programs Biomed. 2005 Sep;79(3):241-57.
[3] Fidler M, Xiong Y, Schoemaker R, Wilkins J, Trame M, Hooijmaijers R, Post T, Wang W (2022). nlmixr: Nonlinear Mixed Effects Models in Population Pharmacokinetics and Pharmacodynamics. R package version 2.0.7, https://CRAN.R-project.org/package=nlmixr.
[4] https://github.com/stephen-amori/apmx
[5] CDISC CDASH Team (2022). Clinical Data Acquisition Standards Harmonization Implementation Guide for Human Clinical Trials Version 2.2. CDISC.
[6] (2004). ISO 8601: Data elements and interchange formats - information interchange - representation of dates and times. ISO.
[7] Wickham H, François R, Henry L, and Müller K (2022). dplyr: A Grammar of Data Manipulation. R package version 1.0.9. https://CRAN.R-project.org/package=dplyr
[8] Wickham H and Girlich M (2022). tidyr: Tidy Messy Data. R package version 1.2.0. https://CRAN.R-project.org/package=tidyr
[9] David Gohel and Panagiotis Skintzos (2023). flextable: Functions for Tabular Reporting. R package version 0.8.6. https://CRAN.R-project.org/package=flextable
[10] David Gohel (2023). officer: Manipulation of Microsoft Word and PowerPoint Documents. R package version 0.6.0. https://CRAN.R-project.org/package=officer
[11] Owen, J.S. and Fiedler-Kelly, J. (2014). Introduction to Population Pharmacokinetic/Pharmacodynamic Analysis with Nonlinear Mixed Effects Models. John Wiley & Sons, Inc.


Reference: PAGE 31 (2023) Abstr 10619 [www.page-meeting.org/?abstract=10619]
Poster: Methodology - Other topics
Top