--- title: "Bayesian Censored Regression Modeling of 5-HT2A Binding Affinities: Preventing Survivorship Bias in QSAR" format: plos-pdf: number-sections: false journal: id: ploscompbiol author: - name: Christopher Ryan Duguay corresponding: true email: christopher.duguay@university.edu affiliations: - ref: aff1 affiliations: - id: aff1 name: Department of Biostatistics city: City state: State country: USA abstract: | Quantitative Structure-Activity Relationship (QSAR) models for psychedelic 5-HT2A agonists frequently suffer from survivorship bias due to the mishandling of unmeasurable (UM) binding affinities. When laboratory assays fail to detect binding beyond a detection limit (e.g., $K_i > 10,000$ nM), discarding these data points upwardly biases the estimated average binding affinity of chemical classes. In this study, we demonstrate the application of Bayesian Censored Regression using the No-U-Turn Sampler (NUTS) to model the 5-HT2A receptorome of 35 diverse psychedelic compounds originally curated by Ray (2010). By treating unmeasurable affinities as left-censored boundaries ($pK_i \le -4.0$), we construct a highly robust, generative model incorporating weakly informative priors calibrated to the experimental noise limits defined by Kramer et al. (2012). Our results provide exact probabilistic inferences distinguishing the binding profiles of tryptamines, phenethylamines, and lysergamides while robustly penalizing overfitting on small sample sizes. author-summary: | We developed a Bayesian statistical model to predict the binding strength of different psychedelic drugs (like LSD and DMT) to the serotonin 2A receptor. Normally, when a drug is too weak for lab equipment to measure, scientists throw the data away, which mathematically skews the results to look stronger than they actually are. We used "censored regression" to mathematically include these failed tests as boundaries, creating a much more accurate and physically grounded predictive model. bibliography: bibliography.bib execute: echo: false warning: false message: false --- # Introduction The serotonergic 5-HT2A receptor is the primary molecular target responsible for the subjective effects of classical psychedelics, including tryptamines (e.g., psilocin, DMT), phenethylamines (e.g., mescaline, 2C-B), and lysergamides (e.g., LSD) [@Ray2010]. Predicting the binding affinity ($K_i$) of novel compounds using Quantitative Structure-Activity Relationship (QSAR) modeling is a fundamental task in computational neuropharmacology. A persistent methodological flaw in standard QSAR approaches is the mishandling of "Unmeasurable" (UM) data. High-throughput screening assays, such as those conducted by the NIMH Psychoactive Drug Screening Program (PDSP), operate with strict detection limits (typically $K_i > 10,000$ nM). Compounds exceeding this limit are reported as UM. Standard frequentist regression techniques (e.g., Ordinary Least Squares) require exact point measurements. Consequently, statisticians frequently drop UM data points from the dataset (listwise deletion). This practice introduces severe survivorship bias: by only training models on compounds that successfully bind to the receptor, the predicted average binding affinity of any chemical class is artificially inflated. In this manuscript, we present a Bayesian Censored Regression architecture to fully utilize UM data points. By treating detection limits as mathematical boundaries, our model estimates cumulative probabilities rather than exact densities, enabling robust epistemic uncertainty quantification across the entire psychedelic receptorome. # Materials and Methods ## Dataset Curation We utilized the comprehensive receptorome dataset published by Ray (2010), representing $N=35$ psychoactive compounds assayed at the 5-HT2A receptor [@Ray2010]. Binding affinities were converted to logarithmic scale using the standard formulation $pK_i = -\log_{10}(K_i)$. Consistent with the NIMH-PDSP protocol, the $10,000$ nM detection limit translates to a $pK_i$ boundary of $-4.0$. Data preparation was conducted using the `tidyverse` ecosystem in R. True missing data (Not Determined; ND) were listwise deleted, while UM data were assigned the $-4.0$ boundary value and flagged with a binary censoring indicator ("left"). Molecular weights were mean-centered to ensure a highly interpretable model intercept. Tryptamines were established as the baseline reference category. ## Bayesian Censored Regression Models were estimated using the `brms` package via the `cmdstanr` backend, which translates R syntax into C++ for compilation by the Stan probabilistic programming language. Unlike standard Hamiltonian Monte Carlo (HMC), which requires manual tuning of step sizes and trajectory lengths, Stan employs the No-U-Turn Sampler (NUTS). NUTS adaptively tunes these hyperparameters to achieve high computational efficiency. Hoffman and Gelman (2014) demonstrated that NUTS produces nearly independent samples, requiring vastly fewer total iterations than older random-walk algorithms (e.g., Gibbs sampling) to achieve high effective sample sizes (ESS) [@Hoffman2014]. The mathematical formulation of the regression is given by: $$ \text{affinity\_pKi} \,|\, \text{cens}(\text{censored}) \sim \text{weight\_centered} + \text{class\_type} $$ For observations flagged as "left" censored, the Stan likelihood function evaluates the cumulative distribution function (CDF) for probabilities $\le -4.0$, rather than the standard probability density function (PDF). ## Prior Specification We utilized weakly informative, domain-specific priors to regularize the model and prevent overfitting given the $N=35$ sample size. 1. **Intercept:** `normal(-2.0, 1.5)`. The expected baseline affinity (a Tryptamine of average molecular weight) was centered at $-2.0$ $pK_i$ ($100$ nM). A standard deviation of $1.5$ restricts 95% of the expected probability mass between $100,000$ nM (inactive) and $0.1$ nM (super-agonist limits), consistent with the extreme binding profile of 25I-NBOMe [@Braden2006]. 2. **Slopes:** `normal(0, 1)`. A regularizing prior centered at zero to penalize extreme effect sizes. 3. **Residual Variance ($\sigma$):** `exponential(1)`. Variance is strictly positive. An expected mean error of $1.0$ log unit accounts for standard model inadequacy and the inherent experimental noise limit ($0.54$ log units) of heterogeneous public $K_i$ data demonstrated by Kramer et al. (2012) [@Kramer2012]. # Results The model was fit using 4 independent Markov chains. Following the Stan default recommendations, we ran 2,000 total iterations per chain, with the first 1,000 discarded as warmup, yielding 4,000 independent posterior draws. ```{r} #| label: data-prep #| include: false library(tidyverse) library(brms) library(tidybayes) library(ggdist) library(modelr) chem_data <- read_csv("psychedelic_receptorome.csv") %>% mutate( weight_centered = molecular_weight - mean(molecular_weight), class_type = fct_relevel(factor(chemical_class), "Tryptamine", "Phenethylamine", "Lysergamide", "Iboga Alkaloid") ) ``` ```{r} #| label: model-fit #| include: false #| cache: true model_formula <- bf(affinity_pKi | cens(censored) ~ weight_centered + class_type) custom_priors <- c( prior(normal(-2.0, 1.5), class = "Intercept"), prior(normal(0, 1), class = "b"), prior(exponential(1), class = "sigma") ) model_fit <- brm( formula = model_formula, data = chem_data, family = gaussian(), prior = custom_priors, chains = 4, iter = 2000, warmup = 1000, cores = 4, seed = 42, backend = "cmdstanr" ) ``` ## Epistemic Uncertainty and Posterior Predictions By drawing directly from the expected posterior prediction (`.epred`), we can visualize the model's confidence in the average binding affinity across the molecular weight continuum. ```{r} #| label: fig-trendline #| fig-cap: "Expected Average 5-HT2A Binding Affinity ($pK_i$) mapped across molecular weight and chemical classes. Shaded ribbons represent 50%, 89%, and 95% credible intervals." reference_grid <- chem_data %>% data_grid( weight_centered = seq_range(weight_centered, n = 100), class_type ) reference_grid %>% add_epred_draws(model_fit) %>% ggplot(aes(x = weight_centered, y = .epred, color = class_type, fill = class_type)) + stat_lineribbon(.width = c(0.50, 0.89, 0.95), alpha = 0.25) + geom_point(data = chem_data, aes(y = affinity_pKi), alpha = 0.4) + theme_minimal() + labs( title = "5-HT2A Binding Affinity Posterior Predictions", x = "Centered Molecular Weight", y = "Predicted Affinity (pKi)" ) ``` ## Exact Probabilistic Inference Unlike frequentist $p$-values, which evaluate the probability of the data given a null hypothesis, our Bayesian architecture extracts exact parameter probabilities from the posterior distributions. ```{r} #| label: probabilistic-inference #| echo: true posterior_draws <- model_fit %>% spread_draws(b_class_typePhenethylamine, b_class_typeLysergamide) %>% mutate(diff_phen_vs_lys = b_class_typePhenethylamine - b_class_typeLysergamide) directional_prob <- posterior_draws %>% summarize(prob_phen_stronger_than_lys = mean(diff_phen_vs_lys > 0)) directional_prob ``` As demonstrated, the model provides an exact probabilistic calculation measuring the comparative binding affinities between the chemical classes, allowing researchers to evaluate compound efficacy directly without arbitrary significance thresholds. # Discussion The application of Bayesian Censored Regression using Stan represents a significant methodological improvement over traditional QSAR frameworks for psychedelic neuropharmacology. By mathematically interpreting assay detection limits as left-censored boundaries, our model completely eliminated the survivorship bias that plagues datasets containing "Unmeasurable" compounds. Furthermore, integrating weakly informative priors derived directly from standard pharmacological limits (e.g., Kramer et al.'s experimental noise parameters) prevented the model from overfitting to the $N=35$ sample size. This approach ensures that the resulting probability distributions remain grounded in the physical reality of the 5-HT2A receptor. Future work will expand this architecture by porting the fundamental mathematical structures into high-performance C++ backends, utilizing a `LogisticPolyaGammaKernel` to drastically accelerate Markov Chain Monte Carlo sampling for massive, multi-receptor pharmacological datasets.