apmx

Automated Approach to PK and PKPD Dataset Assembly

Description

This repository contains several R functions to support the assembly of PK(PD) datasets to be used in NONMEM. The functions will create a PK(PD) dataset with consistent column names and covariate labels. Additional functions are used to support covariate analysis, combine datasets to form a population dataset, and create dataset definition files to support regulatory submissions.

Instructions for Use

Download the Repository onto your Computer

The latest CRAN release can be installed with the following commands:

install.packages("apmx")
library(apmx)

The current development package can be downloaded from GitHub with the following commands:

devtools::install_github("stephen-amori/apmx")
library(apmx)

Function summary

pk_build()

pk_build() creates a PK(PD) dataset for analysis in NONMEM from source data. The functions is not intended to produce datasets for NCA.
The function automatically maps CDISC terminology to a uniform variable name (apmx name) appropriate for pharmacometric analysis.
The function issues a variety of warnings and errors to inform the user of problematic subjects and records.

General comments:

apmx attribute names and definitions:

apmx derived attribute names and definitions:

apmx derived binary flag names and definitions:

pk_combine()

pk_combine() will combine two PK(PD) datasets built by pk_build() to form a population dataset.
All categorical covariates are re-calculated to ensure they are consistently labeled throughout the population analysis.
The function confirms the analytes and compartments are in agreement between both studies.

cov_find()

cov_find() will identify the columns in a PK(PD) dataset that belong to a certain covariate class.
Covariates can be "categorical", "continuous", "exposure", "empirical bayes estimate", or "other".
Types can be "numeric" or "character".

cov_apply()

cov_apply() will add additional covariates to a PK(PD) dataset already built by pk_build().
It can apply covariates of any type, either subject-level or time-varying.
Covariates can be merged by any ID variable (USUBJID, SUBJID, or ID) or any time variable (ATFD, ATLD, NTFD, NTLC, NTLD, NDAY, TPT).
The same prefix and suffix system is applied to covariates built with cov_apply()

pk_write()

pk_write() will write out a PK(PD) dataset as a .csv file to the filepath of your choice in a NONMEM-ready format.

pk_define()

pk_define() will create a definition file for a PK(PD) dataset built by pk_build(). It can be produced as a data frame in R or exported as a Word document. The function requres a dataset and a list of variable definitions. For more information on this list, refer to variable_list_create().

Other arguments:

pk_summarize()

pk_summarize() will create summary tables (BLQ, categorical covariates, and continuous covariates) of the dataset created by pk_build() or pk_combine().
Summary tables can be exported as .csv files, .docx files, and/or .pptx files. They can be stratified by any variable in the dataset. You can filter the dataset prior to summary statistics.

version_log()

version_log() will create a version log of datasets created by pk_build() or pk_combine(). The first time you call the function, it will create an initial entry. You can export the version log as a Word document. Then, after you create a new, updated dataset, you can call the version_log() again. If you provide the filepath to the current version log, the new dataset, and the old dataset, the version log will add the new dataset and provide a brief summary comparison of the two.

variable_list_create()

variable_list_create() is a helper function for pk_define() that creates a standard variable list. The standard apmx variable names and definitions are already included. You can add your own variables (custom covariates, etc.) so they are included in the definition file.

Future Development

In addition to bug fixes and runtime improvements, future functions will focus on the following areas:

Authors and Acknowledgements in Alphabetical Order

Mildred Afoumbom
Joyceline Afumbom
Stephen Amori
Ethan DellaMaestra
Michael Dick
Ekiti Ekote
Daniel Litow
Jonah Lyon