An R-based workflow for clinical trial simulation tool with application in type 1 diabetes studies
Authors: Cui Zihan , Zhang Yi , Kosinski Luke , Hedrick Joseph , Collins Kimberly , Xu Qiushuang (Rachel) , Quinlan Lauren , Ma Shu Chin 
Published: February 2025

Objectives: Clinical Trial Simulation (CTS) tools can provide a platform to showcase the results of disease progression models (DPM) and assist in trial design by visualizing and exploring disease trajectories. An automated workflow for CTS tool generation can streamline the development process, encourage model exploration, and promote adherence to rigorous software development life cycle (SDLC) practices. It also fosters collaboration between scientists and software developers through modularization. This project's objective is to design and implement a workflow in the form of an R package that promotes good SDLC practices in DPM and Shiny app package creation, and to apply this package to the development of a CTS tool for Type 1 Diabetes (T1D) studies. Methods: The workflow consists of two components: generation of an S3 object to store a DPM as a set of structured equations and fixed/random effects parameters, and to create a Shiny app for DPM exploration and trial design. The first component aims to empower scientists with model verification and exploration while the second component enables developers to focus on Shiny app user interface (UI) design, integration, and deployment, using the first component as the computation kernel in the “server” of the Shiny app. The output of the two components can also be exported to R packages: a DPM package that contains the S3 object as a standalone CTS tool that can simulate disease progression with a user supplied population, and a DPM Shiny app package that allows the developer to focus on UI and deployment. When applied to T1D tool development, the workflow is refined according to feedback from the scientist, developer, and clinicians.Results: This two-component process enables scientists to quickly port, test, and explore non-linear mix effect models from NONMEM, and developers to focus on UI and deployment. It can improve both the Shiny app development process and scientific rigor. The pilot project for the T1D DPM incorporates C-peptide[1] and HbA1c as endpoints, integrating relevant sources of variability such as age at diagnosis, BMI, and baseline endpoint values. Data were supplied from the National Institute of Diabetes and Digestive and Kidney Disease Central Repository, industry, and academia. Scientists can provide functions and parameters for the T1D DPM to generate the initial Shiny app. Subsequently, this can be further evaluated by software developers and clinicians for further refinement towards finalizing the CTS tool.Conclusions: This automated workflow facilitates deliverance of a T1D DPM CTS tool for observing C-peptide and HbA1c outcomes with user controllable predictors such as baseline age, disease duration, age, and sex. The modular development process shortens SDLC and improves the deliverable quality. This proves that the workflow and the accompanying package aids scientists and developers in streamlining the design of Shiny apps.Citations: [1] Palmer, J. P. et el., 2004. C-Peptide Is the Appropriate Outcome Measure for Type 1 Diabetes Clinical Trials to Preserve β-Cell Function: Report of an ADA Workshop, 21–22 October 2001. Diabetes, 53(1), 250–264.