%%html
<script src="https://bits.csb.pitt.edu/preamble.js"></script>
<style>:root {--jp-cell-prompt-width: 32px}
.citation { font-size: small }
.reveal blockquote {
box-sizing: border-box;
width: 100%;
margin: 1em 0;
padding: 0.65em 1em;
font-size: 0.95em;
font-style: normal;
line-height: 1.4;
text-align: left;
color: #24344d;
background: #f0f4fa;
border-left: 5px solid #003594;
border-radius: 0 6px 6px 0;
box-shadow: none;
}
.reveal blockquote > :first-child {
margin-top: 0;
}
.reveal blockquote > :last-child {
margin-bottom: 0;
}
</style>
Traditional de novo Drug Design¶
A search process in chemical space, not just conformational space.
- Challenge is to maintain synthetic tractability
- Often search in fragment and/or reaction space
- Genetic algorithm or MCMC for search
AutoGrow Crossover Operation¶
AutoGrow's mutation and crossover operations are contrained by known chemistry.
Chemically tractable reaction templates guide modifications, increasing the synthetic accessibility of the results.
- Mutation: modify one parent.
- Crossover: combine compatible parts of two parents.
Synthons connect fragments to chemistry¶
| Term | Meaning in this context |
|---|---|
| Fragment | A portion of a molecular structure |
| Synthon | A conceptual contribution with a defined synthetic role |
| Building block | The actual reagent that supplies that contribution |
In a virtual library, synthons usually carry labeled attachment sites and reaction compatibility rules.
Small building-block sets, large chemical spaces¶
For $k$ independently compatible building-block positions,
$$N_{\mathrm{combinations}}=\prod_{i=1}^{k} n_i.$$
Three positions with 1,000 choices each give $10^9$ nominal combinations.
Synthetic Accessibility (SA)¶
Synthetic Accessibility is how practically feasible it is to make a molecule in the lab, considering available building blocks, number and type of steps, protecting groups, stereo/ring complexity, and known precedents.
SAScore: a fast heuristic¶
Heuristic estimation of SA.
- Fragment contribution:
- Break the molecule into fragments (e.g., circular/structural keys).
- Frequent fragments in large corpora (e.g., drug-like databases) contribute lower difficulty; rare fragments contribute higher difficulty.
- Complexity penalties:
- Size (very large molecules)
- Stereocenters (more chiral centers → harder)
- Fused/bridged ring systems and macrocycles
- Spiro/bridgehead motifs, unusual heteroatom patterns
- Symmetry & feature corrections:
- Symmetry can slightly help; exotic features tend to hurt.
- Rescaled to 1–10: lower generally means easier.
How well does SAScore reflect expert judgment?¶
| Collections | Expert comparison |
|---|---|
| Distribution of SAscore for natural products, bioactive molecules and molecules from catalogues. | Average of chemist ranks for 40 test molecules (blue) compared with the computed SAscore (red). Error bars on blue points indicate standard error of mean of estimations by 9 chemists. |
Retrosynthesis proposes candidate routes¶
Work backward from a target to precursors and available starting materials. Rank possible routes; then review their chemistry.
Generative models change how we propose molecules¶
- Learn chemical and structural patterns from examples.
- Sample candidates, optionally conditioned on a pocket, fragment, or property.
- Combine generation with search, scoring, filtering, and synthesis planning.
Learning a proposal distribution does not eliminate the optimization problem.
Generative modeling¶
Learn a transformation $\Phi_\theta$ from an easy-to-sample distribution to the data distribution.
What does the generator produce?¶
| Representation | Natural output | What still needs care? |
|---|---|---|
| SMILES / tokens | Molecular string | Syntax, stereochemistry, 3D pose |
| Molecular graph | Atoms and bonds | Geometry and chemical validity |
| 3D coordinates + types | Spatial molecular structure | Connectivity, geometry, discrete chemistry |
Conditioning might specify a protein pocket, known scaffold, interaction pattern, or desired property.
Direct decoding or iterative updates?¶
| Direct decoder | Iterative transformation |
|---|---|
| VAE / GAN decoder | Diffusion / flow matching |
Autoregressive models instead emit a sequence of conditional predictions.
Direct Decoding¶
Optimize a property predictor in latent space, then decode candidates.
Autoregressive generation: Pocket2Mol¶
Build a ligand one atom at a time, conditioned on the protein pocket and partial ligand.
- Choose a growth site: sample a predicted frontier atom.
- Place the atom: sample a relative 3D position.
- Assign chemistry: predict its element and bonds to existing atoms.
- Repeat until no frontier atoms remain.
Training: predict missing atoms and bonds from partially masked ligands in their protein pockets.
How can we favor desired properties?¶
Given a SMILES generative model:
How can we directly sample molecules with desired property?
Reinforcement learning for molecular design¶
Start from a pretrained prior; update an agent toward high-reward molecules while retaining useful prior behavior.
The reward remains a proxy for the experimental objective.
Reinforcement learning: generate, score, update¶
- Initialize: copy a pretrained SMILES prior into a trainable agent. Keep the prior fixed.
- Generate: sample complete SMILES strings from the current agent.
- Score: evaluate each molecule with a task-specific score $S(A)$.
- Update: adjust the agent toward a reward-adjusted log-likelihood target.
- Repeat with newly generated molecules.
Flow matching: learn how samples should move¶
Learn a velocity field $v_\theta(x,t)$: direction and speed at state $x$ and time $t$.
Integrating the field transports noise toward the data distribution.
Training: construct a path with a known velocity¶
Draw independent endpoints $x_0\sim\mathcal N(0,I)$ and $x_1\sim p_{\rm data}$, and a time $t\sim U(0,1)$.
$$x_t=(1-t)x_0+t x_1$$ $$u=\frac{dx_t}{dt}=x_1-x_0$$
- $x_t$ is a constructed intermediate state.
- $u$ is the exact velocity of this sampled straight path.
- We can compute a training pair $(x_t,u)$ without simulating an ODE.
Training: regress the velocity¶
$$\mathcal L(\theta)= \mathbb E_{x_0,x_1,t}\!\left[ \left\|v_\theta(x_t,t)-(x_1-x_0)\right\|^2 \right].$$
| Network input | Supervised target |
|---|---|
| Intermediate state $x_t$ and time $t$ | Paired velocity $x_1-x_0$ |
The network does not receive $x_1$ as an input.
At the ideal regression optimum: $$v^*(x,t)=\mathbb E[x_1-x_0\mid x_t=x].$$
Alternatively: predict a clean endpoint instead¶
For the linear interpolation, let $D_\theta(x_t,t)$ predict the clean endpoint.
$$v_\theta(x_t,t)=\frac{D_\theta(x_t,t)-x_t}{1-t},\qquad t<1.$$
This recovers the pairwise velocity when the prediction equals $x_1$.
The endpoint is predicted, not supplied. The loss weighting, time sampling, and behavior near $t=1$ require care.
Sampling: solve an ODE from fresh noise¶
$$X(0)\sim\mathcal N(0,I),\qquad \frac{dX(t)}{dt}=v_\theta(X(t),t).$$
A simple Euler step is $$X(t+\Delta t)\approx X(t)+\Delta t\,v_\theta(X(t),t).$$
- Start from a new noise sample; no target molecule is supplied.
- The basic ODE is deterministic given its initial state and condition.
- Smaller steps usually reduce discretization error, at additional cost.
Straight training paths can yield curved sampling paths¶
(a) Pairwise paths may cross. (b) Regression averages their velocities. (c) Sampling follows the resulting field.
Molecular flow: coordinates and chemistry¶
For a ligand $m=(X,A,B)$ in pocket $P$:
- Coordinates $X$: continuous updates, such as $v_\theta(X,A,B,t;P)$.
- Atom types $A$, bonds $B$: categorical transitions or another explicit categorical formulation.
- Geometry: rotating the input should rotate coordinate updates — equivariance.
- Conditioning: keep known chemistry or geometry fixed as required by the task.
Coordinates can interpolate continuously; chemical categories require their own method.
FLOWR.ROOT: generate and predict together¶
- Pocket-conditioned, equivariant flow model for ligand chemistry and geometry.
- Shared representation supports structure, affinity/potency, and confidence predictions.
- Pretrain → refine → adapt to a project with LoRA; use predicted objectives to guide sampling.
LDDM: learn to complete partially specified ligands¶
- Use BRICS fragments; mask chemistry, coordinates, or both.
- Combine coordinate flow matching with categorical Markov bridges.
- Vary what is revealed to support design, docking, growing, and linking.
LDDM: generation inside a reaction-space search¶
Generate candidates → retain compatible fragments → match reaction products → continue growing.
The synthesis constraint comes from the sampling/search procedure as well as the neural generator.
From a generated molecule to an experimental hypothesis¶
- Generation learns how to propose; search and evaluation still matter.
- Flow matching trains on known path velocities, then samples by following a learned field.
- Molecular geometry and discrete chemistry need coordinated modeling.
- Synthesis plans and independent experiments determine whether proposals are useful.