ISB-N001 Computational chemistry QSAR · intermediate

Honest QSAR Models Start With the Assay, Not the Algorithm

Notes on an Optibrium webinar: curate the assay, match the method to the noise, score the test set once, plot instead of R², and respect the applicability domain.

Author
Published · updated
Reading time 9 min

First published on yboulaamane.github.io on ; revised for InSilicoBench on . Status: in technical review.

A QSAR number is a decision about a compound that has not been made yet. The useful part of Optibrium’s webinar is the order that keeps that number honest: curate the assay, choose a regression or a class the noise can support, hold out a test set that is scored once, and look at the plot rather than at R2R^2. Clearance is the property where that order can still be the wrong model, because one measured number is several biological mechanisms.

Tamsin Mansley and Mario Öeren gave the webinar on 18 February 2025 [1]. Mansley is President of Optibrium Inc. and Global Head of Application Science. Öeren is a Principal Scientist there. The demonstration is StarDrop’s Auto-Modeller on a public ChEMBL set. The order does not belong to the software.

The recording is on YouTube: How to build a better QSAR model (opens youtube.com).

What is worth predicting

In a multi-parameter optimization the potency model is one column. Solubility, log⁡P\log P or log⁡D\log D, permeability, clearance, and an off-target liability are the others, and a compound fails the project by failing one of them. A model is there to remove compounds before they are made, not to replace the assay that will be run on the ones that remain.

Three situations are where Mansley says the model stops being the right tool [1].

Three places where a QSAR model is the wrong toolThree boxes. Clearance: many mechanisms (enzymes, binding, flow, conjugation) behind one number. Promiscuous target: almost every compound scores as active, so there is no inactive class and accuracy learns nothing. Applicability domain: a model trained on one series and used on another; the fit does not travel.Many mechanismsClearanceenzymes, binding,flow, conjugationOne number, several causesNo inactive classPromiscuous targetalmost every compoundscores as activeAccuracy learns nothingWrong chemistryApplicability domaintrained on one series,used on anotherThe fit does not travel
Three places where a QSAR model is the wrong toolThree boxes. Clearance: many mechanisms (enzymes, binding, flow, conjugation) behind one number. Promiscuous target: almost every compound scores as active, so there is no inactive class and accuracy learns nothing. Applicability domain: a model trained on one series and used on another; the fit does not travel.Many mechanismsClearanceenzymes, binding, flow, conjugationOne number, several causesNo inactive classPromiscuous targetalmost every compound scores as activeAccuracy learns nothingWrong chemistryApplicability domaintrained on one series, used on anotherThe fit does not travel
Figure 1.Each box is a different failure. More descriptors do not fix a label that mixes mechanisms, a dataset with one class, or a question outside the chemistry the model saw.

In vivo clearance is the first. The number can move because of hepatic blood flow, plasma protein binding, uptake, several cytochrome P450 isoforms, or a conjugation. A fingerprint model is being asked to learn all of those from the structure of the parent compound. A promiscuous target is the second: if nearly every tested compound is active, there is no inactive class, and a classifier that says “active” for everything looks accurate. The third is distance. A model fit on one series degrades on chemistry it has not seen. That limit is the applicability domain, and Optibrium treats it as one of the checks a model has to pass, not as a footnote [2].

For a cytochrome P450 project those three boxes are easy to confuse. An assay of one isoform, a KiK_i or an IC50\mathrm{IC}_{50} against CYP3A4 or CYP2D6, is a single biochemical question. Human clearance, or even a microsomal clearance that several enzymes can produce, is not. The webinar’s advice is to notice which label is in the column before trusting the fit. StarDrop’s own ADME module keeps them separate: isoform affinities on one line, a human-liver-microsome clearance category on another [3].

Four pillars

Öeren’s half of the webinar is the build, in an order [1]. Optibrium has also written the same discipline as four pillars: clean data, an appropriate method, validation with the right metrics, and the domain of applicability [2]. The domain is the bar under the other three. A careful split of the wrong chemical space is still the wrong chemical space.

Four steps in order, on top of the applicability domainFour boxes joined by arrows: 1 Curate (conflicts out, units consistent), 2 Method (regression or a class, then the algorithm), 3 Split (tune on validation, test set once), 4 Metric (plot plus RMSE, not R squared alone). A bar under all four reads: Applicability domain, the chemistry this model is allowed to speak about.01Curateconflicts out,unitsconsistent02Methodregression or aclass, then thealgorithm03Splittune onvalidation, testset once04Metricplot plus RMSE,not R² aloneApplicability domainthe chemistry this model is allowed to speak about
Four steps in order, on top of the applicability domainFour boxes joined by arrows: 1 Curate (conflicts out, units consistent), 2 Method (regression or a class, then the algorithm), 3 Split (tune on validation, test set once), 4 Metric (plot plus RMSE, not R squared alone). A bar under all four reads: Applicability domain, the chemistry this model is allowed to speak about.01Curateconflicts out, units consistent02Methodregression or a class, then the algorithm03Splittune on validation, test set once04Metricplot plus RMSE, not R² aloneApplicability domainthe chemistry the model may speak about
Figure 2.The algorithm is the second box. It cannot repair a dirty assay, a test set that was used to pick the model, or a compound outside the training chemistry.

Curate the column

A smaller clean set beats a larger noisy one. The work is resolving rows that disagree: different units, a KiK_i and an IC50\mathrm{IC}_{50} in the same column, duplicates with different values, a qualifier (<, >) treated as a point. ChEMBL will hand you the rows. It will not decide which of two conflicting KiK_i values is the one to fit. The ChEMBL curation note is that sorting, for bioactivity tables in general.

Dataset size chooses the kind of model, not just the confidence interval. A large set can support a global model on fast 2D descriptors or fingerprints, meant to cover many series. A small set, one series, is a local model. If the local set is too small for a statistical fit, Öeren’s alternative is a physics-based descriptor, such as a docking score, rather than a fingerprint asked to invent a trend from twenty compounds [1]. No cutoff for “large” is a law. The question is whether the table contains enough distinct chemistry for the pattern you want to claim.

Match the method to the noise

If the assay is too noisy for a continuous fit, binning into active and inactive can still produce a filter. The filter answers “worth making?”, not “what is the KiK_i?”. That is a different model, and it should be reported as one.

Auto-Modeller fits several methods and keeps the one that wins on the validation set. The webinar discusses decision trees, random forests, and Gaussian processes [1]. The module also offers partial least squares and radial basis functions [4]. The point of trying more than one is that the validation score, not habit, picks the method. A random forest is not the right answer because it was the right answer on the demonstration set.

Split, then do not look

The split they recommend is 70% training, 15% validation, 15% test [1]. Training fits the weights. Validation is where descriptors are dropped and the method is chosen. The test set is scored once, at the end. Using it to pick a model makes the test number another validation number, and the optimism is baked in. The glossary calls that leakage. An 80/10/10 cut is a common default, not this webinar’s, and not a reason to skip the single look.

A 70 / 15 / 15 split with a one-way arrow into the test setTrain, 70 percent, fits the model. Validation, 15 percent, is where tuning happens, with a loop back to training. Test, 15 percent, is scored once and then the work stops; the arrow into it goes one way. Note: a random cut can put analogues on both sides; cluster by similarity instead.Train, 70%fit the modelValidation15%, tune hereTest, 15%score once, then stoponce70%15%15%A random cut can put analogues on both sides. Cluster by similarity instead.
A 70 / 15 / 15 split with a one-way arrow into the test setTrain, 70 percent, fits the model. Validation, 15 percent, is where tuning happens, with a loop back to training. Test, 15 percent, is scored once and then the work stops; the arrow into it goes one way. Note: a random cut can put analogues on both sides; cluster by similarity instead.Train, 70%fit the modelValidation15%, tune hereTest, 15%score once, then stoponce70%1515A random cut can put analogues on bothsides. Cluster by similarity instead.
Figure 3.The arrow into the test box is one way. Going back to change a descriptor because the test score was disappointing is a second look.

On a small table, a 15% test set may be a handful of compounds. The webinar’s alternative is kk-fold cross-validation, 5-fold or 10-fold, and a consensus of models rather than one fit [1]. Consensus matters because a single fold can flatter a method. The validation note is the next layer: the R2R^2, Q2Q^2, and concordance cuts used when a paper or a filing has to defend the model. Those cuts assume the split was honest. They do not create the honesty.

Class balance is part of the split. A screen that is mostly inactive will reward a model that predicts inactive. The remedies named in the webinar are oversampling the rare class, or a loss that weights it, and then a metric that does not ignore the imbalance [1].

R2R^2 is not the plot

Anscombe built four tiny datasets with the same means, the same variances, the same correlation, and the same straight-line fit, R2R^2 about 0.67 [5]. One is a noisy line. One is a curve. One is a line plus an outlier. One is a vertical stack whose entire slope comes from a single point. The regression summary cannot tell them apart. The scatter plot can. Mansley uses that quartet so a QSAR report does not stop at R2R^2 [1].

Anscombe's quartet: four datasets, one fitted lineAnscombe's 1973 data, eleven points per panel, plotted exactly. I is a noisy straight line, II a smooth curve, III a line with one outlier, IV ten points stacked at x = 8 plus one point at x = 19 that creates the slope. All four share the least-squares line y = 3.00 + 0.500x and R squared of about 0.67.I · noisy line51015204812II · a curve5101520III · outlier5101520IV · one point5101520Fit in every panel: y = 3.00 + 0.500x · R² ≈ 0.67
Anscombe's quartet: four datasets, one fitted lineAnscombe's 1973 data, eleven points per panel, plotted exactly. I is a noisy straight line, II a smooth curve, III a line with one outlier, IV ten points stacked at x = 8 plus one point at x = 19 that creates the slope. All four share the least-squares line y = 3.00 + 0.500x and R squared of about 0.67.I · noisy line51015204812II · a curve5101520III · outlier51015204812IV · one point5101520All panels: y = 3.00 + 0.500x · R² ≈ 0.67
Figure 4.Anscombe’s quartet, plotted from his published table [5]. All four share a linear R2R^2 near 0.67. RMSE and MAE will move when the errors move. They still do not show the curve. The plot does.Data: Anscombe (1973), all 44 published points [5]. Line: the shared least-squares fit.

For regression, report RMSE and MAE next to the plot. RMSE is in the units of the modeled number, so an RMSE of 0.5 on a pKi\mathrm{p}K_i is half a log unit, about threefold in KiK_i, and it is readable. R2R^2 has no units and no picture. The glossary separates the loss the model minimizes from the metric you use to keep it. This is that distinction on an assay table.

For classification, accuracy is the metric that flatters the majority class. Balanced accuracy is the average of the true-positive rate and the true-negative rate:

BA=TPR+TNR2.\mathrm{BA} = \frac{\mathrm{TPR} + \mathrm{TNR}}{2}.

Cohen’s κ\kappa subtracts the agreement you would get from the class frequencies alone:

κ=po−pe1−pe.\kappa = \frac{p_o - p_e}{1 - p_e}.

pop_o is the observed agreement. pep_e is the agreement expected by chance. A model that calls everything inactive can have a high accuracy and a κ\kappa near zero. The webinar names both metrics for that reason [1].

The M5 demonstration

The live session uses Optibrium’s public muscarinic acetylcholine receptor M5M_5 example: 129 compounds with ChEMBL KiK_i values [1], [6]. The raw KiK_i distribution is skewed. In that worked example the column is micromolar, and the modeled number is

pKi=6−log⁡10(Ki/μM),\mathrm{p}K_i = 6 - \log_{10}(K_i / \mu\mathrm{M}),

which is −log⁡10(Ki)-\log_{10}(K_i) with KiK_i in molar. The pKi\mathrm{p}K_i values sit in a roughly bell-shaped range that a continuous model can fit. The same transform is the one a P450 inhibition table usually needs. An IC50\mathrm{IC}_{50} in micromolar becomes a pIC50\mathrm{pIC}_{50} by the same shift of 6. Leaving the column in micromolar asks the model to treat a change from 0.01 to 0.1 as a different kind of error from a change from 10 to 100.

A skewed Ki column, and the pKi column a model can fitSchematic histograms, not data. Left: micromolar Ki values pile up at the potent end and tail off. Right: after pKi = 6 minus log10 of Ki in micromolar, the same column has a middle. Bar heights are illustrative shapes, not the ChEMBL counts.Ki, micromolarpotentweakpiled at the potent end6 − log₁₀pKi = 6 − log₁₀(Ki / µM)weakpotenta column with a middle
A skewed Ki column, and the pKi column a model can fitSchematic histograms, not data. Left: micromolar Ki values pile up at the potent end and tail off. Right: after pKi = 6 minus log10 of Ki in micromolar, the same column has a middle. Bar heights are illustrative shapes, not the ChEMBL counts.Ki, micromolarpotentweakpiled at the potent end6 − log₁₀pKi = 6 − log₁₀(Ki / µM)weakpotenta column with a middle
Figure 5.Schematic, not the 129-row histogram. The shape is the reason to model pKi\mathrm{p}K_i. A threefold error at 0.01 µM and a threefold error at 10 µM are the same distance on the right, and very different distances on the left.Schematic shape only. Bar heights are illustrative, not counts.

Auto-Modeller then splits the set. In the demonstration the split is a Tanimoto clustering, so near analogues are not free to land in both training and test by chance [1]. Correlated and redundant descriptors are dropped before the fit. On this set a random forest was the method the validation score preferred [1]. That is a result about these 129 compounds. It is not a standing recommendation to reach for a forest.

The Glowing Molecule view is how StarDrop draws the model back onto the structure. Red marks a region that raises the predicted number. Blue marks a region that lowers it [7]. On a pKi\mathrm{p}K_i model, red is higher predicted affinity. On a clearance model, red is higher predicted clearance, which is often the liability you are trying to remove. The color is about the direction of the number, not about whether the change is good.

Red raises the predicted number. Blue lowers it.A schematic three-fragment molecule: one fragment hatched red, one plain, one hatched blue. Red marks a region that raises the predicted number, blue one that lowers it. For a pKi model red means higher predicted affinity; for a clearance model the same red means higher predicted clearance.Red: number upBlue: number downSame red, two meaningspKi model: red = higher affinityClearance model: red = higher valuea design idea on one,a warning on the other
Red raises the predicted number. Blue lowers it.A schematic three-fragment molecule: one fragment hatched red, one plain, one hatched blue. Red marks a region that raises the predicted number, blue one that lowers it. For a pKi model red means higher predicted affinity; for a clearance model the same red means higher predicted clearance.Red: number upBlue: number downSame red, two meaningspKi model: red = higher affinityClearance model: red = higher valuea design idea on one, a warning on the other
Figure 6.A scheme of the color rule, not a glowing M5M_5 ligand [7]. Read the color against the column that was modeled. The same red pixel is a design idea on one property and a warning on another.

What to take back to a P450 table

Start from the assay identity. One isoform and one endpoint, a KiK_i or a categorical call, can be a QSAR. A clearance number that several enzymes can produce is a weaker thing to ask of a fingerprint, and the webinar says so directly [1]. If the column is a concentration, model its negative log, and write the unit shift down. Split so that close analogues are not the hidden contents of the test set, tune only on the validation portion, and score the test portion once. Publish the plot, RMSE or MAE, and for a classifier the balanced accuracy or κ\kappa, not accuracy and not R2R^2 alone. Then ask whether the next compound is inside the chemistry the model saw. If it is not, the pillars were followed and the prediction is still outside their reach.

References

  1. Mansley T, Öeren M. How to build a better QSAR model. Optibrium webinar, 18 February 2025. optibrium.com/webinars/how-to-build-a-better-qsar-model. Recording: youtube.com/watch?v=TGXPwi-Z5sY.
  2. Optibrium. How do I know if Optibrium’s predictive models work? The four pillars named there are clean data, an appropriate method, validation with appropriate metrics, and the domain of applicability. optibrium.com/knowledge-base/do-optibriums-predictive-models-work.
  3. Optibrium. ADME QSAR models in StarDrop, including CYP2C9 and CYP2D6 affinities and a human-liver-microsome intrinsic-clearance category. optibrium.com/products/stardrop/modules/adme-qsar.
  4. Optibrium. StarDrop Auto-Modeller. Methods listed include Gaussian processes, random forests, radial basis functions, partial least squares, and decision trees. optibrium.com/products/stardrop/modules/auto-modeller.
  5. Anscombe FJ. Graphs in statistical analysis. Am Stat 1973;27:17–21. doi:10.1080/00031305.1973.10478966. The four datasets share a linear R2R^2 of about 0.67.
  6. Optibrium. Automatic QSAR model building and validation in StarDrop. Worked example: 129 ChEMBL compounds, muscarinic acetylcholine receptor M5M_5, KiK_i in micromolar converted to pKi\mathrm{p}K_i. youtube.com/watch?v=QqEWf1AB2vk.
  7. Optibrium. Glowing Molecule in StarDrop. Regions that increase the predicted value are shown in red. Regions that decrease it are shown in blue. optibrium.com/products/stardrop/features/glowing-molecule-in-stardrop. The color rule is also stated in StarDrop’s worked example on guided multi-parameter optimization.

About the author

Yassir Boulaamane

Yassir Boulaamane, Postdoctoral researcher, computational drug discovery

Postdoctoral researcher at the Universitat Autònoma de Barcelona (InSiliChem), with a PhD in computational drug discovery. Works on molecular docking, molecular dynamics, free energy calculations and machine-learning QSAR.

Found an error or a command that no longer works? Tell me and I will correct it. See the editorial policy for how corrections are handled.

Need this workflow run on your own system? See services.