Skip to content

Commit

Permalink
ColabDesign onboarded (#637)
Browse files Browse the repository at this point in the history
Co-authored-by: Niklas Rindtorff <NiklasTR@users.noreply.github.com>
  • Loading branch information
acashmoney and NiklasTR committed Sep 7, 2023
1 parent 273161c commit 2a66664
Show file tree
Hide file tree
Showing 8 changed files with 1,930 additions and 0 deletions.
1,278 changes: 1,278 additions & 0 deletions tools/colabdesign/6vja_stripped.pdb

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions tools/colabdesign/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM us-docker.pkg.dev/colab-images/public/runtime
RUN apt update -y \
&& apt install -y wget nano
RUN pip3 install hydra-core --upgrade
RUN mkdir /app
# installation
COPY install.py /app
RUN cd app && python3 install.py
COPY . /app
# entrypoint
WORKDIR /app
ENTRYPOINT []
CMD ["bash"]
39 changes: 39 additions & 0 deletions tools/colabdesign/_colabdesign-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"class": "CommandLineTool",
"name": "colabdesign-dev",
"description": "one-pot design of protein backbones and sequences",
"author": "",
"baseCommand": ["/bin/bash", "-c"],
"arguments": [
"wget https://raw.githubusercontent.com/labdao/plex/add_colabdesign_frfr/tools/colabdesign/install.py;",
"wget https://raw.githubusercontent.com/labdao/plex/add_colabdesign_frfr/tools/colabdesign/main.py;",
"mv /inputs/*.pdb /inputs/target_protein.pdb && mv /inputs/*.yaml /inputs/config.yaml;",
"python install.py;",
"echo 'Install complete!';",
"echo 'Attempting main.py...';",
"python main.py;",
"echo 'main.py complete!';"
],
"dockerPull": "docker.io/niklastr/dev@sha256:01dd6d1eb418d67e97e7517de220e76f9403517502efa411f68c2eeb88977d0f",
"gpuBool": true,
"networkBool": true,
"inputs": {
"protein": {
"type": "File",
"item": "",
"glob": ["*.pdb"]
},
"config": {
"type": "File",
"item": "",
"glob": ["*.yaml"]
}
},
"outputs": {
"compressed_designs": {
"type": "Array",
"item": "File",
"glob": ["*.zip"]
}
}
}
48 changes: 48 additions & 0 deletions tools/colabdesign/colabdesign.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"class": "CommandLineTool",
"name": "colabdesign-dev",
"description": "one-pot design of protein backbones and sequences",
"author": "",
"baseCommand": ["/bin/bash", "-c"],
"arguments": [
"mv /inputs/*.pdb /inputs/target_protein.pdb && mv /inputs/*.yaml /inputs/config.yaml;",
"python main.py;"
],
"dockerPull": "quay.io/labdao/colabdesign@sha256:800f4532138afa9664278d6af4769a6f2c3e30fa554cb53e4a0e9491c10bb48a",
"gpuBool": true,
"networkBool": true,
"inputs": {
"protein": {
"type": "File",
"item": "",
"glob": ["*.pdb"]
},
"config": {
"type": "File",
"item": "",
"glob": ["*.yaml"]
}
},
"outputs": {
"best_design": {
"type": "File",
"item": "",
"glob": ["best.pdb"]
},
"design_scores": {
"type": "File",
"item": "",
"glob": ["mpnn_results.csv"]
},
"design_sequences": {
"type": "File",
"item": "",
"glob": ["design.fasta"]
},
"compressed_designs": {
"type": "Array",
"item": "File",
"glob": ["*.zip"]
}
}
}
33 changes: 33 additions & 0 deletions tools/colabdesign/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
basic_settings:
experiment_name: default
binder_length: 50
pdb: /inputs/target_protein.pdb
pdb_chain: D
num_designs: 2
advanced_settings:
pdb_start_residue: 50
pdb_end_residue: 200
hotspot: ''
min_binder_length: null
max_binder_length: null
use_beta_model: false
expert_settings:
RFDiffusion_Binder:
contigs_override: ''
# the contigs_override completely overrules all other contig related settings. Make sure it is '' if you do not want to overwrite settings.
iterations: 50
visual: none
RFDiffusion_Symmetry:
symmetry: none
order: 1
chains: ''
add_potential: true
ProteinMPNN:
num_seqs: 8
rm_aa: C
mpnn_sampling_temp: 0.1
use_solubleMPNN: true
initial_guess: true
Alphafold:
use_multimer: false
num_recycles: 3
9 changes: 9 additions & 0 deletions tools/colabdesign/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM us-docker.pkg.dev/colab-images/public/runtime
RUN apt update -y \
&& apt install -y wget nano
RUN pip3 install hydra-core --upgrade
RUN mkdir /app
#entrypoint
WORKDIR /app
ENTRYPOINT []
CMD ["bash"]
47 changes: 47 additions & 0 deletions tools/colabdesign/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import os, time, signal
import sys, random, string, re

print("Starting install.py...")

if not os.path.isdir("params"):
os.system("apt-get install aria2")
os.system("mkdir params")
# send param download into background
os.system("(\
aria2c -q -x 16 https://files.ipd.uw.edu/krypton/schedules.zip; \
aria2c -q -x 16 http://files.ipd.uw.edu/pub/RFdiffusion/6f5902ac237024bdd0c176cb93063dc4/Base_ckpt.pt; \
aria2c -q -x 16 http://files.ipd.uw.edu/pub/RFdiffusion/e29311f6f1bf1af907f9ef9f44b8328b/Complex_base_ckpt.pt; \
aria2c -q -x 16 http://files.ipd.uw.edu/pub/RFdiffusion/f572d396fae9206628714fb2ce00f72e/Complex_beta_ckpt.pt; \
aria2c -q -x 16 https://storage.googleapis.com/alphafold/alphafold_params_2022-12-06.tar; \
tar -xf alphafold_params_2022-12-06.tar -C params; \
touch params/done.txt) &")

if not os.path.isdir("RFdiffusion"):
print("installing RFdiffusion...")
os.system("git clone https://github.com/sokrypton/RFdiffusion.git")
os.system("pip -q install jedi omegaconf hydra-core icecream pyrsistent")
os.system("pip install dgl==1.0.2+cu116 -f https://data.dgl.ai/wheels/cu116/repo.html")
os.system("cd RFdiffusion/env/SE3Transformer; pip -q install --no-cache-dir -r requirements.txt; pip -q install .")
os.system("wget -qnc https://files.ipd.uw.edu/krypton/ananas")
os.system("chmod +x ananas")

if not os.path.isdir("colabdesign"):
print("installing ColabDesign...")
os.system("pip -q install git+https://github.com/sokrypton/ColabDesign.git")
os.system("ln -s /usr/local/lib/python3.*/dist-packages/colabdesign colabdesign")

if not os.path.isdir("RFdiffusion/models"):
print("downloading RFdiffusion params...")
os.system("mkdir RFdiffusion/models")
models = ["Base_ckpt.pt","Complex_base_ckpt.pt","Complex_beta_ckpt.pt"]
for m in models:
while os.path.isfile(f"{m}.aria2"):
time.sleep(5)
os.system(f"mv {' '.join(models)} RFdiffusion/models")
os.system("unzip schedules.zip; rm schedules.zip")

if 'RFdiffusion' not in sys.path:
os.environ["DGLBACKEND"] = "pytorch"
sys.path.append('RFdiffusion')

print("Completed install.py...")

0 comments on commit 2a66664

Please sign in to comment.