D IFF D OCK : D IFFUSION S TEPS , T WISTS , AND T URNS FOR M OLECULAR D OCKING
Anonymous authors
Paper under double-blind review
A BSTRACT
Predicting the binding structure of a small molecule ligand to a protein—a task known as molecular docking —is critical to drug design.
Recent deep learning methods that treat docking as a regression problem have decreased runtime compared to traditional search-based methods but have yet to offer substantial improvements in accuracy.
We instead frame molecular docking as a generative modeling problem and develop D IFF D OCK , a diffusion generative model over the non-Euclidean manifold of ligand poses.
To do so, we map this manifold to the product space of the degrees of freedom (translational, rotational, and torsional) involved in docking and develop an efficient diffusion process on this space.
Empirically, D IFF D OCK obtains a 38% top-1 success rate (RMSD < 2 ˚A) on PDBBind, significantly outperforming the previous state-of-the-art of traditional docking (23%) and deep learning (20%) methods.
Moreover, D IFF D OCK has fast inference times and provides confidence estimates with high selective accuracy.
I NTRODUCTION
The biological functions of proteins can be modulated by small molecule ligands (such as drugs) binding to them.
Thus, a crucial task in computational drug design is molecular docking —predicting the position, orientation, and conformation of a ligand when bound to a target protein—from which the effect of the ligand (if any) might be inferred.
Traditional approaches for docking [Trott & Olson, 2010; Halgren et al., 2004] rely on scoring-functions that estimate the correctness of a proposed structure or pose, and an optimization algorithm that searches for the global maximum of the scoring function.
However, since the search space is vast and the landscape of the scoring functions rugged, these methods tend to be too slow and inaccurate, especially for high-throughput workflows.
Recent works [St¨ark et al., 2022; Lu et al., 2022] have developed deep learning models to predict the binding pose in one shot, treating docking as a regression problem.
While these methods are much faster than traditional search-based methods, they have yet to demonstrate significant improvements in accuracy.
We argue that this may be because the regression-based paradigm corresponds imperfectly with the objectives of molecular docking, which is reflected in the fact that standard accuracy metrics resemble the likelihood of the data under the predictive model rather than a regression loss.
We thus frame molecular docking as a generative modeling problem —given a ligand and target protein structure, we learn a distribution over ligand poses.
We therefore develop D IFF D OCK , a diffusion generative model (DGM) over the space of ligand poses for molecular docking.
We define a diffusion process over the degrees of freedom involved in docking: the position of the ligand relative to the protein (locating the binding pocket), its orientation in the pocket, and the torsion angles describing its conformation.
D IFF D OCK samples poses by running the learned (reverse) diffusion process, which iteratively transforms an uninformed, noisy prior distribution over ligand poses into the learned model distribution (Figure 1).
Intuitively, this process can be viewed as the progressive refinement of random poses via updates of their translations, rotations, and torsion angles.
While DGMs have been applied to other problems in molecular machine learning [Xu et al., 2021;
Jing et al., 2022; Hoogeboom et al., 2022], existing approaches are ill-suited for molecular docking, where the space of ligand poses is an ( m + 6) -dimensional submanifold M ⊂ R 3 n , where n and m are, respectively, the number of atoms and torsion angles.
To develop D IFF D OCK , we recognize that the docking degrees of freedom define M as the space of poses accessible via a set of allowed ligand t=
T t= ligand & protein reverse diffusion over translations, rotations and torsions ranked poses & confidence score
DiffDock pose transformations .
We use this idea to map elements in M to the product space of the groups corresponding to those transformations, where a DGM can be developed and trained efficiently.
As applications of docking models often require only a fixed number of predictions and a confidence score over these, we train a confidence model to provide confidence estimates for the poses sampled from the DGM and to pick out the most likely sample.
This two-step process can be viewed as an intermediate approach between brute-force search and one-shot prediction: we retain the ability to consider and compare multiple poses without incurring the difficulties of high-dimensional search.
Empirically, on the standard blind docking benchmark PDBBind, D IFF D OCK achieves 38% of toppredictions with ligand root mean square distance (RMSD) below 2 ˚A, nearly doubling the performance of the previous state-of-the-art deep learning model (20%).
D IFF D OCK significantly outperforms even state-of-the-art search-based methods (23%), while still being 3 to 12 times faster on GPU.
Moreover, it provides an accurate confidence score of its predictions, obtaining 83%
RMSD < 2 ˚A on its most confident third of the previously unseen complexes.
To summarize, the main contributions of this work are:
We frame the molecular docking task as a generative problem and highlight the issues with previous deep learning approaches.
We formulate a novel diffusion process over ligand poses corresponding to the degrees of freedom involved in molecular docking.
We achieve a new state-of-the-art 38% top-1 prediction with RMSD < 2 ˚A on PDBBind blind docking benchmark,
considerably surpassing the previous best search-based (23%) and deep learning methods (20%).
B ACKGROUND AND R ELATED W ORK
Molecular docking.
The molecular docking task is usually divided between known-pocket and blind docking.
Known-pocket docking algorithms receive as input the position on the protein where the molecule will bind (the binding pocket ) and only have to find the correct orientation and conformation.
Blind docking instead does not assume any prior knowledge about the binding pocket; in this work, we will focus on this general setting.
Due to the relative rigidity of the protein in the majority of the cases, docking methods typically assume the knowledge of the bound protein structure, and we will follow this assumption [Pagadala et al., 2017].
Methods are normally evaluated by the percentage of hits, or approximately correct predictions, commonly considered to be those where the ligand RMSD error is below 2 ˚A [Alhossary et al., 2015; Hassan et al., 2017; McNutt et al., 2021].
Search-based docking methods.
Traditional docking methods [Trott & Olson, 2010; Halgren et al., 2004; Thomsen & Christensen, 2006] consist of a parameterized physics-based scoring function and a search algorithm.
The scoring-function takes in 3D structures and returns an estimate of the quality/likelihood of the given pose, while the search stochastically modifies the ligand pose (position, orientation, and torsion angles) with the goal of finding the global optimum of the scoring function.
Recently, machine learning has been applied to parameterize the scoring-function [McNutt et al., 2021; M´endez-Lucio et al., 2021].
These search-based methods have offered relative improvements when docking to a known pocket but are typically very computationally expensive to run and must still grapple with the very large search space that characterizes blind docking.
Machine learning for blind docking.
Recently, EquiBind [St¨ark et al., 2022] has tried to tackle the blind docking task by directly predicting pocket keypoints on both ligand and protein and aligning them.
TANKBind [Lu et al., 2022] improved over this by independently predicting a docking pose (in the form of an interatomic distance matrix) for each possible pocket and then ranking them.
Although these one-shot or few-shot regression-based prediction methods are orders of magnitude faster, their performance has not yet reached that of traditional search-based methods.
Diffusion generative models.
Let the data distribution be the initial distribution p 0 ( x ) of a continuous diffusion process described by d x = f ( x , t ) dt + g ( t ) d w , where w is the Wiener process.
Diffusion generative models (DGMs) 1 model the score 2 ∇ x log p t ( x ) of the diffusing data distribution in order to generate data via the reverse diffusion d x = [ f ( x , t ) − g ( t ) 2 ∇ x log p t ( x )]
+ g ( t ) d w [Song et al., 2021].
In this work, we always take f ( x , t ) = 0 .
Several DGMs have been developed for molecular ML tasks, including molecule generation [Hoogeboom et al., 2022], conformer generation
[Xu et al., 2021], and protein design [Trippe et al., 2022].
However, these approaches learn distributions over the full Euclidean space R 3 n with 3 coordinates per atom, making them ill-suited for molecular docking where the degrees of freedom are much more restricted (see Appendix E.2).
D OCKING AS G ENERATIVE M ODELING
Although EquiBind and other ML methods have provided strong runtime improvements by avoiding an expensive optimization process over ligand poses, their performance has not yet reached that of search-based methods.
As our analysis below argues, this may be caused by the models’ uncertainty and the optimization of an objective function that does not correspond to how molecular docking is used and evaluated in practice.
Molecular docking objective.
Molecular docking plays a critical role in drug discovery because the prediction of the 3D structure of a bound protein-ligand complex enables further computational and human expert analyses on the strength and properties of the binding interaction.
Therefore, a docked prediction is only useful if its deviation from the true structure does not significantly affect the output of such analyses.
Concretely, a prediction is considered acceptable when the distance between the structures (measured in terms of ligand RMSD) is below some small tolerance on the order of the length scale of atomic interactions (a few ˚Angstr ¨ om).
Consequently, the standard evaluation metric used in the field has been the percentage of predictions with a ligand RMSD (to the crystal ligand pose) below some value ϵ .
However, the objective of maximizing the proportion of predictions with RMSD within some tolerance ϵ is not differentiable and cannot be used for training with stochastic gradient descent.
Instead, maximizing the expected proportion of predictions with RMSD <
ϵ corresponds to maximizing the likelihood of the true structure under the model’s output distribution, in the limit as ϵ goes to 0.
This observation motivates training a generative model to minimize an upper bound on the negative log-likelihood of the observed structures under the model’s distribution.
Thus, we view molecular docking as the problem of learning a distribution over ligand poses conditioned on the protein structure and develop a diffusion generative model over this space (Section 4).
Confidence model.
With a trained diffusion model, it is possible to sample an arbitrary number of ligand poses from the posterior distribution according to the model.
However, researchers are often interested in seeing only one or a small number of predicted poses and an associated confidence
[Figure]
measure 3 for downstream analysis.
Thus, we train a confidence model over the poses sampled by the diffusion model and rank them based on its confidence that they are within the error tolerance.
The top-ranked ligand pose and the associated confidence are then taken as D IFF D OCK ’s topprediction and confidence score.
Problem with regression-based methods.
The difficulty with the development of deep learning models for molecular docking lies in the aleatoric (which is the data inherent uncertainty, e.g., the ligand might bind with multiple poses to the protein) and epistemic uncertainty (which arises from the complexity of the task compared with the limited model capacity and data available) on the pose.
Therefore, given the available co-variate information (only protein structure and ligand identity), any method will exhibit uncertainty about the correct binding pose among many viable alternatives.
Any regression-style method that is forced to select a single configuration that minimizes the expected square error would learn to predict the (weighted) mean of such alternatives.
In contrast, a generative model with the same co-variate information would instead aim to capture the distribution over the alternatives, populating all/most of the significant modes even if similarly unable to distinguish the correct target.
This behavior, illustrated in Figure 2, causes the regression-based models to produce significantly more physically implausible poses than our method.
In particular, we observe frequent steric clashes (e.g., 26% of EquiBind’s predictions) and self-intersections in EquiBind’s and TANKBind’s predictions (Figures 5 and 9).
We found no intersections in D IFF D OCK ’s predictions.
Visualizations and quantitative evidence of these phenomena are in Appendix F.1.
M ETHOD 4. O VERVIEW
A ligand pose is an assignment of atomic positions in R 3 , so in principle, we can regard a pose x as an element in R 3 n , where n is the number of atoms.
However, this encompasses far more degrees of freedom than are relevant in molecular docking.
In particular, bond lengths, angles, and small rings in the ligand are essentially rigid, such that the ligand flexibility lies almost entirely in the torsion angles at rotatable bonds (see Appendix E for further discussion).
Traditional docking methods, as well as most ML ones, take as input a seed conformation c ∈ R 3 n of the ligand in isolation and change only the relative position and the torsion degrees of freedom in the final bound conformation.
4 The space of ligand poses consistent with c is, therefore, an ( m + 6) -dimensional submanifold M c ⊂ R 3 n , where m is the number of rotatable bonds, and the six additional degrees of freedom come from rototranslations relative to the fixed protein.
We follow this paradigm of taking as input a seed conformation c , and formulate molecular docking as learning a probability distribution p c ( x | y ) over the manifold M c , conditioned on a protein structure y .
DGMs on submanifolds have been formulated by De Bortoli et al.
[2022] in terms of projecting a diffusion in ambient space onto the submanifold.
However, the kernel p ( x t | x 0 ) of such a diffusion is not available in closed form and must be sampled numerically with a geodesic random walk, making training very inefficient.
We instead define a one-to-one mapping to another, “nicer” manifold where the diffusion kernel can be sampled directly and develop a DGM in that manifold.
To start, we restate the discussion in the last paragraph as follows:
Any ligand pose consistent with a seed conformation can be reached by a combination of (1) ligand translations, (2) ligand rotations, and (3) changes to torsion angles
This can be viewed as an informal definition of the manifold M c .
Simultaneously, it suggests that given a continuous family of ligand pose transformations corresponding to the m + 6 degrees of freedom, a distribution on M c can be lifted to a distribution on the product space of the corresponding groups—which is itself a manifold.
We will then show how to sample the diffusion kernel on this product space and train a DGM over it.
4. L IGAND P OSE T RANSFORMATIONS
We associate translations of ligand position with the 3D translation group T (3) , rigid rotations of the ligand with the 3D rotation group SO (3) , and changes in torsion angles at each rotatable bond with a copy of the 2D rotation group SO (2) .
More formally, we define operations of each of these groups on a ligand pose c ∈ R 3 n .
The translation A tr : T (3) × R 3 n → R 3 n is defined straightforwardly as
A tr ( r , x ) i = x
i + r using the isomorphism T (3) ∼ = R 3 where x i ∈ R 3 is the position of the i th atom.
Similarly, the rotation A rot : SO (3) × R 3 n → R 3 n is defined by A rot ( R, x ) i =
R ( x i − ¯ x )+
¯ x where ¯ x = 1 n (cid:80) x i , corresponding to rotations around the (unweighted) center of mass of the ligand.
Many valid definitions of a change in torsion angles are possible, as the torsion angle around any bond ( a i , b i ) can be updated by rotating the a i side, the b i side, or both.
However, we can specify changes of torsion angles to be disentangled from rotations or translations.
One way of doing so is to identify a central motif in the molecule, such as a ring, and change torsion angles in a way that keeps the motif fixed.
However, this special treatment of the central motif introduces an arbitrary asymmetry into the problem and could be difficult for a score model to reason about.
Thus, we instead define the operation of elements of SO (2) m such that it causes a minimal perturbation (in an RMSD sense) to the structure:
Definition.
Let B k,θ k ( x ) ∈ R 3 n be any valid torsion update by θ k around the k th rotatable bond ( a k , b k ) .
We define A tor :
SO (2) m × R 3 n → R 3 n such that
[Equation]
where θ =
( θ 1 , . . .
θ m ) and
RMSDAlign( x , x ′ ) =
[Equation]
This means that we apply all the m torsion updates in any order and then perform a global RMSD alignment with the unmodified pose.
The definition is motivated by ensuring that the infinitesimal effect of a torsion is orthogonal to any rototranslation, i.e., it induces no linear or angular momentum .
These properties can be stated more formally as follows (proof in Appendix A):
Proposition 1.
Let y ( t ) :
= A tor ( t θ , x ) for some θ and where t θ = ( tθ 1 , . . .
tθ m ) .
Then the linear and angular momentum are zero: ddt ¯ y | t =
= 0 and (cid:80) i ( x − ¯ x ) × ddt y i | t =
= 0 where ¯ x = 1 n (cid:80) i x i .
Now consider the product space 6 P = T 3 × SO (3) × SO (2) m and define A : P × R 3 n → R 3 n as
[Equation]
These definitions collectively provide the sought-after product space corresponding to the docking degrees of freedom.
Indeed, for a seed ligand conformation c , we can formally define the space of ligand poses M c
= { A ( g, c ) | g ∈ P } .
This corresponds precisely to the intuitive notion of the space of ligand poses that can be reached by rigid-body motion plus torsion angle flexibility.
4. D IFFUSION ON THE P RODUCT S PACE
We now proceed to show how the product space can be used to learn a DGM over ligand poses in
M c .
First, we need a theoretical result (proof in Appendix A):
Proposition 2.
For a given seed conformation c , the map A ( · , c ) : P → M c is a bijection.
which means that the inverse A − 1 c : M c → P given by A ( g, c ) (cid:55)→ g maps ligand poses x ∈ M c to points on the product space P .
We are now ready to develop a diffusion process on P .
De Bortoli et al.
[2022] established that the DGM framework transfers straightforwardly to Riemannian manifolds with the score and score model as elements of the tangent space and with the geodesic random walk as the reverse SDE solver.
Further, the score model can be trained in the standard manner with denoising score matching [Song & Ermon, 2019].
Thus, to implement a diffusion model on P , it suffices to develop a method for sampling from and computing the score of the diffusion kernel on P .
Furthermore, since P is a product manifold, the forward diffusion proceeds independently in each manifold
[Rodol ` a et al., 2019], and the tangent space is a direct sum:
T g
[Equation]
m where g =
( r , R, θ ) .
Thus, it suffices to sample from the diffusion kernel and regress against its score in each group independently.
In all three groups, we define the forward SDE as d x = (cid:112) dσ 2 ( t ) /dt
d w where σ 2 = σ 2 tr , σ 2 rot , or σ 2 tor for T (3) , SO (3) , and SO (2) m respectively and where w is the corresponding Brownian motion.
Since T (3) ∼ = R 3 , the translational case is trivial and involves sampling and computing the score of a standard Gaussian with variance σ 2 ( t ) .
The diffusion kernel on SO (3) is given by the
IGSO (3) distribution [Nikolayev & Savyolov, 1970; Leach et al., 2022], which can be sampled in the axis-angle parameterization by sampling a unit vector ˆ ω ∈ so (3) uniformly 7 and random angle ω ∈ [0 , π ] according to
[Equation]
Further, the score of the diffusion kernel is ∇ ln p t ( R ′ | R ) =
( ddω log f
[Equation]
ω ))
ˆ ω ∈ T R ′
SO (3) , where
R ′ =
R ( ω ˆ ω ) R is the result of applying Euler vector ω
ˆ ω to R .
The score computation and sampling can be accomplished efficiently by precomputing the truncated infinite series and interpolating the
CDF of p ( ω ) , respectively.
Finally, the SO (2) m group is diffeomorphic to the torus T m , on which the diffusion kernel is a wrapped normal distribution with variance σ 2 ( t ) .
This can be sampled directly, and the score can be precomputed as a truncated infinite series [Jing et al., 2022].
4. T RAINING AND I NFERENCE
Diffusion model.
Although we have defined the diffusion kernel and score matching objectives on P , we nevertheless develop the training and inference procedures to operate on ligand poses in 3D coordinates directly.
Providing the full 3D structure, rather than abstract elements of the product space, to the score model allows it to reason about physical interactions using SE (3) equivariant models, not be dependent on arbitrary definitions of torsion angles [Jing et al., 2022], and better generalize to unseen complexes.
The training and inference procedures technically depend on the choice of seed conformation c used to define the mapping between M c and the product space.
However, providing a definite choice of c to the score model introduces an arbitrary inference-time parameter that may affect the final predicted distribution, which is undesirable.
In other words, while c defines the manifold of ligand poses, the precise location of c within that manifold should not affect the predicted distribution.
Thus, we develop approximate training and inference procedures that remove the dependence on the c ; intuitively, these assume that updates to points in the product space P can be applied to ligand poses in M c directly, without referencing the origin conformer c .
While these are only an approximation of the theoretically correct procedures, we find that they work well in practice.
In
Appendix B, we present the training and inference procedures in more detail and further discussion on this point.
Confidence model.
In order to collect training data for the confidence model d ( x , y ) , we run the trained diffusion model to obtain a set of candidate poses for every training example and generate labels by testing whether or not each pose has RMSD below 2 ˚A.
The confidence model is then trained with cross-entropy loss to correctly predict the binary label for each pose.
During inference, the diffusion model is run to generate N poses in parallel, which are passed to the confidence model that ranks them based on its confidence that they have RMSD below 2 ˚A.
4. M ODEL A RCHITECTURE
We construct the score model s ( x , y , t ) and the confidence model
d ( x , y ) to take as input the current ligand pose x and protein structure y in 3D space.
The output of the confidence model is a single scalar that is SE (3)
-invariant
(with respect to joint rototranslations of x , y ) as ligand pose distributions are defined relative to the protein structure, which can have arbitrary location and orientation.
On the other hand, the output of the score model must be in the tangent space T r T 3 ⊕ T R SO (3) ⊕ T
θ SO (2) m .
The space T r T 3 ∼ = R 3 corresponds to translation vectors and T R SO (3) ∼ = R 3 to rotation (Euler) vectors, both of which are SE (3) -equivariant.
Finally,
T θ SO (2) m corresponds to scores on SE (3) -invariant quantities (torsion angles).
Thus, the score model must predict two SE (3) -equivariant vectors for the ligand as a whole and an SE (3) -invariant scalar at each of the m freely rotatable bonds.
The score model and confidence model have similar architectures based on SE (3) -equivariant convolutional networks over point clouds [Thomas et al., 2018; Geiger et al., 2020].
The fundamental difference between them is the scale at which they operate: while the score model only considers a coarse-grained representation of the protein with only its α -carbon atoms, the confidence model has access to the full atomic structure of the protein.
This multiscale setup yields improved performance and a significant speed-up w.r.t.
doing the whole process at the atomic scale.
The architectural components are summarized below and detailed in Appendix C.
Structures are represented as heterogeneous geometric graphs formed by ligand atoms, protein residues, and protein atoms (the latter only for the confidence model).
Residue nodes receive as initial features language model embeddings trained on protein sequences
[Lin et al., 2022].
Nodes are sparsely connected based on distance cutoffs that depend on the types of nodes being linked and on the diffusion time.
Intuitively, nodes are connected with the range of elements that they might be closely interacting with; this range may span widely at the start of the diffusion but is narrow at the end.
Convolutional layers simultaneously operate with different sets of weights for different connection types (so 9 sets of weights for the confidence model and 4 for the score at every layer) and generate scalar and vector representations for each node.
The ligand atom representations after the final interaction layer are then used to produce the different outputs.
To produce the two R 3 vectors representing the translational and rotational scores, we convolve the node representations with a tensor product filter placed at the center of mass.
For the torsional score, we use a pseudotorque convolution to obtain a scalar at each rotatable bond of the ligand analogously to Jing et al.
[2022], with the distinction that, since the score model operates on coarse-grained representations, the output is not a pseudoscalar (its parity is neither odd nor even).
Finally, the confidence model’s output is produced by mean-pooling the ligand atoms’ scalar representations followed by a fully connected layer.
E XPERIMENTS
Experimental setup.
We evaluate our method on the complexes from PDBBind [Liu et al., 2017], a large collection of protein-ligand structures collected from PDB [Berman et al., 2003], which was used with time-based splits to benchmark many previous works [St¨ark et al., 2022; Volkov et al., 2022;
Lu et al., 2022].
We compare D IFF D OCK with state-of-the-art search-based methods
SMINA [Koes et al., 2013], QuickVina-W [Hassan et al., 2017], GLIDE [Halgren et al., 2004], and GNINA [McNutt et al., 2021] as well as the older Autodock Vina [Trott & Olson, 2010], and the recent deep learning methods EquiBind and TANKBind presented above.
Extensive details about the experimental setup, data, baselines, and implementation are in Appendix D.3 and all code is available at https://anonymous.4open.science/r/DiffDock .
The repository also contains videos of the reverse diffusion process (images of the same are in Figure 11).
As we are evaluating blind docking, the methods receive two inputs: the ligand with a predicted seed conformation (e.g., from RDKit) and the crystal structure of the protein.
Since search-based methods work best when given a starting binding pocket to restrict the search space, we also test the combination of using an ML-based method, such as P2Rank [Kriv´ak & Hoksza, 2018] (also used by TANKBind) or EquiBind to find an initial binding pocket, followed by a search-based method to predict the exact pose in the pocket.
To evaluate the generated complexes, we compute the heavy-atom RMSD (permutation symmetry corrected) between the predicted and the ground-truth ligand atoms when the protein structures are aligned.
All methods except for EquiBind are able to generate multiple structures and rank them.
We report the metrics for the highest ranked prediction as the top-1; top-5 refers to selecting the most accurate pose out of the 5 highest ranked predictions, which is a useful metric when multiple predictions are used for downstream tasks. For TANKBind, the runtimes for the top-1 and top-5 predictions are different.
Further evaluation details are in Appendix D.
[Table]
Docking accuracy.
D IFF D OCK significantly outperforms all previous methods (Table 1).
In particular, D IFF D OCK obtains an impressive 38.2% top-1 success rate (i.e., percentage of predictions with
RMSD < 2 ˚A 8 ) when sampling 40 poses and 35.0% when sampling just 10.
This performance vastly surpasses that of state-of-the-art commercial software such as GLIDE (21.8%, p =2 . 7 × 10 − 7 ) and the previous state-of-the-art deep learning method TANKBind {+(20.4%, p =1 . 
 × 10 − 12 ).+}
The use of ML-based pocket prediction in combination with search-based docking methods improves over the baseline performances, but even the best of these (EquiBind+GNINA) reaches a success rate of only 28.8% ( p =0 . 0003 ).
Figure 3- left shows the proportion of RMSDs below an arbitrary threshold ϵ with D IFF D OCK exceeding previous methods for almost every possible ϵ . 9 Figure 3- right plots how the model’s performance changes with the number of generative samples. Unlike regression methods like EquiBind, D IFF D OCK is able to provide multiple diverse predictions of different likely poses, as highlighted in the top-5 performances.
Inference runtime.
D IFF D OCK holds its superior accuracy while being (on GPU) 3 to 12 times faster than the best search-based method, GNINA (Table 1).
This high speed is critical for applications such as high throughput virtual screening for drug candidates or reverse screening for protein targets, where one often searches over a vast number of complexes.
As a diffusion model, D IFFD OCK is inevitably slower than the one-shot deep learning method E QUI B IND , but as shown in
Figure 3- right and Appendix F.3, it can be significantly sped up without significant loss of accuracy
[Figure]
[Figure]
dataset where D IFF D OCK is most confident.
Selective accuracy of confidence score.
As the top-1 results show, D IFF D OCK ’s confidence model is very accurate in ranking the sampled poses for a given complex and picking the best one.
We also investigate the selective accuracy of the confidence model across different complexes by evaluating how D IFF D OCK ’s accuracy increases if it only makes predictions when the confidence is above a certain threshold, known as selective prediction .
In
Figure 4, we plot the success rate as we decrease the percentage of complexes for which we make predictions, i.e., increase the confidence threshold.
When only making predictions for the top one-third of complexes in terms of model confidence, the success rate improves from 38% to 83%.
Additionally, there is a high Spearman correlation of 0.68 between D IFF D OCK ’s confidence and the negative RMSD.
Thus, the confidence score is a good indicator of the quality of D IFF D OCK ’s top-ranked sampled pose and provides a highly valuable confidence measure for downstream applications.
C ONCLUSION
We presented D IFF D OCK , a diffusion generative model tailored to the task of molecular docking.
This represents a paradigm shift from previous deep learning approaches, which use regressionbased frameworks, to a generative modeling approach that is better aligned with the objective of molecular docking.
To produce a fast and accurate generative model, we designed a diffusion process over the manifold describing the main degrees of freedom of the task via ligand pose transformations spanning the manifold.
Empirically, D IFF D OCK outperforms the state-of-the-art by very large margins on PDBBind, has fast inference times, and provides confidence estimates with high selective accuracy.
Thus, D IFF D OCK can offer great value for many existing real-world pipelines and opens up new avenues of research on how to best integrate downstream tasks, such as affinity prediction, into the framework and apply similar ideas to protein-protein and protein-nucleic acid docking.
A P ROOFS A. P ROOF OF P ROPOSITION
Proposition 1.
Let y ( t ) :
= A tor ( t θ , x ) for some θ and where t θ = ( tθ 1 , . . .
tθ m ) .
Then the linear and angular momentum are zero: ddt ¯ y | t =
= 0 and (cid:80) i ( x − ¯ x ) × ddt y i | t =
= 0 where ¯ x = 1 n (cid:80) i x i .
Proof.
Let y ( t ) =
R ( t )( B ( t, θ , x ) − ¯ x ) + ¯ x + p ( t ) where B ( t, θ , · ) =
B 1 ,tθ 1 ◦ · · · B m,tθ m and
R ( t ) , p ( t ) are the rotation (around ¯ x ) and translation associated with the optimal RMSD alignment between B ( t, θ , x ) and x .
By definition of RMSD , for any t , R ( t ) and p ( t ) minimize
[Equation]
For infinitesimal t = dt , the RHS becomes
[Equation]
where we have used R (0) = I , B (0 , θ , x ) = x , and p (0) = 0 . Thus, we see that RMSD alignment implies that the derivatives of R ( t ) , p ( t ) minimize the norm of
[Equation]
This expression represents the instantaneous velocity of the points y i at t = 0 .
We now show that minimizing the velocity results in zero linear and angular momentum.
We abbreviate B ′ ( t, θ , x (0)) i :=
b i and p ′
= v .
Further, let r i
=
x i − ¯ x , such that the rotational contribution to the velocity can be written in terms of an angular velocity vector ω .
With this, at t = {+
+}
we have [Equation]
We thus obtain the squared norm as
[Equation]
where we have used the fact that (cid:80) i r i = 0 and where I ( r )
=
( (cid:80) i r i · r i )
I − (cid:80) i r i r
Ti is the 3 × 3 inertia tensor .
To minimize the squared norm (and thus the norm itself)
[Equation]
we set gradients with respect to v , ω to zero. This gives
[Equation]
Now with y ′ i
=
b i + ω
× r i + v we evaluate the linear momentum
[Equation]
which is zero by direct substitution of v .
Similarly, we evaluate the angular momentum
[Equation]
which is zero by direct substitution of ω .
Thus, the linear and angular momentum are zero at t =for arbitrary x .
Note that since we did not use the particular form of B ( t θ , x ) in the above proof, we have shown that RMSD alignment can be used to disentangle rotations and translations from the infinitesimal action of any arbitrary function.
A. P ROOF OF P ROPOSITION
Proposition 2.
For a given seed conformation c , the map A ( · , c ) : P → M c is a bijection.
Proof.
Since we defined M c = { A ( g, c ) | g ∈ P } , A ( · , c ) is automatically surjective.
We now show that it is injective.
Assume for the sake of contradiction that A ( · , c ) is not injective, so that there exist elements of the product space g 1 , g 2 ∈ P with g 1 ̸
= g 2 but with A ( g 1 , c )
=
A ( g 2 , c ) =
c ′ .
That is,
[Equation]
which we abbreviate as c (1)
=
c (2) .
Since only A tr changes the center of mass (cid:80)
i c i
/n , we have (cid:80) i c (1) i /n
= (cid:80)
i c
i /n
+ r 1 and (cid:80) i c (2)
i /n
=
(cid:80)
i c
i /n
+ r 2 .
However, since c (1) =
c (2) , this implies r 1 = r 2 .
Next, consider the torsion angles τ 1 = ( τ (1)1 , . . .
τ (1) m ) of c (1) corresponding to some choice of dihedral angles at each rotatable bond.
Because A tr and A rot are rigid-body motions, only A tor changes the dihedral angles; in particular, by definition we have τ (1) i ∼ =
τ i + θ (1)
i mod 2 π and τ (2) i ∼ =
τ i + θ (2)
i mod 2 π for all i = 1 , . . .
m .
However, because τ (1) i = τ (2) i , this means θ (1) i ∼ = θ (2) i for all i and therefore θ 1 = θ 2 (as elements of SO (2) m ).
Now denote c
⋆ =
A tor ( θ 1 , c ) =
A tor ( θ 2 , c ) and apply A tr ( − r 1 , · ) =
A tr ( − r 2 , · ) to both sides of Equation 12.
We then have
[Equation]
which further leads to
[Equation]
In general, this does not imply that R 1 = R 2 .
However, R 1 ̸
= R 2 is possible only if c ⋆ is degenerate , in the sense that all points are collinear along the shared axis of rotation of R 1 , R 2 .
However, in practice, conformers never consist of a collinear set of points, so we can safely assume R
= R 2 .
We now have ( r 1 , R 1 , θ 1 ) =
( r 2 , R 2 , θ 2 ) , or g 1 = g 2 , contradicting our initial assumption.
We thus conclude that A ( · , c ) is injective, completing the proof.
B T RAINING AND I NFERENCE
In this section we present the training and inference procedures of the diffusion generative model.
First, however, there are a few subtleties of the generative approach to molecular docking that are worth mentioning.
Unlike the standard generative modeling setting where the dataset consists of many samples drawn from the data distribution, each training example ( x ⋆ , y ) of protein structure y and ground-truth ligand pose x
⋆ is the only sample from the corresponding conditional distribution p x ⋆ ( · | y ) defined over M x ⋆ .
Thus, the innermost training loop iterates over distinct conditional distributions p x ⋆ ( · | y ) , along with a single sample from that distribution, rather than over samples from a common data distribution p data ( x ) .
As discussed in Section 4, during inference, c is the ligand structure generated with a method such as RDKit.
However, during training we require M c = M x ⋆ in order to define a bijection between c ∈ M x ⋆ and P .
If we take c ∈ M x ⋆ , there will be a distribution shift between the manifolds
M c considered at training time and those considered at inference time.
To circumvent this issue, at training time we predict c with RDKit and replace x ⋆ with arg min x † ∈M c RMSD( x ⋆ , x † ) using the conformer matching procedure described in Jing et al.
The above paragraph may be rephrased more intuitively as follows: during inference, the generative model docks a ligand structure generated by RDKit, keeping its non-torsional degrees of freedom (e.g., local structures) fixed.
At training time, however, if we train the score model with the local structures of the ground truth pose, this will not correspond to the local structures seen at inference time.
Thus, at training time, we replace the ground truth pose by generating a ligand structure with
RDKit and aligning it to the ground truth pose while keeping the local structures fixed.
With these preliminaries, we now continue to the full procedures (Algorithms 1 and 2).
The training and inference procedures of a score-based diffusion generative model on a Riemannian manifold consist of (1) sampling and regressing against the score of the diffusion kernel during training; and (2) sampling a geodesic random walk with the score as a drift term during inference [De Bortoli et al., 2022].
Because we have developed the diffusion process on P but continue to provide the score model with elements in M c ⊂ R 3 n , the full training and inference procedures involve repeatedly interconverting between the two spaces using the bijection given by the seed conformation c .
Input: Training pairs { ( x ⋆ , y ) } , RDKit predictions { c } foreach c , x ⋆ , y do
Let x 0 ← arg min x † ∈M c RMSD( x ⋆ , x † ) ;
Compute ( r 0 , R 0 , θ 0 ) ← A − 1 c ( x 0 ) ;
Sample t ∼ Uni([0 , 1]) ;
Sample ∆ r , ∆ R, ∆ θ from diffusion kernels p tr t ( · | 0) , p rot t ( · | 0) , p tor t ( · | 0) ;
Set r t ← r 0 + ∆ r ;
Set R t ← (∆ R ) R 0 ;
Set θ t ← θ 0 + ∆ θ mod 2 π ;
Compute x t ← A (( r t , R t , θ t ) , c ) ;
Predict scores α ∈ R 3 , β ∈ R 3 , γ ∈ R m = s ( x t , c , y , t ) ;
Take optimization step on loss
L = ||
α − ∇ p tr t (
[Equation]
[Equation] [Equation] [Equation]
+
[Equation] [Equation]
0) ||
Input: RDKit prediction c , protein structure y (both centered at origin)
Output: Sampled ligand pose x
Sample θ N ∼ Uni( SO (2) m ) , R N ∼ Uni( SO (3)) , r N ∼ N (0 , σ 2 tor ( T )) ;
Let x N =
A (( r N , R N , θ N ) , c ) ; for n ← N to 1 do
Let t = n/N and ∆ σ 2 tr = σ 2 tr ( n/N ) − σ 2 tr (( n − 1) /N ) and similarly for ∆ σ 2 rot , ∆ σ 2 tor ;
Predict scores α ∈ R 3 , β ∈ R 3 , γ ∈ R m ←
y
∆ σ
N
∆ σ
N
∆
However, as noted in the main text, the dependence of these procedures on the exact choice of c is potentially problematic, as it suggests that at inference time, the model distribution may be different depending on the orientation and torsion angles of c .
Simply removing the dependence of the score model on c is not sufficient since the update steps themselves still occur on P and require a choice of c to be mapped to M c .
However, notice that the update steps—in both training and inference— consist of (1) sampling the diffusion kernels at the origin; (2) applying these updates to the point on P ; and (3) transferring the point on P to M c via A ( · , c ) .
Might it instead be possible to apply the updates to 3D ligand poses x ∈ M c directly ?
It turns out that the notion of applying these steps to ligand poses “directly” corresponds to the formal notion of group action .
The operations A tr , A rot , A tor that we have already defined are formally group actions if they satisfy A ( · ) ( g 1 g 2 , x ) =
A ( g 1 , A
( g 2 , x )) .
While true for A tr , A rot , this is not generally true for A tor if we take SO (2) m to be the direct product group; however, the approximation is increasingly good as the magnitude of the torsion angle updates decreases.
If we then define P to be the direct product group of its constituent groups, A is a group action of P on M c , as the operations of A tr , A rot , A tor commute and are (under the approximation) individually group actions.
The implication of A being a group action can be seen as follows.
Let δ =
g b g − 1 a be the update which brings g a ∈ P to g b ∈ P via left multiplication, and let x a , x b be the corresponding ligand poses A ( g a , c ) , A ( g b , c ) .
Then
[Equation]
which means that the updates δ can be applied directly to x a using the operation A .
The training and inference procedures then become Algorithm 3 and 4 below.
The initial conformer c is no longer used, except in the initial steps to define the manifold—to find the closest point to x ⋆ in training, and to sample x N from the prior over M c in inference.
Conceptually speaking, this procedure corresponds to “forgetting” the location of the origin element on M c , which is permissible because a change of the origin to some equivalent seed c ′ ∈
M c merely translates—via right multiplication by A − 1 c ( c ′ ) —the original and diffused data distributions on P , but does not cause any changes on M c itself.
The training and inference routines involve updates—formally left multiplications—to group elements, but as left multiplication on the group corresponds to group actions on M c , the updates can act on M c directly, without referencing the origin c .
We find that the approximation of A as a group action works quite well in practice and use Algorithms 3 and 4 for all training and experiments discussed in the paper.
Of course, disentangling the torsion updates from rotations in a way that makes A tor exactly a group action would justify the procedure further, and we regard this as a possible direction for future work.
Algorithm
Input: Training pairs { ( x ⋆ , y ) } , RDKit predictions { c } foreach c , x ⋆ , y do
Let x 0 ← arg min x † ∈M c RMSD( x ⋆ , x † ) ;
Sample t ∼ Uni([0 , 1]) ;
Sample ∆ r , ∆ R, ∆ θ from diffusion kernels p tr t ( · | 0) , p rot t ( · | 0) , p tor t ( · | 0) ;
Compute x t ← A ((∆ r , ∆ R, ∆ θ ) , x 0 ) ;
Predict scores α ∈ R 3 , β ∈ R 3 , γ ∈ R m = s ( x t , y , t ) ;
Take optimization step on loss
L =
[Equation]
tr
[Equation]
2 +
[Equation]
− ∇ p rot t
[Equation]
Sample θ N ∼ Uni( SO (2) m ) , R N ∼ Uni( SO (3)) , r N ∼ N (0 , σ 2 tor ( T )) ;
Let x N =
A (( r N , R N , θ N ) , c ) ; for n ← N to 1 do
Let t = n/N and ∆ σ 2 tr = σ 2 tr ( n/N ) − σ 2 tr (( n − 1) /N ) and similarly for ∆ σ 2 rot , ∆ σ 2 tor ;
Predict scores α ∈ R 3 , β ∈ R 3 , γ ∈ R m ← s ( x n , y , t ) ;
Sample
Set ∆ r ← r 0 + ∆ σ 2 tr α + z tr ;
Set ∆ R ← R
∆ σ 2 rot β
+ z rot ) ;
Set ∆
← tor ;
Compute n
Return
C A RCHITECTURE D ETAILS
As summarized in Section 4.5, we use convolutional networks based on tensor products of irreducible representations (irreps) of SO(3)
[Thomas et al., 2018] as architecture for both the score and confidence models.
In particular, these are implemented using the e3nn library [Geiger et al., 2020].
Below, ⊗ w refers to the spherical tensor product of irreps with path weights w , and ⊕ refers to normal vector addition (with possibly padded inputs).
Features have multiple channels for each irrep.
Both the architectures can be decomposed into three main parts: embedding layer, interaction layers, and output layer.
We outline each of them below.
C. E MBEDDING LAYER
Geometric heterogeneous graph.
Structures are represented as heterogeneous geometric graphs with nodes representing ligand (heavy) atoms, receptor residues (located in the position of the αcarbon atom), and receptor (heavy) atoms (only for the confidence model).
Because of the high number of nodes involved, it is necessary for the graph to be sparsely connected for runtime and memory constraints.
Moreover, sparsity can act as a useful inductive bias for the model, however, it is critical for the model to find the right pose that nodes that might have a strong interaction in the final pose to be connected during the diffusion process.
Therefore, to build the radius graph, we connect nodes using cutoffs that are dependent on the types of nodes they are connecting:
Ligand atoms-ligand atoms, receptor atoms-receptor atoms, and
ligand atoms-receptor
atoms interactions all use a cutoff of 5 ˚A, standard practice for atomic interactions.
For the ligand atoms ligand atoms interactions we also preserve the covalent bonds as separate edges with some initial embedding representing the bond type (single, double, triple and aromatic).
For receptor atoms-receptor atoms interactions, we limit at 8 the maximum number of neighbors of each atom.
Note that the ligand atoms-receptor atoms only appear in the confidence model where the final structure is already set.
Receptor residues-receptor residues use a cutoff of 15 ˚A with 24 as the maximum number of neighbors for each residue.
Receptor residues-ligand atoms use a cutoff of 20 + 3 ∗ σ tr ˚A where σ tr represents the current standard deviation of the diffusion translational noise present in each dimension (zero for the confidence model).
Intuitively this guarantees that with high probability, any of the ligands and receptors that will be interacting in the final pose the diffusion model converges to are connected in the message passing at every step.
Finally, receptor residues are connected to the receptor atoms that form the corresponding amino-acid.
Node and edge featurization.
For the receptor residues, we use the residue type as a feature as well as a language model embedding obtained from ESM2 [Lin et al., 2022].
The ligand atoms have the following features: atomic number; chirality; degree; formal charge; implicit valence; the number of connected hydrogens; the number of radical electrons; hybridization type; whether or not it is in an aromatic ring; in how many rings it is; and finally, 6 features for whether or not it is in a ring of size 3, 4, 5, 6, 7, or 8.
These are concatenated with sinusoidal embeddings of the diffusion time [Vaswani et al., 2017] and, in the case of edges, radial basis embeddings of edge length
[Sch ¨ utt et al., 2017].
These scalar features of each node and edge are then transformed with learnable two-layer
MLPs (different for each node and edge type) into a set of scalar features that are used as initial representations by the interaction layers.
Notation Let ( V , E ) represent the heterogeneous graph, with V =
( V ℓ , V r ) respectively ligand atoms and receptor residues (receptor atoms V a , present in the confidence model, are for simplicity not included here), and similarly E =
( E ℓℓ , E ℓr , E rℓ , E rr ) .
Let h a be the node embeddings (initially only scalar channels) of node a , e ab the edge embeddings of ( a, b ) , and µ ( r ab ) radial basis embeddings of the edge length.
Let σ 2 tr , σ 2 rot , and σ 2 tor represent the variance of the diffusion kernel in each of the three components: translational, rotational and torsional.
C. I NTERACTION LAYERS
At each layer, for every pair of nodes in the graph, we construct messages using tensor products of the current node features with the spherical harmonic representations of the edge vector.
The weights of this tensor product are computed based on the edge embeddings and the scalar features—denoted h 0 a —of the outgoing and incoming nodes.
The messages are then aggregated at each node and used to update the current node features.
For every node a of type t a :
[Equation]
b ∈N ( t ) a
Y (ˆ r ab ) ⊗ ψ ab h b (cid:33) with ψ ab =
Ψ
( t a ,t ) ( e ab , h 0 a , h 0 b ) (16)
Here, t indicates an arbitrary node type, N ( t ) a = { b | ( a
, b ) ∈
E t a t } the neighbors of a of type t , Y are the spherical harmonics up to ℓ = 2 , and BN the (equivariant) batch normalisation.
The orders of the output are restricted to a maximum of ℓ = 1 .
All learnable weights are contained in Ψ , a dictionary of MLPs, which uses different sets of weights for different edge types (as an ordered pair so four types for the score model and nine for the confidence) and different rotational orders.
C. O UTPUT LAYER
The ligand atom representations after the final interaction layer are used in the output layer to produce the required outputs.
This is where the score and confidence architecture differ significantly.
On one hand, the score model’s output is in the tangent space T r T 3 ⊕ T R SO (3) ⊕ T θ SO (2) m .
This corresponds to having two SE (3) -equivariant output vectors representing the translational and rotational score predictions and m SE (3) -invariant output scalars representing the torsional score.
For each of these, we design final tensor-product convolutions inspired by classical mechanics.
On the other hand, the confidence model outputs a single SE (3) -invariant scalar representing the confidence score.
Below we detail how each of these outputs is generated.
Translational and rotational scores.
The translational and rotational score intuitively represent, respectively, the linear acceleration of the center of mass of the ligand and the angular acceleration of the rest of the molecule around the center.
Considering the ligand as a rigid object and given a set of forces and masses at each ligand, a tensor product convolution between the atoms and the center of mass would be capable of computing the desired quantities.
Therefore, for each of the two outputs, we perform a convolution of each of the ligand atoms with the (unweighted) center of mass c .
[Equation]
[Equation]
We restrict the output of v to a single odd and a single even vectors (for each of the two scores).
Since we are using coarse-grained representations of the protein, the score will neither be even nor odd; therefore, we sum the even and odd vector representations of v .
Finally, the magnitude (but not direction) of these vectors is adjusted with an MLP taking as input the current magnitude and the sinusoidal embeddings of the diffusion time.
Finally, we (revert the normalization) by multiplying the outputs by 1 /σ tr for the translational score and by the expected magnitude of a score in SO (3) with diffusion parameter σ rot (precomputed numerically).
Torsional score.
To predict the m SE (3) -invariant scalar describing the torsional score, we use a pseudotorque layer similar to that of Jing et al.
This predicts a scalar score δτ for each rotatable bond from the per-node outputs of the atomic convolution layers.
For rotatable bond g = ( g 0 , g 1 ) and b ∈ V ℓ , let r gb and ˆ r
gb be the magnitude and direction of the vector connecting the center of bond g and b .
We construct a convolutional filter T g for each bond g from the tensor product of the spherical harmonics with a ℓ = 2 representation of the bond axis ˆ r g :
[Equation]
(18) ⊗ is the full (i.e., unweighted) tensor product as described in Geiger & Smidt [2022], and the second term contains the spherical harmonics up to ℓ = 2 (as usual).
This filter (which contains orders up to ℓ = 3 ) is then used to convolve with the representations of every neighbor on a radius graph:
[Equation]
with γ gb
[Equation]
Here, N g = { b | ( g, b ) ∈ E τ } and Υ ( τ ) and Γ are MLPs with learnable parameters.
Since unlike
Jing et al.
[2022], we use coarse-grained representations the parity also here is neither even nor odd, the irreps in the output are restricted to arrays both even h ′ g and odd h ′′ g scalars.
Finally, we produce a single scalar prediction for each bond:
[Equation]
where Π is a two-layer MLP with tanh nonlinearity and no biases.
This is also “denormalized” by multiplying by the expected magnitude of a score in SO (2) with diffusion parameter σ tor .
Confidence output.
The single SE (3) -invariant scalar representing the confidence score output is instead obtained by concatenating the even and odd final scalar representation of each ligand atom, averaging these feature vectors among the different atoms, and finally applying a three layers MLP (with batch normalization).
D E XPERIMENTAL D ETAILS
In general, all our code is available at https://anonymous.4open.science/r/
DiffDock .
This includes running the baselines, runtime calculations, training and inference scripts for D IFF D OCK , the PDB files of D IFF D OCK ’s predictions for all 363 complexes of the test set, and visualization videos of the reverse diffusion.
D. E XPERIMENTAL S ETUP
Data.
We use the molecular complexes in PDBBind [Liu et al., 2017] that were extracted from the
Protein Data Bank (PDB)
[Berman et al., 2003].
We employ the time-split of PDBBind proposed by St ¨ ark et al.
[2022] with 17k complexes from 2018 or earlier for training/validation and 363 test structures from 2019 with no ligand overlap with the training complexes.
This is motivated by the further adoption of the same split [Lu et al., 2022] and the critical assessment of PDBBind splits by Volkov et al.
[2022] who favor temporal splits over artificial splits based on molecular scaffolds or protein sequence/structure similarity.
For completeness, we also report the results on protein sequence similarity splits in Appendix F.
We download the PDBBind data as it is provided by EquiBind from https://zenodo.org/record/6408497 .
These files were preprocessed with Open Babel before adding any potentially missing hydrogens, correcting hydrogens, and correctly flipping histidines with the reduce library available at https://github.com/rlabduke/reduce .
Metrics.
To evaluate the generated complexes, we compute the heavy-atom RMSD between the predicted and the crystal ligand atoms when the protein structures are aligned.
To account for permutation symmetries in the ligand, we use the symmetry-corrected RMSD of sPyRMSD
[Meli &
Biggin, 2020].
For these RMSD values, we report the percentage of predictions that have an RMSD that is less than 2 ˚A.
We choose 2 ˚A since much prior work considers poses with an RMSD less that 2 ˚A as “good” or successful [Alhossary et al., 2015; Hassan et al., 2017; McNutt et al., 2021].
This is a chemically relevant metric, unlike the mean RMSD as detailed in Section 3 since for further downstream analyses such as determining function changes, a prediction is only useful below a certain
RMSD error threshold.
Less relevant metrics such as the mean RMSD are provided in Appendix F.
D. I MPLEMENTATION DETAILS : HYPERPARAMETERS , TRAINING , AND RUNTIME MEASUREMENT
Training Details.
We use Adam [Kingma & Ba, 2014] as optimizer for the diffusion and the confidence model.
The diffusion model with which we run inference uses the exponential moving average of the weights during training, and we update the moving average after every optimization step with a decay factor of 0.999.
The batch size is 16.
We run inference with 20 denoising steps on 500 validation complexes every 5 epochs and use the set of weights with the highest percentage of RMSDs less than 2 ˚A as the final diffusion model.
We trained our final score model on four 48GB RTX A
GPUs for 850 epochs (around 18 days).
The confidence model is trained on a single 48GB GPU.
For inference, only a single GPU is required.
Scaling up the model size seems to improve performance and future work could explore whether this trend continues further.
For the confidence model uses the validation cross-entropy loss is used for early stopping and training only takes 75 epochs.
Code to reproduce all results including running the baselines or to perform docking calculations for new complexes is available at https://anonymous.4open.science/r/DiffDock .
Hyperparameters.
For determining the hyperparameters of D IFF D OCK ’s score model, we trained smaller models (3.97 million parameters) that fit into 48GB of GPU RAM before scaling it up to the final model (20.24 million parameters) that was trained on four 48GB GPUs.
The smaller models were only trained for 250 or 300 epochs, and we used the fraction of predictions with an
RMSD below 2 ˚A on the validation set to choose the hyperparameters.
Table 2 shows the main hyperparameters we tested and the final parameters of the large model we use to obtain our results.
We only did little tuning for the minimum and maximum noise levels of the three components of the diffusion.
For the translation, the maximum standard deviation is 19 ˚A.
We also experimented with second-order features for the Tensor Field Network but did not find them to help.
The complete set of hyperparameters next to the main ones we describe here can be found in our repository.
From the start we have divided the inference schedule into 20 time steps, the effect of using more or fewer steps for inference is discussed in Appendix F.3.
As we found that the large-scale diffusion models overfit the training data on low-levels of noise we stop the diffusion early after 18 steps.
At the last diffusion step no noise is added.
The confidence model has 4.77 million parameters and the parameters we tried are in Table 3.
We generate 28 different training poses for the confidence model (for which it predicts whether or not they have an RMSD below 2 ˚A) with a small score model. The score model used to generate the training samples for the confidence model does not need to be the same one that the model will be applied to at inference time.
[Table]
[Table] [Table]
Runtime.
Similar to all the baselines, the preprocessing times are not included in the reported runtimes.
For D IFF D OCK the preprocessing time is negligible compared to the rest of the inference time where multiple reverse diffusion steps are performed.
Preprocessing mainly consists of a forward pass of ESM2 to generate the protein language model embeddings, RDKit’s conformer generation, and the conversion of the protein into a radius graph.
We measured the inference time when running on an RTX A100 40GB GPU when generating 10 samples.
The runtimes we report for generating 40 samples and ranking them are extrapolations where we multiply the runtime for 10 samples by 4.
In practice, this only gives an upper bound on the runtime with 40 samples, and the actual runtime should be faster.
Statistical intervals and significance.
In order to provide estimates about the variance of the performance measures reported, in Tables 1 and 7 we report the standard deviation of the performance under 1000 independent resamples with replacement of the test set (bootstrapping).
For determining the statistical significance of the superior performance of our method we used the paired two-sample t-test implemented in scipy [Virtanen et al., 2020].
For Autodock Vina, we took the results from
Lu et al. [2022], and therefore we were not able to run estimates of the intervals. [Table] D. B ASELINES : IMPLEMENTATION , USED SCRIPTS , AND RUNTIME DETAILS
Our scripts to run the baselines are available at https://anonymous.4open.science/r/
DiffDock .
For obtaining the runtimes of the different methods, we always used 16 CPUs except for GLIDE as explained below.
The runtimes do not include any preprocessing time for any of the methods.
For instance, the time that it takes to run P2Rank is not included for TANKBind [Table] and
P2Rank + SMINA/GNINA since this receptor preparation only needs to be run once when docking many ligands to the same protein.
In applications where different receptors are processed (such as reverse screening), the experienced runtimes for TANKBind and P2Rank + SMINA/GNINA will thus be higher.
We note that for all these baselines we have used the default hyperparameters unless specified differently below.
Modifying some of these hyperparameters (for example the scoring method’s exhaustiveness) will change the runtime and performance tradeoffs (e.g., if the searching routine is left running for longer then better poses are likely to be found), however, we leave these analyses to future work.
SMINA [Koes et al., 2013] improves Autodock Vina with a new scoring-function and userfriendliness.
The default parameters were used with the exception of setting --num modes 10 .
To define the search box, we use the automatic box creation option around the receptor with the default buffer of 4 ˚A on all 6 sides.
GNINA [McNutt et al., 2021] builds on SMINA by additionally using a learned 3D CNN for scoring.
The default parameters were used with the exception of setting --num modes 10 .
To define the search box, we use the automatic box creation option around the receptor with the default buffer of 4 ˚A on all 6 sides.
QuickVina-W [Hassan et al., 2017] extends the speed-optimized QuickVina
[Alhossary et al., 2015] for blind docking.
We reuse the numbers from St¨ark et al.
[2022] which had used the default parameters except for increasing the exhaustiveness to 64.
The files were preprocessed with the prepare ligand4.py and prepare receptor4.py scripts of the MGLTools library as it is recommended by the QuickVina-W authors.
Autodock Vina [Trott & Olson, 2010] is older docking software that does not perform as well as the other more recent search-based baselines, but it is a well-established tool.
We reuse the numbers reported in TANKBind [Lu et al., 2022]
GLIDE [Halgren et al., 2004] is a strong heavily used commercial docking tool.
These methods all use biophysics based scoring-functions.
We reuse the numbers from St¨ark et al.
[2022] since we do not have a license.
Running GLIDE involves running their command line tools for preprocessing the structures into the files required to run the docking algorithm.
As explained by St¨ark et al.
[2022], the very high runtime of GLIDE with 1405 seconds per complex is partially explained by the fact that GLIDE only uses a single thread when processing a complex.
This fact and the parallelization options of GLIDE are explained here https://www.schrodinger.com/kb/1165 .
With GLIDE, it is possible to start data-parallel processes that compute the docking results for a different complex in parallel.
However, each process also requires a separate software license.
EquiBind [St¨ark et al., 2022], we reuse the numbers reported in their paper and generate the predictions that we visualize with their code at https://github.com/HannesStark/EquiBind .
TANKBind [Lu et al., 2022], we use the code associated with the paper at https://github. com/luwei0917/TankBind .
The runtimes do not include the runtime of P2Rank or any preprocessing steps.
In Table 1 we report two runtimes (0.72/2.5 sec).
The first is the runtime when making only the top-1 prediction and the second is for producing the top-5 predictions.
Producing only the top-1 predictions is faster since TANKBind produces distance predictions that need to be converted to coordinates with a gradient descent algorithm and this step only needs to be run once for the top-1 prediction, while it needs to be run 5 times for producing 5 outputs.
To obtain our runtimes we run the forward pass of TANKBind on GPU (0.28 seconds) with the default batch size of 5 that is used in their GitHub repository.
To compute the time the distances-to-coordinates conversion step takes, we run the file baseline run tankbind parallel.sh in our repository, which parallelizes the computation across 16 processes which we also run on an Intel Xeon Gold 6230 CPU.
This way, we obtain 0.44 seconds runtime for the conversion step of the top-1 prediction (averaged over the 363 complexes of the testset).
P2Rank [Kriv´ak & Hoksza, 2018], is a tool that predicts multiple binding pockets and ranks them.
We use it for running TANKBind and P2Rank + SMINA/GNINA.
We download the program from https://github.com/rdk/p2rank and run it with its default parameters.
EquiBind + SMINA/GNINA [St ¨ ark et al., 2022], the bounding box in which GNINA/SMINA searches for binding poses is constructed around the prediction of EquiBind with the --autobox ligand option of GNINA/SMINA.
EquiBind is thus used to find the binding pocket and SMINA/GNINA to find the exact final binding pose.
We use --autobox add 10 to add an additional 10 ˚A on all 6 sides of the bounding box following [St ¨ ark et al., 2022].
P2Rank + SMINA/GNINA.
The bounding box in which GNINA/SMINA searches for binding poses is constructed around the pocket center that P2Rank predicts as the most likely binding pocket.
P2Rank is thus used to find the binding pocket and SMINA/GNINA to find the exact final binding pose.
The diameter of the search box is the diameter of a ligand conformer generated by RDKit with an additional 10 ˚A on all 6 sides of the bounding box.
E A DDITIONAL D ISCUSSION E. A CCESS TO B OUND P ROTEIN S TRUCTURE
One limitation of D IFF D OCK is that it assumes access to the bound structure of the protein known as holo-structure.
Although most of the literature in molecular docking makes this assumption, in practice, one often only has access to the unbound apo protein structure or the holo structure of the protein bound to a different ligand.
Tackling the problem of binding to apo structures is challenging due to the limited amount of data of unbound structures that have an atom-to-atom correspondence to the holo structure with which they could be aligned.
In D IFF D OCK the limitation of docking to holo structures may be less pronounced than for the search based docking methods that we compare against since D IFF D OCK ’s score model only uses the positions of the alpha carbon atoms (and not the side chain atoms).
Thus D IFF D OCK would also work well for binding to apo structures when most of the conformational change during binding lies in the side chains and the backbone stays mostly rigid.
However, in order to fully model binding to apo structures, one needs to additionally model protein flexibility, we leave the full treatment of this problem to future work.
E. T ORSIONAL VS E UCLIDEAN F LEXIBILITY
A ligand pose (and more generally speaking, a molecule conformation) consists of a position in 3D-space R 3 for each of n atoms of the molecule and can thus be considered as an element of R 3 n .
Each such pose (or conformation), can alternatively be described in terms of its bond lengths, angles, and torsion angles (see Jing et al.
[2022], Appendix A for a more formal discussion).
Because of the nature of covalent interactions, bond lengths and angles (local structures) are highly energetically constrained, and any specific bond length or angle in a molecule will take on only a very narrow range of values, whether in isolation or bound to a protein receptor.
Thus, ligand poses or conformations in which bond lengths or angles are strained —i.e., differ significantly from their standard values—can be easily judged to be energetically unfavorable.
On the other hand, the energetic profile of varying torsion angles is significantly smoother, as they depend in large part on weaker, noncovalent interactions.
A change of chemical environment, or an interaction with another molecule (such as a protein) can alter these profiles.
Thus, we say that there is significant flexibility in the torsion angles, in contrast to the more rigid local structures.
Since bond lengths and angles are highly constrained, the set of chemically plausible ligand poses is a very small subset of all possible assignments of atoms to R 3 ; that is, a very restricted subset of R 3 n .
The set of ligand poses that satisfy all the bond length and angle constraints with equality appears as a lower-dimensional manifold .
To a good approximation, all actual ligand poses lie on this manifold.
Thus, we are interested in developing a generative model on this manifold, as any sample outside of it is chemically nonsensical.
Futher, the constrained values of standard bond lengths and angles are easily and quickly predicted using standard cheminformatics routines, such as those in RDKit.
Indeed, far simpler rules of thumb—a fixed length for each type of bonding pair, and fixed angles determined solely by molecular geometry—are already quite accurate and widely taught.
Consequently, the manifold of plausible poses is very easy to find—one merely has to generate any plausible conformation or ligand pose with RDKit.
In previous work on conformer generation, Jing et al.
[2022] verified that the manifolds corresponding to local structures generated by RDKit are, on average, less than 0.5 ˚A RMSD away from the true conformations.
In contrast, torsional angles are much more difficult to predict and constitute the vast majority of the difficulty and error of conformer generation methods.
The facts that (1) the space of plausible ligand poses is described by a manifold and (2) this manifold is easy to find, makes it sensible to develop a diffusion generative model on the manifold rather than the full ambient space R 3 n .
This significantly reduces the dimensionality of the state space, and thus of the function that the score network needs to approximate.
Torsional diffusion [Jing et al., 2022] developed precisely such a model for conformer generation.
The significantly better performance of torsional diffusion over prior Euclidean (i.e., ambient space) diffusion models for the same task [Xu et al., 2021] suggested to us to leverage the same paradigm for molecular docking (which can be thought of as conformer generation conditioned on a receptor).
F A DDITIONAL R ESULTS F. P HYSICALLY PLAUSIBLE PREDICTIONS
[Table]
Due to the averaging phenomenon of regression-based methods such as TANKBind and EquiBind, they make predictions at the mean of the distribution.
If aleatoric uncertainty is present, such as in case of symmetric complexes, this leads to predicting the ligand to be at an un-physical state in the middle of the possible binding pockets as visualized in Figure 10.
The Figure also illustrates how
D IFF D OCK does not suffer from this issue and is able to accurately sample from the modes.
In the scenario when epistemic uncertainty about the correct ligand conformation is present, this often results in “squashed-up” predictions of the regression-based methods as visualized in Figure 5.
If there is uncertainty about the correct conformer, the square error minimizing option is to put all atoms close to the mean.
These averaging phenomena in the presence of either aleatoric or epistemic uncertainty cause the regression-based methods to often generate steric clashes and self intersections.
To investigate this quantitatively, we determine the fraction of test complexes for which the methods exhibit steric clashes.
We define a ligand as exhibiting a steric clash if one of its heavy atoms is within 0.4 ˚A of a heavy receptor atom.
This cutoff is used by protein quality assessment tools and in previous literature [Ramachandran et al., 2011].
Table 4 shows that D IFF D OCK , as a generative model, produces fewer steric clashes than the regression-based baselines.
We generally observe no unphysical predictions from D IFF D OCK unlike the self intersections that, e.g., TANKBind produces (Figure 5) or its incorrect local structures (Figure 6).
This is also visible in the randomly chosen examples of
Figure 9 and can be examined in our repository, where we provide all predictions of D IFF D OCK for the test set.
F. F URTHER R ESULTS AND M ETRICS
In this section, we present further evaluation metrics on the results presented in Table 1.
In particular, for both top-1 (Table 5) and top-5 (Table 6) we report: 25th, 50th and 75th percentiles, the propor- tion below 2 ˚A and below 5 ˚A of both ligand RMSD and centroid distance.
Moreover, while Volkov et al.
[2022] advocated against artificial protein set splits and for time-based splits, for completeness, in Table 7 and Figure [Table] we report the performances of the different methods when evaluated exclusively on the portion of the test set where the UniProt IDs of the proteins are not contained in the data that is seen by D IFF D OCK in its training and validation
[Table]
[Table] 36.1 E QUI B IND 3. TANKB IND 2. 55.1 P2R ANK
[Table]
SMINA 2.
44.1 P2R ANK
[Table]
GNINA 1. [Table] [Table] [Table]
[Table] [Table] [Table] [Table]
[Table]
DiﬀDock GLIDE
GNINA SMINA QVinaW TANKBind
EquiBind
RMSD (Å) [Table] D [Figure]
[Table] [Figure] [Table] [Table]
F. A BLATION STUDIES
Below we report the performance of our method over different hyperparameter settings.
In particular, we highlight the different ways in which it is possible to control the tradeoff between runtime and accuracy in our method.
These mainly are: (1) model size, (2) diffusion time, and (3) diffusion samples.
Model size.
The final D IFF D OCK score model has 20.24 million parameters from its 6 convolution layers with 48 scalar and 10 vector features.
In Table 8 we show the results for a smaller score model with 5 convolutions, 24 scalar, and 6 vector features resulting in 3.97 million parameters that can be trained on a single 48GB GPU.
The confidence model used is the same for both score models.
We find that scaling up the model size helped improve performance which we did as far as possible using four 48GB GPUs for training.
Scaling the model size further is a promising avenue for future work.
Protein embeddings. As described in Section 4.5 and Appendix C, the architecture uses as initial features of protein residues the language model embeddings from ESM2 [Lin et al., 2022] in order for the model to more easily reason about the protein sequence. In Table 8 we show that while these provide some improvements they are not necessary to obtain state-of-the-art performance.
Diffusion steps.
Another hyperparameter determining the runtime of the method during inference is the number of steps we take during the reverse diffusion.
Since these are applied sequentially
D IFF D OCK ’s runtime scales approximately linearly with the number of diffusion steps.
In the rest of the paper, we always use 20 steps, but in Figure 8 we show how the performance of the model [Table] [Figure] [Table]
[Figure]
[Table] [Figure] varies with the number of steps. We note that the model reaches nearly the full performance even with just 10 steps, suggesting that the model can be sped up 2x with a small drop in accuracy.
Diffusion samples.
Given a score-based model and a number of steps for the diffusion model, it remains to be determined how many independent samples N to query from the diffusion model and then feed to the confidence model.
As expected the more samples the confidence model receives the more likely it is that it will find a pose that it is confident about and, therefore, the higher the performance.
The runtime of D IFF D OCK on GPU scales sublinearly until the different samples fit in parallel in the model (depends on the protein size and the GPU memory) and approximately linearly for larger sample sizes (however it can be easily parallelized across different GPUs).
In Figurewe show how the success rate for the top-1, top-5, and top-10 prediction change as a function of N .
For example, for the top-1 prediction, the proportion of the prediction with RMSD below 2 ˚A varies between 22% of a random sample of the diffusion model ( N = 1 ) to 38% when the confidence model is allowed to choose between 40 samples.
F. A FFINITY PREDICTION
To validate the quality of the predicted poses, we also do some experiments in predicting the binding affinity labels already present in PDBBind.
In this section we report some preliminary results on this task that show that a simple approach can already achieve results competitive with the state-ofthe-art.
We leave a more thorough and sophisticated analysis on how to best use the D IFF D OCK framework for binding affinity to future work.
Affinity prediction framework.
We train the binding affinity predictor by generating a fixed number of poses with the diffusion model and then feeding them to an affinity prediction model with architecture almost analogous to the confidence model.
This affinity prediction model takes in the poses as a single heterogeneous graph with a single receptor but multiple sets of ligand nodes, which have edges to the same receptor but not among themselves.
After the final interaction layer, the scalar representations of nodes in each ligand are aggregated with a mean pooling and passed through a set of dense layers (as it is done for the confidence prediction).
Then, the representations of the different ligands are aggregated using multiple permutation invariant aggregators (mean, maximum, minimum, and standard deviation) as in Corso et al.
[2020], and transformed with another set of dense layers producing a single output, the predicted affinity.
Dataset, baselines, and training.
To train we use PDBBind with the same splits used to train the diffusion and confidence models.
This provides for each of the complexes an affinity measure that consists of inhibiting concentration ( IC 50 ), inhibition constant ( K i ), or dissociation constant ( K d ) and its conversion to the − log K d /K i metric.
As baselines, we use a series of state-of-theart sequence-based and structure-based methods: TransformerCPI
[Chen et al., 2020], MONN [Li et al., 2020], IGN [Jiang et al., 2021], PIGNet [Moon et al., 2022], HOLOPTOT [Somnath et al., 2021], STAMPDPI [Wang et al., 2022] and TANKBind [Lu et al., 2022].
We take the baselines’ performances from Lu et al.
Prediction of − log K d /K i on PDBBind.
The baseline numbers are from Lu et al.
No hyperparameter tuning was performed for D IFF D OCK ’s performance.
[Table]
Results.
The results presented in Table 9 highlight how even preliminary results with a straightforward way of using D IFF D OCK ’s predictions for affinity prediction achieve a performance that is on par with the state-of-the-art.
We hope this can motivate future work on better integrating affinity prediction in the method and scaling to larger amounts of data
[Table]
[Figure]
We see that, since it is a generative model, D IFF D OCK is able to produce multiple correct modes and to sample around them.
Meanwhile, as a regression-based model, EquiBind is only able to predict a structure at the mean of the modes.
The complexes are unseen during training.
The PDB IDs in reading order: 6agt, 6gdy, 6ckl, 6dz3.