Spaces:
Runtime error
Runtime error
osanseviero
commited on
Commit
•
62a73e7
1
Parent(s):
68c1f50
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,22 @@
|
|
1 |
from stmol import showmol
|
2 |
import py3Dmol
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# 1A2C
|
5 |
# Structure of thrombin inhibited by AERUGINOSIN298-A from a BLUE-GREEN ALGA
|
6 |
-
xyzview = py3Dmol.view(
|
|
|
7 |
xyzview.setStyle({'cartoon':{'color':'spectrum'}})
|
8 |
showmol(xyzview, height = 500,width=800)
|
|
|
1 |
from stmol import showmol
|
2 |
import py3Dmol
|
3 |
|
4 |
+
sequence = st.text_input(label="Protein Sequence")
|
5 |
+
|
6 |
+
headers = {
|
7 |
+
'Content-Type': 'application/x-www-form-urlencoded',
|
8 |
+
}
|
9 |
+
|
10 |
+
response = requests.post('https://api.esmatlas.com/foldSequence/v1/pdb/', headers=headers, data=sequence)
|
11 |
+
name = sequence[:3] + sequence[-3:]
|
12 |
+
pdb_filename = "test.pdb"
|
13 |
+
pdb_string = response.content.decode('utf-8')
|
14 |
+
with open(pdb_filename, "w") as out:
|
15 |
+
out.write(pdb_string)
|
16 |
+
|
17 |
# 1A2C
|
18 |
# Structure of thrombin inhibited by AERUGINOSIN298-A from a BLUE-GREEN ALGA
|
19 |
+
xyzview = py3Dmol.view(width=400, height=300)
|
20 |
+
view.addModelsAsFrames(pdb_filename)
|
21 |
xyzview.setStyle({'cartoon':{'color':'spectrum'}})
|
22 |
showmol(xyzview, height = 500,width=800)
|