Skip to content

Sequences, streaming data, robotics, and scientific extensions · Entry index · SEQ013 · Model

DiffDock

A generative docking method sampling ligand poses relative to a protein using diffusion over translation, rotation, and rotatable-bond torsions. A separate confidence model ranks candidate poses.

Explained here Component demo, not a trained model CodeSplash's own run

In CodeSplash

Documented in the Academy only. There's no Set up button.

Availability
Explained here
Code example
Component demo, not a trained model
Who ran it
CodeSplash's own run
CodeSplash's run
The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review, but on a different version of the code. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

A generative docking method sampling ligand poses relative to a protein using diffusion over translation, rotation, and rotatable-bond torsions. A separate confidence model ranks candidate poses. It addresses geometric pose prediction, which is different from predicting binding affinity or establishing experimentally meaningful biological activity.

Question / hypotheses

Which ligand poses are plausible in a given protein context, and how should sampled poses be ranked? The model has no intrinsic significance-test H0. Evaluate pose accuracy, ranking reliability, geometric validity, and transfer to genuinely unseen protein/ligand regimes.

Architecture / computational structure

A geometric graph network conditions pose updates on ligand and receptor structure. Separate translation/rotation/torsion score components respect their different spaces, and a confidence network evaluates resulting samples. Representing every atom with unrestricted independent Gaussian Cartesian noise would describe a different construction.

Assumptions

Protein and ligand preparation, coordinates, chemistry, stereochemistry, and bond definitions must be meaningful. Restricted receptor flexibility and the ligand’s chosen internal degrees of freedom bound what can be represented. Dataset duplicates, related proteins, and near-identical ligands can distort random-split evaluation.

Formula / computational definition

The pose state belongs to R3×SO(3)×Tm\mathbb R^3\times SO(3)\times\mathbb T^m: translation, rotation, and mm torsion angles. Denoising score objectives train the respective manifold score components with suitable noise scales/weights. A confidence function cϕc_\phi ranks sampled poses; its value is not automatically a calibrated probability of binding.

Parameters and notation

Learned parameters: geometric score network, molecular/protein representations, and confidence-ranking network. Hyperparameters: diffusion schedule, pose sample count, inference steps, graph neighborhoods, torsion choices, and confidence training targets. More samples can improve search coverage while increasing cost and selection bias if evaluation rules are changed afterward.

Fitting, fine-tuning, and adaptation

Fit on curated complexes with protein-family-aware validation and reproducible preparation. Adapt score and confidence models separately if target-domain pose distributions or quality labels differ; keep atom/bond featurization compatible. Monitor chemistry and steric validity during fine-tuning, not only training loss. Do not fit confidence thresholds on final test complexes.

How to use and calibrate

Report top-1 and top-k pose success under a stated RMSD/alignment/symmetry convention, pose validity, and ranking calibration. Include failed preprocessing and unsupported ligands in coverage accounting. Evaluate alternate structures and unseen proteins where practical; a good crystallographic pose benchmark does not certify affinity or efficacy.

Example application

Use a synthetic torsional coordinate to illustrate why angles near positive and negative pi are close on a circle; later connect this to sampled rotatable-bond states.

Interpretation / pitfalls

Watch out

Python: the official DiffDock code and its documented chemistry/geometric dependencies; R: reticulate and downstream table/plot analysis. The paired example computes a periodic torsion difference only; it does not prepare molecules, run docking, or reproduce manifold diffusion.

Python and R code examples (dependencies/validation)

Python uses NumPy and the shared mse helper when called; base R uses the shared helper when called. Validation: Python component executed; R companion reviewed, not executed. Scope: the specific component described above, not the full model or its training.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — synthetic mathematical component, not a full-model implementation

Shared setup for this chapter
import numpy as np

def mse(a,b):
    a,b=np.asarray(a),np.asarray(b)
    if a.shape!=b.shape or a.size==0:
        raise ValueError("MSE needs nonempty equal shapes")
    return float(np.mean((a-b)**2))
a=np.deg2rad(179.); b=np.deg2rad(-179.)
wrapped=np.arctan2(np.sin(b-a),np.cos(b-a))
assert np.isclose(abs(np.rad2deg(wrapped)),2.)
result={"naive_degrees":float(np.rad2deg(b-a)),"circular_degrees":float(np.rad2deg(wrapped))}
print(result)
R

Component demo, not a trained model — synthetic mathematical component, not a full-model implementation

Shared setup for this chapter
mse <- function(a,b) {
  stopifnot(length(a)>0L, identical(dim(a),dim(b)), length(a)==length(b))
  mean((a-b)^2)
}
a <- 179*pi/180; b <- -179*pi/180
wrapped <- atan2(sin(b-a),cos(b-a))
stopifnot(abs(abs(wrapped*180/pi)-2)<1e-10)
result <- c(naive_degrees=(b-a)*180/pi,circular_degrees=wrapped*180/pi)
print(result)

Sources

From the CodeSplash reference, entry SEQ013.