Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,21 @@ from transformers.models.esm.openfold_utils.feats import atom14_to_atom37
|
|
4 |
from proteins_viz import *
|
5 |
import gradio as gr
|
6 |
import spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
def read_mol(molpath):
|
9 |
with open(molpath, "r") as fp:
|
@@ -114,7 +129,7 @@ def fold_protein(test_protein):
|
|
114 |
f.write("".join(pdb))
|
115 |
image = take_care("output_structure.pdb")
|
116 |
html = molecule("output_structure.pdb")
|
117 |
-
return image, html
|
118 |
|
119 |
iface = gr.Interface(
|
120 |
title="everything-ai-proteinfold",
|
@@ -125,7 +140,7 @@ iface = gr.Interface(
|
|
125 |
lines=5,
|
126 |
value=f"Paste or write amino-acidic sequence here",
|
127 |
),
|
128 |
-
outputs=[gr.Image(label="Protein static image"), gr.HTML(label="Protein 3D model")],
|
129 |
examples=[
|
130 |
"MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVMGNPKVKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVCVLAHHFGKEFTPPVQAAYQKVVAGVANALAHKYH",
|
131 |
"MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAGQEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDLAARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQHKLRKLNPPDESGPGCMSCKCVLS",
|
|
|
4 |
from proteins_viz import *
|
5 |
import gradio as gr
|
6 |
import spaces
|
7 |
+
from gradio_molecule3d import Molecule3D
|
8 |
+
|
9 |
+
reps = [
|
10 |
+
{
|
11 |
+
"model": 0,
|
12 |
+
"chain": "",
|
13 |
+
"resname": "",
|
14 |
+
"style": "stick",
|
15 |
+
"color": "whiteCarbon",
|
16 |
+
"residue_range": "",
|
17 |
+
"around": 0,
|
18 |
+
"byres": False,
|
19 |
+
"visible": False
|
20 |
+
}
|
21 |
+
]
|
22 |
|
23 |
def read_mol(molpath):
|
24 |
with open(molpath, "r") as fp:
|
|
|
129 |
f.write("".join(pdb))
|
130 |
image = take_care("output_structure.pdb")
|
131 |
html = molecule("output_structure.pdb")
|
132 |
+
return image, html, "output_structure.pdb"
|
133 |
|
134 |
iface = gr.Interface(
|
135 |
title="everything-ai-proteinfold",
|
|
|
140 |
lines=5,
|
141 |
value=f"Paste or write amino-acidic sequence here",
|
142 |
),
|
143 |
+
outputs=[gr.Image(label="Protein static image"), gr.HTML(label="Protein 3D model"), Molecule3D(label="Molecular 3D model", reps=reps)],
|
144 |
examples=[
|
145 |
"MVHLTPEEKSAVTALWGKVNVDEVGGEALGRLLVVYPWTQRFFESFGDLSTPDAVMGNPKVKAHGKKVLGAFSDGLAHLDNLKGTFATLSELHCDKLHVDPENFRLLGNVLVCVLAHHFGKEFTPPVQAAYQKVVAGVANALAHKYH",
|
146 |
"MTEYKLVVVGAGGVGKSALTIQLIQNHFVDEYDPTIEDSYRKQVVIDGETCLLDILDTAGQEEYSAMRDQYMRTGEGFLCVFAINNTKSFEDIHQYREQIKRVKDSDDVPMVLVGNKCDLAARTVESRQAQDLARSYGIPYIETSAKTRQGVEDAFYTLVREIRQHKLRKLNPPDESGPGCMSCKCVLS",
|