Virtual Screening: How AI Narrows a Compound Library
11 min read · updated August 11, 2026
Virtual screening is triage. You cannot assay ten million compounds, so you compute a cheap score over all of them, an expensive score over a fraction, and hand a few dozen to a laboratory. Every design decision is about where to spend the expensive computation.
Two kinds of screen
Ligand-based screening needs known actives and no protein structure. Rank the library by fingerprint similarity to those actives, or by a pharmacophore model, or by a classifier trained on active and inactive sets. It is fast enough to run over billions of compounds and it can only find things that resemble what you already have.
Structure-based screening needs a three-dimensional receptor structure. Each compound is posed in the binding site and scored — molecular docking. It can propose chemotypes unrelated to any known ligand, and it costs seconds to minutes of CPU per compound rather than microseconds.
The scale is real. Jiankun Lyu and colleagues docked up to 138 million make-on-demand compounds in “Ultra-large library docking for discovering new chemotypes” (Nature, 2019). For the D4 dopamine receptor they synthesised and tested 549 top-ranked compounds and found 81 that showed dose-dependent activity — a hit rate near 15%, against the low single digits typical of an experimental high-throughput screen. They also reported that the hit rate fell almost monotonically with docking rank, which is the property that makes the whole exercise worthwhile.
The two approaches are not alternatives so much as stages. A ligand-based pass is the only thing fast enough to touch a billion-compound catalogue, and its output is the input to the structure-based pass. Where no active is known and no structure is available, neither applies and the honest answer is a physical screen.
Worked: ten million down to fifty
The numbers below are stated assumptions chosen to make the arithmetic legible. Your retention rates come from your own library and target.
stage 0 library as downloaded 10,000,000
stage 1 structural sanitation
- strip salts, keep largest fragment
- reject elements outside your set
- reject MW outside 150-550 Da
- reject PAINS / reactive substructure alerts
assume 62% survive 6,200,000
stage 2 cheap ranking (2D similarity or ML surrogate)
score every survivor, keep the top 1% 62,000
cost: milliseconds each, hours of CPU total
stage 3 docking, exhaustive settings
62,000 compounds, several conformers each
keep the top 2% by score 1,240
stage 4 scaffold clustering
group by Bemis-Murcko framework
assume 1,240 compounds fall into 210 frameworks
keep the best-scoring member of each 210
stage 5 visual inspection by a medicinal chemist
reject implausible poses, unstable groups,
internal strain, buried unsatisfied donors
assume 24% survive 50
order 50 compounds -> assayThree things about the shape of that funnel are worth more than the numbers. Stage 1 is not optional and is frequently skipped; a library that has not been sanitised contains multi-component strings, reactive electrophiles and compounds that will never behave in an assay, and they dock as happily as anything else. Stage 4 exists because docking scores cluster within a chemical series — take the top 1,240 by score without clustering and you may order fifty analogues of one compound, learning one bit of information. Stage 5 is a human, and every published large-scale campaign includes one.
Enrichment factor, computed
The metric for a screen is enrichment: how much better than random is the top of your ranked list?
EF at x% = (hits in top x% / compounds in top x%)
-------------------------------------------
(total hits / total compounds)
retrospective test on a set with known answers:
100,000 compounds, 200 known actives -> base rate 0.2%
top 1% = 1,000 compounds, containing 40 actives
EF(1%) = (40 / 1,000) / (200 / 100,000)
= 0.04 / 0.002
= 20
so the top 1% is 20x richer in actives than the library at large.
the maximum possible EF(1%) here is 100,000/1,000 = 100, reached
only if all 200 actives landed in the top 1,000.Enrichment factor has a known weakness: it depends entirely on the cutoff you chose and says nothing about ranking inside it. Area under the ROC curve fixes the arbitrariness and introduces the opposite problem — it weights the whole ranking equally, while you only ever look at the top. BEDROC, introduced by Jean-François Truchon and Christopher Bayly in 2007, applies an exponential weight so that early recognition dominates, with a parameter that sets how early. Report the enrichment at the fraction you will actually purchase, and state it.
A docking score is not an affinity
A docking program does two things: search the pose space, and score poses. The search is usually adequate — given a rigid receptor and a defined box, engines find near-native poses for a large share of well-behaved ligands. The scoring is the weak part.
Scoring functions are fast approximations to a free energy, fitted or hand-weighted, and their correlation with measured affinity across diverse compounds is modest. That is a design compromise, not a bug: a function accurate enough to rank two close analogues would be far too slow to run over 62,000 compounds. The consequence is that you should use the score to select a set, never to rank within it — a compound at −10.2 is not reliably better than one at −9.8. The structure of these scoring functions explains why.
The other quiet assumption is a rigid receptor. Docking a library against one crystal structure asks which compounds fit that particular snapshot of a flexible protein. Ensemble docking against several structures or several molecular-dynamics frames widens it, multiplies the cost, and introduces the question of how to combine scores across receptors — usually the best score per compound, which biases toward compounds that happen to suit one unusual conformation.
Benchmark bias, and the control that catches it
Retrospective benchmarks pair known actives with computationally chosen decoys. DUD-E, from Michael Mysinger and colleagues in 2012, is the most used, and it selects decoys to match the actives on physicochemical properties while differing in topology.
Lieyang Chen and colleagues showed in “Hidden bias in the DUD-E dataset leads to misleading performance of deep learning in structure-based virtual screening” (PLOS ONE, 2019) that neural networks trained on it can achieve strong scores from ligand features alone — that is, without meaningful use of the protein. The models had learned to recognise the decoy-generation procedure.
The control is cheap and should be standard. Train and evaluate a ligand-only model that never sees the receptor. If it matches the structure-aware model, the benchmark is separable on ligand properties and the score tells you nothing about binding. Run the same control with a shuffled receptor, and hold out by target family rather than at random, so that a model cannot succeed by recognising a protein it memorised.
The same caution applies to prospective screens, where there is no decoy set to be biased. There the analogous control is the property audit: compare the molecular weight, lipophilicity and formal charge distributions of your shortlist against the library it came from. A shortlist that is uniformly larger and greasier than the library has been selected by a scoring function that rewards contact area, and the fifty compounds you order will be fifty variations on that one bias. Capping molecular weight before docking, rather than filtering afterwards, is the cheap fix.