Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,18 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
|
|
2 |
from evodiff.pretrained import OA_DM_38M, D3PM_UNIFORM_38M, MSA_OA_DM_MAXSUB
|
3 |
from evodiff.generate import generate_oaardm, generate_d3pm
|
4 |
from evodiff.generate_msa import generate_query_oadm_msa_simple
|
5 |
-
|
6 |
import py3Dmol
|
|
|
|
|
|
|
|
|
7 |
|
8 |
def a3m_file(file):
|
9 |
-
|
10 |
return "tmp.a3m"
|
11 |
|
12 |
def make_uncond_seq(seq_len, model_type):
|
@@ -59,6 +65,41 @@ def display_pdb(path_to_pdb):
|
|
59 |
allowpaymentrequest="" frameborder="0" srcdoc='{x}'></iframe>"""
|
60 |
'''
|
61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
usg_app = gr.Interface(
|
63 |
fn=make_uncond_seq,
|
64 |
inputs=[
|
|
|
1 |
+
import re
|
2 |
+
from pathlib import Path
|
3 |
import gradio as gr
|
4 |
+
|
5 |
from evodiff.pretrained import OA_DM_38M, D3PM_UNIFORM_38M, MSA_OA_DM_MAXSUB
|
6 |
from evodiff.generate import generate_oaardm, generate_d3pm
|
7 |
from evodiff.generate_msa import generate_query_oadm_msa_simple
|
8 |
+
|
9 |
import py3Dmol
|
10 |
+
from colabfold.download import download_alphafold_params, default_data_dir
|
11 |
+
from colabfold.utils import setup_logging
|
12 |
+
from colabfold.batch import get_queries, run, set_model_type
|
13 |
+
from colabfold.plot import plot_msa_v2
|
14 |
|
15 |
def a3m_file(file):
|
|
|
16 |
return "tmp.a3m"
|
17 |
|
18 |
def make_uncond_seq(seq_len, model_type):
|
|
|
65 |
allowpaymentrequest="" frameborder="0" srcdoc='{x}'></iframe>"""
|
66 |
'''
|
67 |
|
68 |
+
def predict_protein(sequence):
|
69 |
+
model_type = "alphafold2_ptm"
|
70 |
+
download_alphafold_params(model_type, Path("."))
|
71 |
+
results = run(
|
72 |
+
queries=queries,
|
73 |
+
result_dir=result_dir,
|
74 |
+
use_templates=use_templates,
|
75 |
+
custom_template_path=custom_template_path,
|
76 |
+
num_relax=0,
|
77 |
+
msa_mode=msa_mode,
|
78 |
+
model_type=model_type,
|
79 |
+
num_models=1,
|
80 |
+
num_recycles=1,
|
81 |
+
recycle_early_stop_tolerance=recycle_early_stop_tolerance,
|
82 |
+
num_seeds=num_seeds,
|
83 |
+
use_dropout=use_dropout,
|
84 |
+
model_order=[1],
|
85 |
+
is_complex=False,
|
86 |
+
data_dir=Path("."),
|
87 |
+
keep_existing_results=False,
|
88 |
+
rank_by="auto",
|
89 |
+
pair_mode=pair_mode,
|
90 |
+
pairing_strategy=pairing_strategy,
|
91 |
+
stop_at_score=float(100),
|
92 |
+
prediction_callback=prediction_callback,
|
93 |
+
dpi=dpi,
|
94 |
+
zip_results=False,
|
95 |
+
save_all=save_all,
|
96 |
+
max_msa=max_msa,
|
97 |
+
use_cluster_profile=use_cluster_profile,
|
98 |
+
input_features_callback=input_features_callback,
|
99 |
+
save_recycles=save_recycles,
|
100 |
+
user_agent="colabfold/google-colab-main",
|
101 |
+
)
|
102 |
+
|
103 |
usg_app = gr.Interface(
|
104 |
fn=make_uncond_seq,
|
105 |
inputs=[
|