Skip to content

Robterheine/simplot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

simplot

A Shiny app for visualising Monte Carlo simulations from pharmacometric models. Drop in NONMEM simulation output, get publication-ready time-profile plots and boxplots with prediction intervals, observed data overlays, customisable reference lines and colour-blind-friendly palettes.

Features

Time-profile tab. Median line with stacked prediction-interval ribbons (e.g. 90% and 95%) computed directly from simulation replicates. Overlay observed data points from a separate file. Log Y-axis toggle.

Boxplot tab. Stratify any continuous outcome (Cmin, Cmax, AUC, trough, etc.) by a categorical grouping variable (dose group, study arm, renal function band, etc.). Configurable whisker definition: Tukey 1.5 × IQR, min–max, 5th–95th percentile, or 10th–90th percentile. Optional outlier points, all-subjects jitter, notched boxes, and adjustable box width. Custom group tick labels with per-group text inputs.

Reference lines. Up to three horizontal dashed reference lines per plot (IC90, MIC, target trough, therapeutic window, etc.) with custom labels in white-backed tags. Slot-based label staggering so labels on nearby lines don't collide.

Filters. Add multiple filter rows (AND-combined). Numeric columns get a range slider, categorical columns get a multi-select. Optionally apply matching filters to the observed dataset as well.

Colour-blind-friendly palettes. Okabe & Ito (2008) categorical colours throughout, proven safe for deuteranopia, protanopia, and tritanopia. Sequential ribbon gradients ramped per anchor colour.

Export. Both plots export to PDF, PNG, or TIFF at user-defined width, height, and DPI. Boxplots include an auto-generated caption describing exactly what the box, whiskers, and any points represent.

Data preview tab. Row counts (raw and filtered), column listing, unique subjects, and the first 30 rows after filtering.

NONMEM-aware file reader. Handles sdtab, simtab, plain CSV, TSV, and tab-delimited files. Strips TABLE NO lines and duplicate headers automatically.

Installation

Requires R (>= 4.0). Install the three runtime dependencies once:

install.packages(c("shiny", "data.table", "ggplot2"))

That's it. No version constraints, no external services, no internet required at runtime. The app runs fully offline behind hospital firewalls.

Running

Clone the repo and launch from R:

shiny::runApp("path/to/simplot")

Or from the command line:

R -e "shiny::runApp('path/to/simplot', launch.browser = TRUE)"

Expected input

Simulation file. Any rectangular file readable as a table. Columns should include a subject identifier (ID, USUBJID, SUBJ, …), an independent variable for time-profile plots (TIME, TAD, …), and the dependent variable(s) of interest (IPRED, DV, CONC, CMIN, CMAX, AUC, …). The app guesses sensible defaults but every column selector is editable.

Boxplot input requirement. One row per subject per group. The app validates this and shows a clear warning with the offending subject if it finds duplicates. Use the filter section to narrow the data, or pick a different Subject ID column.

Observed data file (optional). Same flexible format. Used only to overlay points on the time-profile tab.

License

MIT. See LICENSE.

Author

Rob ter Heine, Radboud University Medical Center, Nijmegen.

About

Shiny app for visualising Monte Carlo simulations from pharmacometric models

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages