Please cite:
Darbalaei, M., Mühlenberg, T., Zummack, J., Dujardin, P., Grunewald, S., Baginska, A., Munteanu, P., Martinez Cruz, M., Dorsch, M., Schramm, A., Bauer, S., Hoffmann, D. & Grüner, B. M. Quantifying Treatment Resistance in Mixtures of Gastrointestinal Stromal Tumor Cells with BARMIX. bioRxiv https://doi.org/10.64898/2026.03.23.713602 (2026).
Bayesian Modeling of Barcoded Tumor Mixtures for Quantitative Treatment Resistance Analysis
barmixR implements a Bayesian framework for analyzing treatment responses in pooled cancer cell populations labeled with genetic barcodes. The method integrates barcode sequencing counts with population size measurements to estimate clone-specific quantitative treatment resistance (QTR) while accounting for uncertainty in both sequencing and population size measurements through a unified Bayesian model.
In multiplexed lineage-tracing experiments, individual cell lines are labeled with unique DNA barcodes and pooled together. The pooled population is exposed to treatments either in vitro or in vivo. Barcode sequencing quantifies the relative abundance of each clone, while measurements of confluency (in vitro) or tumor volume (in vivo) quantify population size dynamics.
barmixR jointly models these data sources in a Bayesian hierarchical framework. Barcode sequencing counts are modeled using a Dirichlet–multinomial distribution to account for compositional sequencing data, whereas population size measurements are modeled using:
- a log-normal likelihood for tumor volume (in vivo)
- a beta likelihood for confluency (in vitro)
Posterior inference is performed using Hamiltonian Monte Carlo implemented in the rstan package, enabling full uncertainty propagation from barcode composition and population size measurements to quantitative treatment resistance estimates.
Population size corresponds to:
- tumor volume in in vivo experiments
- cellular confluency in in vitro assays
barmixR uses Stan models, which require a C++ toolchain.
Install Rtools:
https://cran.r-project.org/bin/windows/Rtools/
Restart R after installation.
xcode-select --installsudo apt install build-essentialInstall the development version from GitHub:
if (!requireNamespace("remotes", quietly = TRUE))
install.packages("remotes")
remotes::install_github("MohammadDarbalaei/barmixR")barmixR relies on the following R packages:
- rstan
- ggplot2
- dplyr
- bayesplot
- loo
- patchwork
- viridis
- BiocParallel
Install required dependencies with:
install.packages(c(
"rstan",
"ggplot2",
"dplyr",
"bayesplot",
"loo",
"patchwork",
"viridis"
))
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("BiocParallel")Fit the barmixR model using barcode count data together with population size measurements.
library(barmixR)
fit <- barmixRQTR(
data = data,
time_d = time_d,
control = list(
chains = 2,
iter_count = 10000,
iter_V = 10000,
cores = 2
)
)A typical barmixR analysis consists of the following steps:
- Fit the Bayesian model
- Perform posterior predictive checks for barcode composition
- Estimate ratios of relative barcode abundance
- Perform posterior predictive checks for population size
- Estimate ratios of population size
- Estimate quantitative treatment resistance
- Visualize resistance landscapes
- Rank treatments
model <- fit
# Posterior predictive checks for barcode composition
ppc_barcode <- ppcBarcodes(model)
sampled_fraction <- ppc_barcode$sampled_fraction
# Relative barcode abundance ratios
ratio_fraction <- fractionRatio(model, sampled_fraction)
# Posterior predictive checks for population size
ppc_population <- ppcPopulation(model)
sampled_population <- ppc_population$sampled_population
# Population size ratios
ratio_population <- populationRatio(model, sampled_population)
# Estimate quantitative treatment resistance
resistance <- QTRresistance(
model,
ratio_fraction$li_sam_ratio_relative,
ratio_population$li_sam_ratio_V
)
# Visualize treatment resistance landscape
heatmap <- QTRheatmap(
model,
resistance$summary_table
)
# Treatment ranking and decision support
decision <- QTRDecision(
model = model,
summary_table = resistance$summary_table
)GPL-3
