Skip to content

Commit 18fe529

Browse files
authored
Merge branch 'RosettaCommons:main' into main
2 parents 5d76667 + fa34014 commit 18fe529

13 files changed

Lines changed: 2902 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python application
5+
6+
on:
7+
push:
8+
branches: [ "main", "github-ci" ]
9+
pull_request:
10+
branches: [ "main", "github-ci" ]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
ppi-scaffolds-test:
17+
18+
#runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
20+
#container: nvcr.io/nvidia/cuda:12.9.1-cudnn-runtime-ubuntu20.04
21+
container: nvcr.io/nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up Python 3.9
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: "3.9"
29+
# - name: Install dependencies
30+
# run: |
31+
# python -m pip install --upgrade pip
32+
# #pip install flake8 pytest
33+
# pip install pytest
34+
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
35+
# - name: Lint with flake8
36+
# run: |
37+
# # stop the build if there are Python syntax errors or undefined names
38+
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
39+
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
40+
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
41+
42+
- name: Install dependencies
43+
run: |
44+
apt-get update -qq && apt-get install -y --no-install-recommends \
45+
build-essential \
46+
git \
47+
curl \
48+
wget \
49+
ca-certificates
50+
51+
curl -LsSf https://astral.sh/uv/install.sh | sh
52+
. $HOME/.local/bin/env bash
53+
54+
uv python install 3.9
55+
uv venv
56+
uv pip install --no-cache-dir -q \
57+
dgl==1.0.2+cu116 -f https://data.dgl.ai/wheels/cu116/repo.html \
58+
torch==1.12.1+cu116 --extra-index-url https://download.pytorch.org/whl/cu116 \
59+
e3nn==0.3.3 \
60+
wandb==0.12.0 \
61+
pynvml==11.0.0 \
62+
git+https://github.com/NVIDIA/dllogger#egg=dllogger \
63+
decorator==5.1.0 \
64+
hydra-core==1.3.2 \
65+
pyrsistent==0.19.3 \
66+
pytest
67+
68+
uv pip install --no-cache-dir env/SE3Transformer
69+
uv pip install --no-cache-dir -e . --no-deps
70+
rm -rf ~/.cache # /app/RFdiffusion/tests
71+
72+
- name: Download weights
73+
run: |
74+
mkdir models
75+
wget -q -O models/Base_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/6f5902ac237024bdd0c176cb93063dc4/Base_ckpt.pt
76+
wget -q -O models/Complex_base_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/e29311f6f1bf1af907f9ef9f44b8328b/Complex_base_ckpt.pt
77+
wget -q -O models/Complex_Fold_base_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/60f09a193fb5e5ccdc4980417708dbab/Complex_Fold_base_ckpt.pt
78+
wget -q -O models/InpaintSeq_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/74f51cfb8b440f50d70878e05361d8f0/InpaintSeq_ckpt.pt
79+
wget -q -O models/InpaintSeq_Fold_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/76d00716416567174cdb7ca96e208296/InpaintSeq_Fold_ckpt.pt
80+
wget -q -O models/ActiveSite_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/5532d2e1f3a4738decd58b19d633b3c3/ActiveSite_ckpt.pt
81+
wget -q -O models/Base_epoch8_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/12fc204edeae5b57713c5ad7dcb97d39/Base_epoch8_ckpt.pt
82+
#optional
83+
wget -q -O models/Complex_beta_ckpt.pt http://files.ipd.uw.edu/pub/RFdiffusion/f572d396fae9206628714fb2ce00f72e/Complex_beta_ckpt.pt
84+
#original structure prediction weights
85+
wget -q -O models/RF_structure_prediction_weights.pt http://files.ipd.uw.edu/pub/RFdiffusion/1befcb9b28e2f778f53d47f18b7597fa/RF_structure_prediction_weights.pt
86+
87+
- name: Setup and Run ppi_scaffolds tests
88+
run: |
89+
tar -xvf examples/ppi_scaffolds_subset.tar.gz -C examples
90+
cd tests && uv run python test_diffusion.py
91+
92+
93+
# - name: Test with pytest
94+
# run: |
95+
# pytest

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ RFdiffusion is an open source method for structure generation, with or without c
4545
- [Generation of Symmetric Oligomers](#generation-of-symmetric-oligomers)
4646
- [Using Auxiliary Potentials](#using-auxiliary-potentials)
4747
- [Symmetric Motif Scaffolding.](#symmetric-motif-scaffolding)
48+
- [RFpeptides macrocycle design](#macrocyclic-peptide-design-with-rfpeptides)
4849
- [A Note on Model Weights](#a-note-on-model-weights)
4950
- [Things you might want to play with at inference time](#things-you-might-want-to-play-with-at-inference-time)
5051
- [Understanding the output files](#understanding-the-output-files)
@@ -466,6 +467,49 @@ Note that the contigs should specify something that is precisely symmetric. Thin
466467

467468
---
468469

470+
### Macrocyclic peptide design with RFpeptides
471+
<img src="./img/rfpeptides_fig1.png" alt="alt text" width="400px" align="right"/>
472+
We have recently published the RFpeptides protocol for using RFdiffusion to design macrocyclic peptides that bind target proteins with atomic accuracy (Rettie, Juergens, Adebomi, et al., 2025). In this section we briefly outline how to run this inference protocol. We have added two examples for running macrocycle design with the RFpeptides protocol. One for monomeric design, and one for binder design.
473+
474+
```
475+
examples/design_macrocyclic_monomer.sh
476+
examples/design_macrocyclic_binder.sh
477+
```
478+
#### RFpeptides binder design
479+
<img src="./img/rfpeptides_binder.png" alt="alt text" width="1100" align="center"/>
480+
481+
To design a macrocyclic peptide to bind a target, the flags needed are very similar to classic binder design, but with two additional flags:
482+
```
483+
#!/bin/bash
484+
485+
prefix=./outputs/diffused_binder_cyclic2
486+
487+
# Note that the indices in this pdb file have been
488+
# shifted by +2 in chain A relative to pdbID 7zkr.
489+
pdb='./input_pdbs/7zkr_GABARAP.pdb'
490+
491+
num_designs=10
492+
script="../scripts/run_inference.py"
493+
$script --config-name base \
494+
inference.output_prefix=$prefix \
495+
inference.num_designs=$num_designs \
496+
'contigmap.contigs=[12-18 A3-117/0]' \
497+
inference.input_pdb=$pdb \
498+
inference.cyclic=True \
499+
diffuser.T=50 \
500+
inference.cyc_chains='a' \
501+
ppi.hotspot_res=[\'A51\',\'A52\',\'A50\',\'A48\',\'A62\',\'A65\'] \
502+
```
503+
504+
The new flags are `inference.cyclic=True` and `inference.cyc_chains`. Yes, they are somewhat redundant.
505+
506+
`inference.cyclic` simply notifies the program that the user would like to design at least one macrocycle, and `inference.cyc_chains` is just a string containing the letter of every chain you would like to design as a cyclic peptide. In the example above, only chain `A` (`inference.cyc_chains='a'`) is cyclized, but one could do `inference.cyc_chains='abcd'` if they so desired (and the contigs was compatible with this, which the above one is not).
507+
508+
#### RFpeptides monomer design
509+
For monomer design, you can simply adjust the contigs to only contain a single generated chain e.g., `contigmap.contigs=[12-18]`, keep the `inference.cyclic=True` and `inference.cyc_chains='a'`, and you're off to the races making monomers.
510+
511+
---
512+
469513
### A Note on Model Weights
470514

471515
Because of everything we want diffusion to be able to do, there is not *One Model To Rule Them All*. E.g., if you want to run with secondary structure conditioning, this requires a different model than if you don't. Under the hood, we take care of most of this by default - we parse your input and work out the most appropriate checkpoint.

config/inference/base.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ inference:
2121
trb_save_ckpt_path: null
2222
schedule_directory_path: null
2323
model_directory_path: null
24+
cyclic: False
25+
cyc_chains: 'a'
2426

2527
contigmap:
2628
contigs: null
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
prefix=./outputs/diffused_binder_cyclic2
4+
5+
# Note that the indices in this pdb file have been
6+
# shifted by +2 in chain A relative to pdbID 7zkr.
7+
pdb='./input_pdbs/7zkr_GABARAP.pdb'
8+
9+
num_designs=10
10+
script="../scripts/run_inference.py"
11+
$script --config-name base \
12+
inference.output_prefix=$prefix \
13+
inference.num_designs=$num_designs \
14+
'contigmap.contigs=[12-18 A3-117/0]' \
15+
inference.input_pdb=$pdb \
16+
inference.cyclic=True \
17+
diffuser.T=50 \
18+
inference.cyc_chains='a' \
19+
ppi.hotspot_res=[\'A51\',\'A52\',\'A50\',\'A48\',\'A62\',\'A65\'] \
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
prefix=./outputs/uncond_cycpep
4+
# Note that the indices in this pdb file have been
5+
# shifted by +2 in chain A relative to pdbID 7zkr.
6+
pdb='./input_pdbs/7zkr_GABARAP.pdb'
7+
8+
num_designs=10
9+
script="../scripts/run_inference.py"
10+
$script --config-name base \
11+
inference.output_prefix=$prefix \
12+
inference.num_designs=$num_designs \
13+
'contigmap.contigs=[12-18]' \
14+
inference.input_pdb=$pdb \
15+
inference.cyclic=True \
16+
diffuser.T=50 \
17+
inference.cyc_chains='a'

0 commit comments

Comments
 (0)