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:
| 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 4: Set Simulation Parameters
In the Simulation Parameters accordion panel:
Duration: Set the simulation duration and unit
(seconds through months)
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:
The Run Simulation button becomes enabled (it
remains disabled until all required inputs are valid)
Click Run Simulation to execute the DDI
simulation
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:
- Select “Upload Compound” from the compound dropdown
- Click “Browse…” to select a JSON snapshot file
- The snapshot can contain:
- Compound definitions
- Formulations
- Protocols
- 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:
| 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
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
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.