Introduction

The ctsApp package provides a graphical user interface (Shiny app) for the cts (Contraceptives DDI Trial Simulation Platform) package. It offers an intuitive web-based interface to design and simulate drug-drug interactions (DDI) involving contraceptive drugs using physiologically based pharmacokinetic (PBPK) models.

Key Features

  • Import and explore compound models from the OSP (Open Systems Pharmacology) model library
  • Design DDI simulations between object and precipitant compounds
  • Configure dosing protocols (oral, IV bolus, IV infusion)
  • Define population parameters and individual characteristics
  • Overlay ethinylestradiol and a midazolam CYP3A reference alongside the object
  • Run simulations and analyze results with interactive plots
  • Translate exposure into contraceptive efficacy endpoints (Pearl Index, Ovulation Rate)
  • Export simulation results for further analysis in PK-Sim

A companion document

This guide explains how to use the application. A second document, the Audit Manual, explains what the application does behind the interface: which inputs are fixed, which values it fills in automatically, and every calculation it performs itself. Read it before quoting any number from the app in a report. Both manuals are linked from the About tab.

Installation

You can install the development version of ctsApp from GitHub:

# install.packages("pak")
pak::pak("esqLABS/ctsApp")

Launching the Application

To start the application, run:

ctsApp::run_app()

This will open the application in your default web browser.

User Interface Overview

The ctsApp interface consists of two main areas.

Main Content Area

The main area contains three tabs, plus links in the navigation bar:

Tab Description
Experiment Design Summary of all configured parameters with demographic visualizations
Results Simulation results with PK profiles, DDI analysis, and PK-PD analysis
About Application description, links to both manuals, and version numbers

Results are pre-filled when you open the app

The Results tab is already populated when the application starts, using results saved from an earlier run that ship with the package. Those results do not necessarily correspond to the settings shown in the sidebar. Press Run Simulation before reading or reporting any number. The Audit Manual documents this behaviour in detail.

Workflow Guide

Step 1: Configure the Object Compound

In the Object accordion panel:

  1. Select Compound: Choose the object compound from the dropdown. Available options are:
    • Drospirenone (default)
    • Levonorgestrel
  2. Select Protocol: Choose a predefined dosing protocol or create a new one:
    • Predefined protocols (e.g., “DRSP_3mg 21 days”)
    • “Create New Protocol” to define custom dosing
  3. Select Formulation: Choose a formulation type:
    • Predefined formulations (e.g., “DRSP oral tablet”)
    • “Create New Formulation” for custom formulations

Only the protocols and formulations that belong to the selected compound are offered. To use a dose that is not in the predefined list, use “Create New Protocol”.

Ethinylestradiol (EE)

Model Ethinylestradiol (EE) effects is ticked by default. Most combined oral contraceptives pair the progestin with ethinylestradiol, and EE is itself a CYP/UGT and transporter substrate, so its own exposure can shift under a precipitant. When the box is ticked, an Ethinylestradiol Settings block appears with its own protocol and formulation selectors.

EE is co-administered in both simulated scenarios, with and without the precipitant, because it travels with the contraceptive. The baseline is therefore “object plus EE”, not the object alone.

Midazolam (CYP3A) reference

Model Midazolam (CYP3A) reference is also ticked by default. Midazolam is the standard sensitive CYP3A index substrate, and the overlay lets you read the object’s exposure change against a well-characterised probe rather than in isolation. Its protocol defaults to the object’s schedule so that its later doses fall inside the induction window.

This reference is display only. It adds a curve you can switch on in the concentration-time plots, and it never affects the value boxes, the DDI ratios, or the PK-PD endpoints. It does cost extra simulation time, so untick it if you do not need it.

Step 2: Configure the Precipitant Compound

In the Precipitant accordion panel:

  1. Select Compound: Choose the precipitant compound:

    • Select from the available compounds (Rifampicin is selected by default, as a strong CYP3A4 inducer)
    • “Upload Compound” to import a custom compound snapshot (.json)
  2. Select Protocol: Choose or create a dosing protocol

  3. Select Formulation: Choose or create a formulation

Step 3: Configure the Population

In the Population accordion panel:

  1. Select Population: Choose from the available population presets (e.g., “Healthy Women”, “Overweight Women”, “Class I Obese Women”, “Class II Obese Women”)

  2. Number of Individuals: Set the number of virtual individuals (1-100, default 10). Note that higher numbers require more memory and increase simulation time.

  3. Age Range: Define the age range for the population (default 20-60 years). The range resets to the default whenever you change the population preset.

  4. Physical Parameters: Depending on the preset, configure either:

    • BMI range, which is constrained to the preset’s own BMI band, or
    • Height and Weight ranges
  5. SHBG: The sex hormone binding globulin distribution (geometric mean and geometric standard deviation) is pre-filled from the selected preset and can be adjusted.

All populations are entirely female by construction, and the population sampling uses a fixed random seed, so identical settings always produce the same virtual individuals.

Step 4: Set Simulation Parameters

In the Simulation Parameters accordion panel:

  1. Duration: Set the simulation duration and unit (seconds through months)

  2. Resolution: Set the number of time points per hour (default 1)

The duration is set automatically. Whenever a protocol changes, the app rewrites the Duration and Unit fields to match the longest administration window of the object and precipitant protocols, choosing a sensible unit and rounding to a whole number. This keeps the simulation on-treatment, because the PK-PD endpoints are read from the last dosing interval. If you type your own duration and then change a protocol, your value will be replaced. A warning appears on the PK-PD tab if the simulation runs past the end of contraceptive administration.

Step 5: Run the Simulation

Once all parameters are configured:

  1. The Run Simulation button becomes enabled (it remains disabled until all required inputs are valid)

  2. Click Run Simulation to execute the DDI simulation

  3. The simulation creates two scenarios:

    • Single Simulation: object compound alone (plus EE if enabled)
    • DDI Simulation: object plus precipitant (plus EE if enabled)

    With the midazolam reference enabled, two further display-only simulations are run: midazolam alone and midazolam plus the precipitant.

Step 6: Analyze Results

After the simulation completes, navigate to the Results tab to view:

Pharmacokinetics Tab

  • Concentration-time profile for the object compound (with and without precipitant)
  • Value boxes for Cmax, tmax and AUC, each shown as the median with the 5th to 95th percentile range across individuals
  • Toggles to show the precipitant, ethinylestradiol, and the midazolam reference
  • A log-scale switch and a concentration unit selector (pg/mL, ng/mL, µg/mL)
  • Interactive Plotly charts with zoom and pan capabilities

All concentrations and exposure metrics are total plasma concentrations (bound plus unbound) in peripheral venous blood, which is what clinical pharmacokinetic studies usually report.

PK-DDI Analysis Tab

  • DDI ratio calculations
  • Comparison of PK parameters (AUC, Cmax, tmax) between scenarios
  • Visual representation of drug interaction effects

PK-PD Analysis Tab

Translates the simulated object exposure into two contraceptive efficacy endpoints:

  • Pearl Index: unintended pregnancies per 100 woman-years
  • Ovulation Rate: percentage of women expected to ovulate

Each panel compares the object alone against the DDI scenario. Markers show the population median and the bars span the 5th to 95th percentile across individuals.

This tab is only available when:

  • the object is Drospirenone or Levonorgestrel, and
  • the object protocol uses repeated dosing (the endpoints are derived from the average concentration over the last dosing interval, which a single dose does not define).

The percentile bars reflect the spread of exposure across individuals only. They do not include uncertainty in the underlying exposure-response parameters. See the Audit Manual before interpreting them.

Advanced Features

Uploading Custom Compound Snapshots

For the precipitant compound, you can upload custom compound models:

  1. Select “Upload Compound” from the compound dropdown
  2. Click “Browse…” to select a JSON snapshot file
  3. The snapshot can contain:
    • Compound definitions
    • Formulations
    • Protocols
  4. Imported items are automatically added to the available options

Uploaded compounds are added to the current session only; the packaged model file is never modified. Because an uploaded compound has no predefined protocol or formulation list, all protocols and formulations in the session are offered for it, including ones meant for other compounds.

Creating Custom Protocols

When “Create New Protocol” is selected:

Parameter Description
Dose Dose amount and unit (mg, g)
Type Oral, Intravenous Bolus, or Intravenous
Interval Single dose, once/twice/thrice/four times daily
Start Time When dosing begins
End Time When dosing ends

For oral administration: - Water Volume/Body Weight: Volume of water co-administered

For IV administration: - Infusion Time: Duration of infusion

Creating Custom Formulations

When “Create New Formulation” is selected, choose from:

Type Description
Dissolved Immediate release, fully dissolved
Weibull Weibull dissolution kinetics
Lint80 Linear dissolution to 80%
Particle Particle-based dissolution (mono/polydisperse)
Table Custom dissolution profile via time-fraction table
Zero Order Constant release rate
First Order Exponential release kinetics

Each formulation type has specific parameters to configure.

Exporting Results

Export DDI Snapshot

Click Export Snapshot to download a JSON file containing:

  • All compound configurations
  • Protocol definitions
  • Formulation settings
  • Population parameters
  • Simulation settings

This snapshot can be: - Imported into PK-Sim for further analysis - Shared with collaborators - Used as a starting point for future simulations

The export captures the inputs, not the results. Record the version numbers shown on the About tab alongside it.

Troubleshooting

Buttons are disabled

The Run Simulation and Export Snapshot buttons are disabled when:

  • Required inputs are missing or invalid
  • Population parameters are out of valid ranges
  • Custom protocol/formulation inputs are incomplete

Check all accordion panels to ensure all required fields are properly configured.

The PK-PD tab is empty or shows a message

Pearl Index and Ovulation Rate are available for Drospirenone and Levonorgestrel only, and require a repeated-dose object protocol. With a single-dose protocol the tab explains this; with any other object compound it renders empty.

The duration I typed keeps changing

That is expected: the duration is recalculated from the protocol administration window whenever a protocol changes. Set the protocols first, then adjust the duration if you need to.

Results appear before I run anything

The application ships saved results and shows them at startup. Press Run Simulation to replace them with results that match your settings.