gabboud commited on
Commit
78f0c3d
·
1 Parent(s): c740574

longer explanation and rfd3 examples

Browse files
app.py CHANGED
@@ -20,7 +20,7 @@ download_weights()
20
  # Gradio UI
21
  with gr.Blocks(title="RFD3 Test") as demo:
22
 
23
- gr.Markdown("# RFdiffusion3 for Backbone generation 🧬 ")
24
 
25
  with gr.Row():
26
  gr.Markdown("""When the Baker lab released the first version of [RFdiffusion](https://www.nature.com/articles/s41586-023-06415-8), they opened up new avenues for protein design.
@@ -38,6 +38,33 @@ with gr.Blocks(title="RFD3 Test") as demo:
38
 
39
  gr.Image("assets/overview_rfd3_baker.png", width=600)
40
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  config_ready = gr.State(None) # whether the config is ready for running generation, takes values None, "manual", or "upload"
42
  scaffold_ready = gr.State(None) # whether the scaffold is ready for running generation, takes values None, "upload", or "no_input"
43
  gen_directory = gr.State(None) # the directory where generation results are saved, used to trigger the download of results as zip file
 
20
  # Gradio UI
21
  with gr.Blocks(title="RFD3 Test") as demo:
22
 
23
+ gr.Markdown("# RFdiffusion3 for Protein Backbone generation 🧬 ")
24
 
25
  with gr.Row():
26
  gr.Markdown("""When the Baker lab released the first version of [RFdiffusion](https://www.nature.com/articles/s41586-023-06415-8), they opened up new avenues for protein design.
 
38
 
39
  gr.Image("assets/overview_rfd3_baker.png", width=600)
40
 
41
+ gr.Markdown("## How to Use this Space")
42
+
43
+ gr.Markdown("""
44
+ Hugging Face spaces is a great tool to build quick machine learning demos and expose interfaces for popular models. This space runs the RFD3 model with a convenient interface for input configurations and inference parameters.
45
+ The green `Running on ZERO` at the top of the page indicates that this space runs on Hugging Face's [ZeroGPU technology](https://huggingface.co/docs/hub/en/spaces-zerogpu). This means that all jobs are run on NVIDIA H200 GPUs and that the number of GPUs allocated to this space scale automatically based on demand.
46
+
47
+ There are three steps to setting up a job.
48
+ - First, create an input specification for your generation job. This is a yaml or json file with details on targeted motifs, scaffolds and generation parameters that gets passed to RFD3's CLI as `inputs`. Check out [RFD3's documentation and tutorials](https://rosettacommons.github.io/foundry/models/rfd3/input.html) to learn how to compose this file!
49
+ - Second, upload a PDB file containing your target/scaffold structure to condition the generation or click `No Scaffold/Target` for unconditional generation.
50
+ - Third, Select the number of batches and designs per batch for your job. These are passed as CLI arguments to RFD3. Advanced CLI arguments can be added in the "Advanced Options" section. While most of these arguments can be kept at their default value, some related to the inference sampler can provide improvements for [protein-protein interaction (PPI) workflows](https://rosettacommons.github.io/foundry/models/rfd3/ppi_design_tutorial.html). Here is a list of other [CLI arguments](https://rosettacommons.github.io/foundry/models/rfd3/input.html#cli-arguments).
51
+
52
+
53
+ Individual jobs On ZeroGPU spaces are limited to 240 seconds for PRO users or members of an organization. Hence, make sure that you are logged in before launching a job and keep the number of designs per run manageable.
54
+ While the time taken significantly depends on the configuration run, here are some numbers to guide you:
55
+ - RFD3's PPI tutorial, designing a 190-270 aa binder for a 149 aa motif on the [human insulin receptor](https://www.rcsb.org/structure/4ZXB)
56
+ generated a batch of 8 designs every 60 seconds, a batch of 16 every 95 seconds.
57
+ - RFD3's complex nucleic acid tutorial, scaffolding a DNA-binding motif of 8 residues into a 150 aa binder,
58
+ generated a batch of 8 designs every 52 seconds.
59
+ - RDF3's enzyme design tutorial, scaffolding the active site of drosophila's alcohol dehydrogenase into a 180-200 aa enzyme, generated a batch of 8 designs every 60 seconds.
60
+
61
+
62
+ Example files for these three tutorials can be found in the [`examples` directory of this repo](https://huggingface.co/spaces/hugging-science/RFdiffusion3/tree/main/examples). They are
63
+ all taken from [RFD3's amazing Github repository.](https://github.com/RosettaCommons/foundry/tree/production/models/rfd3)
64
+
65
+
66
+ """)
67
+
68
  config_ready = gr.State(None) # whether the config is ready for running generation, takes values None, "manual", or "upload"
69
  scaffold_ready = gr.State(None) # whether the scaffold is ready for running generation, takes values None, "upload", or "no_input"
70
  gen_directory = gr.State(None) # the directory where generation results are saved, used to trigger the download of results as zip file
examples/enzyme_design/M0255_1mg5.pdb ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ATOM 1 N ASN A 108 -1.831 7.586 -0.524 1.00 0.00 N
2
+ ATOM 2 CA ASN A 108 -0.780 6.606 -0.253 1.00 0.00 C
3
+ ATOM 3 C ASN A 108 0.647 7.109 -0.280 1.00 0.00 C
4
+ ATOM 4 O ASN A 108 1.473 6.539 0.468 1.00 0.00 O
5
+ ATOM 5 CB ASN A 108 -0.920 5.444 -1.253 1.00 0.00 C
6
+ ATOM 6 CG ASN A 108 -2.233 4.691 -1.107 1.00 0.00 C
7
+ ATOM 7 OD1 ASN A 108 -3.148 5.078 -0.370 1.00 0.00 O
8
+ ATOM 8 ND2 ASN A 108 -2.305 3.590 -1.857 1.00 0.00 N
9
+ ATOM 9 N SER A 139 3.804 -1.941 2.086 1.00 0.00 N
10
+ ATOM 10 CA SER A 139 3.101 -3.100 1.550 1.00 0.00 C
11
+ ATOM 11 C SER A 139 4.107 -3.984 0.833 1.00 0.00 C
12
+ ATOM 12 O SER A 139 5.004 -3.450 0.203 1.00 0.00 O
13
+ ATOM 13 CB SER A 139 2.044 -2.691 0.531 1.00 0.00 C
14
+ ATOM 14 OG SER A 139 1.484 -3.732 -0.218 1.00 0.00 O
15
+ ATOM 15 N TYR A 152 -1.872 1.622 -7.348 1.00 0.00 N
16
+ ATOM 16 CA TYR A 152 -1.625 1.343 -5.934 1.00 0.00 C
17
+ ATOM 17 C TYR A 152 -0.247 0.774 -5.657 1.00 0.00 C
18
+ ATOM 18 O TYR A 152 0.484 1.228 -4.775 1.00 0.00 O
19
+ ATOM 19 CB TYR A 152 -2.637 0.280 -5.478 1.00 0.00 C
20
+ ATOM 20 CG TYR A 152 -2.473 -0.171 -4.039 1.00 0.00 C
21
+ ATOM 21 CD1 TYR A 152 -3.089 0.512 -3.001 1.00 0.00 C
22
+ ATOM 22 CD2 TYR A 152 -1.724 -1.316 -3.768 1.00 0.00 C
23
+ ATOM 23 CE1 TYR A 152 -2.960 0.051 -1.703 1.00 0.00 C
24
+ ATOM 24 CE2 TYR A 152 -1.571 -1.771 -2.464 1.00 0.00 C
25
+ ATOM 25 CZ TYR A 152 -2.212 -1.084 -1.454 1.00 0.00 C
26
+ ATOM 26 OH TYR A 152 -2.067 -1.548 -0.160 1.00 0.00 O
27
+ ATOM 27 N LYS A 156 3.015 2.216 -3.293 1.00 0.00 N
28
+ ATOM 28 CA LYS A 156 3.713 1.519 -2.209 1.00 0.00 C
29
+ ATOM 29 C LYS A 156 5.191 1.353 -2.484 1.00 0.00 C
30
+ ATOM 30 O LYS A 156 5.993 1.390 -1.552 1.00 0.00 O
31
+ ATOM 31 CB LYS A 156 2.995 0.192 -1.901 1.00 0.00 C
32
+ ATOM 32 CG LYS A 156 1.571 0.490 -1.401 1.00 0.00 C
33
+ ATOM 33 CD LYS A 156 1.592 1.225 -0.059 1.00 0.00 C
34
+ ATOM 34 CE LYS A 156 0.284 1.017 0.701 1.00 0.00 C
35
+ ATOM 35 NZ LYS A 156 0.308 1.634 2.071 1.00 0.00 N
36
+ HETATM 36 C ACT A 900 -2.009 -5.026 -0.330 1.00 0.00 C
37
+ HETATM 37 O ACT A 900 -3.161 -5.482 -0.238 1.00 0.00 O
38
+ HETATM 38 OXT ACT A 900 -1.498 -3.916 -0.167 1.00 0.00 O
39
+ HETATM 39 CH3 ACT A 900 -0.878 -6.037 -0.668 1.00 0.00 C
40
+ HETATM 40 PA NAI A 850 -8.581 -0.242 5.750 1.00 0.00 P
41
+ HETATM 41 O1A NAI A 850 -9.349 0.231 4.569 1.00 0.00 O
42
+ HETATM 42 O2A NAI A 850 -9.389 -0.894 6.798 1.00 0.00 O
43
+ HETATM 43 O5B NAI A 850 -7.799 0.917 6.493 1.00 0.00 O
44
+ HETATM 44 C5B NAI A 850 -7.313 2.070 5.708 1.00 0.00 C
45
+ HETATM 45 C4B NAI A 850 -6.898 3.056 6.802 1.00 0.00 C
46
+ HETATM 46 O4B NAI A 850 -6.401 4.245 6.129 1.00 0.00 O
47
+ HETATM 47 C3B NAI A 850 -8.094 3.539 7.652 1.00 0.00 C
48
+ HETATM 48 O3B NAI A 850 -7.604 3.961 8.901 1.00 0.00 O
49
+ HETATM 49 C2B NAI A 850 -8.579 4.728 6.821 1.00 0.00 C
50
+ HETATM 50 O2B NAI A 850 -9.526 5.601 7.420 1.00 0.00 O
51
+ HETATM 51 C1B NAI A 850 -7.190 5.345 6.529 1.00 0.00 C
52
+ HETATM 52 N9A NAI A 850 -7.314 6.329 5.448 1.00 0.00 N
53
+ HETATM 53 C8A NAI A 850 -7.716 6.164 4.155 1.00 0.00 C
54
+ HETATM 54 N7A NAI A 850 -7.786 7.335 3.495 1.00 0.00 N
55
+ HETATM 55 C5A NAI A 850 -7.419 8.264 4.430 1.00 0.00 C
56
+ HETATM 56 C6A NAI A 850 -7.287 9.675 4.365 1.00 0.00 C
57
+ HETATM 57 N6A NAI A 850 -7.538 10.349 3.250 1.00 0.00 N
58
+ HETATM 58 N1A NAI A 850 -6.894 10.297 5.502 1.00 0.00 N
59
+ HETATM 59 C2A NAI A 850 -6.651 9.586 6.641 1.00 0.00 C
60
+ HETATM 60 N3A NAI A 850 -6.754 8.287 6.785 1.00 0.00 N
61
+ HETATM 61 C4A NAI A 850 -7.149 7.684 5.648 1.00 0.00 C
62
+ HETATM 62 O3 NAI A 850 -7.419 -1.192 5.193 1.00 0.00 O
63
+ HETATM 63 PN NAI A 850 -6.176 -1.843 5.931 1.00 0.00 P
64
+ HETATM 64 O1N NAI A 850 -6.023 -3.207 5.371 1.00 0.00 O
65
+ HETATM 65 O2N NAI A 850 -6.343 -1.771 7.392 1.00 0.00 O
66
+ HETATM 66 O5D NAI A 850 -5.025 -0.855 5.391 1.00 0.00 O
67
+ HETATM 67 C5D NAI A 850 -4.162 -0.186 6.319 1.00 0.00 C
68
+ HETATM 68 C4D NAI A 850 -2.841 0.114 5.628 1.00 0.00 C
69
+ HETATM 69 O4D NAI A 850 -2.207 -1.160 5.349 1.00 0.00 O
70
+ HETATM 70 C3D NAI A 850 -2.908 0.884 4.318 1.00 0.00 C
71
+ HETATM 71 O3D NAI A 850 -1.790 1.777 4.166 1.00 0.00 O
72
+ HETATM 72 C2D NAI A 850 -2.850 -0.259 3.297 1.00 0.00 C
73
+ HETATM 73 O2D NAI A 850 -2.325 0.228 2.053 1.00 0.00 O
74
+ HETATM 74 C1D NAI A 850 -1.819 -1.161 3.979 1.00 0.00 C
75
+ HETATM 75 N1N NAI A 850 -1.764 -2.545 3.526 1.00 0.00 N
76
+ HETATM 76 C2N NAI A 850 -2.829 -3.361 3.692 1.00 0.00 C
77
+ HETATM 77 C3N NAI A 850 -2.748 -4.639 3.198 1.00 0.00 C
78
+ HETATM 78 C7N NAI A 850 -3.902 -5.686 3.210 1.00 0.00 C
79
+ HETATM 79 O7N NAI A 850 -3.783 -6.723 2.547 1.00 0.00 O
80
+ HETATM 80 N7N NAI A 850 -4.953 -5.396 3.996 1.00 0.00 N
81
+ HETATM 81 C4N NAI A 850 -1.505 -5.269 2.901 1.00 0.00 C
82
+ HETATM 82 C5N NAI A 850 -0.460 -4.325 2.716 1.00 0.00 C
83
+ HETATM 83 C6N NAI A 850 -0.484 -3.023 3.140 1.00 0.00 C
84
+ HETATM 84 ORI ORI C 901 0.000 0.000 0.000 1.00 0.00 X
examples/enzyme_design/enzyme_design.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "M0255_1mg5_unfixed": {
3
+ "input": "./M0255_1mg5.pdb",
4
+ "ligand": "NAI,ACT",
5
+ "unindex": "A108,A139,A152,A156",
6
+ "length": "180-200",
7
+ "select_fixed_atoms": {
8
+ "A108": "ND2,CG",
9
+ "A139": "OG,CB,CA",
10
+ "A152": "OH,CZ",
11
+ "A156": "NZ,CE,CD",
12
+ "ACT": "OXT",
13
+ "NAI": ""
14
+ }
15
+ }
16
+ }
examples/nucleic_acid/2r5z.pdb ADDED
The diff for this file is too large to render. See raw diff
 
examples/nucleic_acid/na_binder_complex_design.json ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dsDNA_complex": {
3
+ "input": "./2r5z.pdb",
4
+ "contig": "C5-18,/0,D24-37,/0,40-50,A146-154,80-90",
5
+ "length": "147-167",
6
+ "unindex": "/0,/0,B251-B255",
7
+ "select_fixed_atoms": {
8
+ "C9-14":"ALL",
9
+ "D28-33":"ALL",
10
+ "C5-8,C15-18": "",
11
+ "D24-27,D34-37": ""
12
+ },
13
+ "ori_token":[25,35,20],
14
+ "is_non_loopy": true
15
+ }
16
+ }
examples/ppi/4zxb_cropped.pdb ADDED
The diff for this file is too large to render. See raw diff
 
examples/ppi/ppi_tutorial.yaml ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ insulinr:
2
+ input: ./4zxb_cropped.pdb
3
+ contig: 40-120,/0,E6-155
4
+ length: 190-270
5
+ select_hotspots:
6
+ E64: CD2,CZ
7
+ E88: CG,CZ
8
+ E96: CD1,CZ
9
+ infer_ori_strategy: hotspots
10
+ is_non_loopy: true
11
+ select_fixed_atoms:
12
+ E25: []
13
+ E26: BKBN
14
+ E27: CA,CB,OG