RFD3 (RFdiffusion3): Design of protein structures under complex constraints

RFD3 (RFdiffusion3) uses an atom-level diffusion framework to design proteins around ligands, nucleic acids, and other nonprotein molecular components. Because it generates complete atomic structures rather than only protein backbones, it can incorporate detailed geometric constraints for applications such as enzyme engineering and the design of proteins that bind small molecules or DNA.

Reference:

Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program. Sample session (based on Foundry's Protein-Protein Interface Design Tutorial).

[user@biowulf]$ sinteractive --mem=20g --cpus-per-task=8 --gres=gpu:a100:1
[user@cn3335 ~]$ module load rfdiffusion/rfd3
[+] Loading rfdiffusion  rfd3  on cn3335
[user@cn3335 ~]$ rfd3 --help

 Usage: rfd3 [OPTIONS]

 Run design using hydra config overrides and input files.

╭─ Options ──────────────────────────────────────────────────────
│ --install-completion          Install completion for the current shell.                                                                                                         
│ --show-completion             Show completion for the current shell, to copy it or customize the installation.                                                                  
│ --help                        Show this message and exit.                                                                                                                       
╰─────────────────────────────────────────────────────────────────
Download sample data:
[user@cn3335 ~]$ cd /data/$USER
[user@cn3335 ~]$ git clone https://github.com/RosettaCommons/foundry
Cloning into 'foundry'...
remote: Enumerating objects: 12529, done.
remote: Counting objects: 100% (219/219), done.
remote: Compressing objects: 100% (154/154), done.
remote: Total 12529 (delta 126), reused 70 (delta 65), pack-reused 12310 (from 3)
Receiving objects: 100% (12529/12529), 178.68 MiB | 76.88 MiB/s, done.
Resolving deltas: 100% (7727/7727), done.
Updating files: 100% (918/918), done.

Create directory for test and cd into it:
[user@cn3335 ~]$ mkdir rfd3_ppi_tutorial && cd rfd3_ppi_tutorial
Create your YAML file with the following contents:
[user@cn3335 ~]$ cat ppi_tutorial.yaml
insulinr:
  input: /data/$USER/foundry/models/rfd3/docs/input_pdbs/4zxb_cropped.pdb
  contig: 40-120,/0,E6-155
  length: 190-270
  select_hotspots:
    E64: CD2,CZ
    E88: CG,CZ
    E96: CD1,CZ
  infer_ori_strategy: hotspots
  is_non_loopy: true
Run RFD3:
[user@cn3335 ~]$ rfd3 design out_dir=ppi_tutorial_outputs/0 inputs=ppi_tutorial.yaml ckpt_path=$FOUNDRY_CHECKPOINT_DIRS/rfd3_latest.ckpt
14:46:47 DEBUG transforms: Debug mode is on
14:46:49 INFO rfd3.engine: [rank: 0] Outputs will be written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0.
14:46:49 INFO rfd3.engine: [rank: 0] Found 0 existing example IDs in the output directory (0 total).
Using bfloat16 Automatic Mixed Precision (AMP)
You are using a CUDA device ('NVIDIA A100-SXM4-80GB') that has Tensor Cores. To properly utilize them, you should set `torch.set_float32_matmul_precision('medium' | 'high')` which will trade-off precision for performance. For more details, read https://pytorch.org/docs/stable/generated/torch.set_float32_matmul_precision.html#torch.set_float32_matmul_precision
14:46:53 WARNING atomworks.io: We can't fix formal charges without building from templates, as we need to know the true number of hydrogens bonded to a given atom, not the inferred number. This may lead to occasional inaccuracies after adding inter-residue bonds. To avoid this and fix formal charges, set `add_missing_atoms = True`.
14:46:54 WARNING atomworks.io: The `extra_fields` argument will be ignored if there is no CIF file input.
14:47:42 INFO rfd3.engine: [rank: 0] Finished inference batch in 47.53 seconds.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_0 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_0.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_1 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_1.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_2 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_2.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_3 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_3.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_4 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_4.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_5 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_5.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_6 written to /data/username/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_6.
14:47:42 INFO rfd3.engine: [rank: 0] Outputs for ppi_tutorial_insulinr_0_model_7 written to /data/username/RFD3_TEST/rfd3_ppi_tutorial/ppi_tutorial_outputs/0/ppi_tutorial_insulinr_0_model_7.
End the interactive session:
[user@cn3335 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file, e.g. rfd3.sh:

#!/bin/sh

#SBATCH --job-name ppi
#SBATCH --cpus-per-task=8
#SBATCH --mem=20g
#SBATCH --gres=gpu:a100:1
#SBATCH -p gpu

module load rfdiffusion/rfd3
cd /data/$USER
git clone https://github.com/RosettaCommons/foundry 
mkdir rfd3_ppi_tutorial && cd rfd3_ppi_tutorial

rfd3 design out_dir=ppi_tutorial_outputs/0 inputs=ppi_tutorial.yaml

Submit this job using the Slurm sbatch command.

sbatch rfd3.sh