To complement the interactive visualizations provided by the Binding Curve Viewer, three R Shiny applications are available for Monte Carlo simulation and parameter estimation. These apps allow users to assess how experimental noise and measurement errors propagate into the uncertainty of fitted binding parameters, and to evaluate the statistical distribution of estimated values across a large number of simulated experiments.
All three apps share a consistent design: theoretical binding data are generated under user-specified conditions, Gaussian noise is added to simulate experimental uncertainty, and non-linear least-squares fitting is performed on each simulated dataset. The distributions of fitted parameters across all experiments are visualized as histograms with overlaid normal distributions, and Kolmogorov–Smirnov (KS) tests are used to assess whether the fitted parameters follow a normal or log-normal distribution.
The following R packages are required:
install.packages(c("shiny", "bslib", "ggplot2", "minpack.lm", "KSgeneral"))
Each app can be launched in two modes. In server mode (the default), the number of simulated experiments is restricted to 1,000 to limit server load. In local mode, this restriction is lifted and all options are available:
# Server mode
Rscript -e "shiny::runApp('app.R')"
# Local mode (no restriction on number of experiments)
BINDING_APP_LOCAL=true Rscript -e "shiny::runApp('app.R')"
File: kd-sim/app.R
This app simulates equilibrium binding experiments designed to determine the dissociation constant Kd of a protein–ligand interaction. Noisy [PL] measurements are generated at a series of ligand concentrations under user-specified conditions, with options to include concentration measurement errors for both [P]total and [L]total (modeled as Gaussian noise proportional to the respective nominal concentration). Each simulated experiment is fitted independently using two models:
Formula 1 (Exact): the full quadratic binding equation, which accounts for ligand depletion and is valid under any [P]total-to-Kd ratio.
Formula 2 (Approximate): the simplified hyperbolic model, valid when [P]total ≪ Kd so that [L]free ≈ [L]total.
Both models estimate Kd and [P]total simultaneously via Levenberg–Marquardt non-linear least-squares fitting. The app reports the mean ± SD of fitted Kd and [P]total across all experiments, together with KS test p-values for both linear and log-transformed distributions.
Key parameters: number of simulated experiments, number of ligand concentrations per experiment, replicates per concentration, [PL] noise SD, [P]total noise SD, [L]total noise SD, and random seed.
File: kin-sim/app.R
This app simulates binding kinetics experiments to estimate the association rate constant kon and the dissociation rate constant koff. Time-course data for association and dissociation are generated across multiple ligand concentrations using the exact second-order binding equations, with additive Gaussian noise. The simulation pipeline follows a committed-parameter design: all association and dissociation noise is pre-generated in a single bulk random draw before fitting begins.
Fitting is performed using three approaches:
Dissociation experiment: koff is estimated by fitting the multi-group exponential decay model to the dissociation time course.
Second-order binding equation: kon is estimated from the association time course using the exact second-order kinetic model, with koff fixed to the value obtained from the dissociation fit.
Pseudo-first-order binding equation: kon is estimated from the same association time course using the pseudo-first-order approximation, again with koff fixed.
For each simulated experiment, the kinetic Kd is computed as koff / kon. The app reports mean ± SD and KS test results for koff, kon, and Kd from both association models.
Key parameters: number of simulated experiments, number of ligand concentration groups, replicates per time point, number of time points per experiment, [PL] noise SD, and random seed.
File: comp-sim/app.R
This app simulates competitive binding experiments in which an inhibitor displaces a ligand from the protein, and estimates both the apparent IC50 and the true inhibitor dissociation constant Ki. Equilibrium [PL] values at a series of inhibitor concentrations are computed using the exact cubic solution (FEBS Lett. 1995, 360, 111–114), and Gaussian noise is added to simulate experimental variability. Measurement errors in [P]total, [L]total, and [I]total concentrations can each be independently specified as a fractional coefficient of variation.
Two fitting models are applied to each simulated dataset:
Logistic model (4-parameter): the apparent IC50 (the total inhibitor concentration at 50% inhibition) is extracted from the midpoint parameter of a 4-parameter logistic curve.
Mechanistic model (Wang equation): Ki is estimated directly by fitting the competitive binding cubic equation (Anal. Biochem. 2004, 332, 261–273) to the [PL]-versus-[I]total data.
The app additionally converts each experiment’s fitted apparent IC50 to an approximate Ki using the Cheng–Prusoff equation (Biochem. Pharmacol. 1973, 22, 3099–3108) and reports the mean ± SD across all experiments.
Key parameters: number of simulated experiments, number of inhibitor concentrations per experiment, replicates per concentration, [PL] noise SD, [P]total / [L]total / [I]total noise SD, and random seed.