A physiologically-based pharmacokinetic / pharmacodynamic (PBPK/PD) simulation platform for anti-tuberculosis drugs built in PK-Sim® and MoBi® and driven by the esqlabsR R package.
The platform integrates drug-specific PBPK models with a bacterial killing model to simulate Early Bactericidal Activity (EBA) for isoniazid (INH), rifampicin (RIF), pyrazinamide (PZA), ethambutol (EMB), moxifloxacin (MOX), and bedaquiline (BDQ) — as monotherapy and in combination regimens. Simulated EBA trajectories are compared against observed clinical data from published studies.
| Tool | Version | Notes |
|---|---|---|
| R | 4.5.0 | Exact version required by renv |
| Open Systems Pharmacology Suite | 12 | Required only to re-run simulations; not needed to reproduce reports from pre-computed results |
| RStudio (recommended) | any | Or another IDE that supports Quarto |
| Quarto | ≥ 1.4 | For rendering the reports |
git clone https://github.com/esqLABS/Tuberculosis-model.git
cd Tuberculosis-modelOpen the project in RStudio (double-click projects-template.Rproj) and run:
renv::restore()This installs all required R packages at the exact versions recorded in renv.lock.
ProjectConfiguration.xlsx is not stored in the repository but can be regenerated from the committed ProjectConfiguration.json snapshot. Run once after cloning:
esqlabsR::restoreProjectConfiguration()├── Code/
│ ├── workflowConfig.R # User-editable inputs for all workflow steps
│ ├── runTBScenarios.R # Step 4 — run TB regimen scenarios
│ ├── runDoseSensitivity.R # Step 3 — dose–sensitivity analysis
│ └── utils/
│ ├── utils.R # Shared helpers: EBA calculation, plot formatting
│ ├── transformDrugParams.R # Step 1 — convert raw parameter files to Excel
│ └── generateDrugModulePkmls.R # Step 2 — generate drug PKML building blocks
├── Data/
│ ├── EBA_dose.csv # Observed clinical EBA values (digitised)
│ └── originalParameters/ # Raw drug parameter text files (input for Step 1)
├── Documentation/
│ ├── Tuberculosis_workflow.qmd # End-to-end workflow guide (executable Quarto doc)
│ ├── TBModule_ModelDescription.qmd # Mathematical description of the TB disease module
│ └── DRUGModule_ModelDescription.qmd # Mathematical description of the drug PK/PD module
├── Models/
│ ├── PKML/
│ │ └── Modules/
│ │ └── Drug and resistance extension [DRUG].pkml # Generic drug template
│ ├── Simulations/ # Ready-to-run mono and combination regimen PKMLs
│ └── Snapshots/ # MoBi project snapshots
├── Reports/
│ ├── TBScenarios_report.qmd # EBA scenario results report
│ ├── doseSensitivity_report.qmd # Dose–response analysis report
│ └── references.bib # BibTeX references
├── Results/
│ ├── SimulationResults/ # Scenario simulation output CSVs
│ └── Figures/ # Exported PNG plots
├── ProjectConfiguration.json # Committed snapshot of ProjectConfiguration settings
├── projects-template.Rproj # RStudio project file
└── renv.lock # Reproducible R package snapshot
Pre-simulated results are included under Results/, so PK-Sim/MoBi is not required to render the reports.
From the project root:
quarto render Reports/TBScenarios_report.qmd
quarto render Reports/doseSensitivity_report.qmdOr render the full workflow document, which sources all steps in order:
quarto render Documentation/Tuberculosis_workflow.qmdTo re-run scenarios from scratch (requires the OSP Suite):
- Edit
Code/workflowConfig.Rto setloadPreSimulatedResults <- FALSEand adjustoutputFolder. - Open
Documentation/Tuberculosis_workflow.qmdand execute the chunks interactively, or render it directly.
The workflow proceeds in four steps:
| Step | Script | What it does |
|---|---|---|
| 1 | Code/utils/transformDrugParams.R |
Convert raw drug parameter text files to MoBi-compatible Excel |
| 2 | Code/utils/generateDrugModulePkmls.R |
Generate drug-specific PKML building blocks from a template |
| 3 | Code/runDoseSensitivity.R |
Simulate EBA across a dose range for each drug |
| 4 | Code/runTBScenarios.R |
Run all clinical scenario comparisons |
- Add a new scenario in
ProjectConfiguration.xlsx(Scenarios sheet) following the existing entries. - Define a plot grid in the PlotGrid sheet if you want a comparison figure.
- Add the scenario name to
Code/workflowConfig.R(or leavescenariosToRun <- NULLto run all). - Run Step 4 or render the report with
loadPreSimulatedResults <- FALSE.
If you use this platform in your work, please cite the repository:
ESQlabs GmbH. Tuberculosis PBPK/PD Model Platform. GitHub. https://github.com/esqLABS/Tuberculosis-model
A Zenodo DOI for a versioned release will be added here upon publication.
To be added.