Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,10 +27,11 @@ def predict(input_mol, style, view_str, chains):
|
|
| 27 |
os.system(f"cellscape cartoon --pdb {input_mol.name} --outline chain --colors {chain_str} --depth flat --back_outline --view view_matrix --save outline_all.svg")
|
| 28 |
#read content of file
|
| 29 |
print(os.stat("outline_all.svg").st_size / (1024 * 1024))
|
| 30 |
-
os.system("inkscape outline_all.svg --
|
|
|
|
| 31 |
|
| 32 |
-
with open("
|
| 33 |
-
return f.read(), "
|
| 34 |
|
| 35 |
|
| 36 |
|
|
|
|
| 27 |
os.system(f"cellscape cartoon --pdb {input_mol.name} --outline chain --colors {chain_str} --depth flat --back_outline --view view_matrix --save outline_all.svg")
|
| 28 |
#read content of file
|
| 29 |
print(os.stat("outline_all.svg").st_size / (1024 * 1024))
|
| 30 |
+
os.system("inkscape outline_all.svg --actions='select-all;path-simplify;export-plain-svg' --export-filename pdb_opt.svg")
|
| 31 |
+
print(os.stat("outline_all.svg").st_size / (1024 * 1024))
|
| 32 |
|
| 33 |
+
with open("pdb_opt.svg", "r") as f:
|
| 34 |
+
return f.read(), "pdb_opt.svg"
|
| 35 |
|
| 36 |
|
| 37 |
|