Spaces:
Runtime error
Runtime error
as-cle-bert
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -140,7 +140,7 @@ def fold_protein_wpdb(test_protein, pdb_path):
|
|
140 |
with open(pdb_path, "w") as f:
|
141 |
f.write("".join(pdb))
|
142 |
html = molecule(pdb_path)
|
143 |
-
return html
|
144 |
|
145 |
def load_protein_sequences(fasta_file):
|
146 |
protein_sequences = {}
|
@@ -165,22 +165,6 @@ iface = gr.Interface(
|
|
165 |
]
|
166 |
)
|
167 |
|
168 |
-
# with gr.Blocks() as demo1:
|
169 |
-
# input_seqs = gr.File(label="FASTA File With Protein Sequences")
|
170 |
-
# @gr.render(inputs=input_seqs)
|
171 |
-
# def show_split(inputfile):
|
172 |
-
# if inputfile is None:
|
173 |
-
# gr.Markdown("## No Input Provided")
|
174 |
-
# else:
|
175 |
-
# seqs = load_protein_sequences(inputfile)
|
176 |
-
# print("Loaded sequences")
|
177 |
-
# for seq in seqs:
|
178 |
-
# pdb_path = f'{seq.replace(" ", "_").replace(",","")}.pdb'
|
179 |
-
# html, pdb = fold_protein_wpdb(seqs[seq], pdb_path)
|
180 |
-
# print(f"Prediction for {seq} is over")
|
181 |
-
# gr.HTML(html, label=f"{seq} structural representation")
|
182 |
-
# Molecule3D(pdb, label=f"{seq} molecular representation")
|
183 |
-
|
184 |
with gr.Blocks() as demo1:
|
185 |
input_seqs = gr.File(label="FASTA File With Protein Sequences")
|
186 |
@gr.render(inputs=input_seqs)
|
@@ -192,10 +176,11 @@ with gr.Blocks() as demo1:
|
|
192 |
print("Loaded sequences")
|
193 |
for seq in seqs:
|
194 |
pdb_path = f'{seq.replace(" ", "_").replace(",","")}.pdb'
|
195 |
-
html =
|
196 |
print(f"Prediction for {seq} is over")
|
197 |
gr.HTML(html, label=f"{seq} structural representation")
|
198 |
|
|
|
199 |
demo = gr.TabbedInterface([iface, demo1], ["Single Protein Structure Prediction", "Bulk Protein Structure Prediction"])
|
200 |
|
201 |
demo.launch(server_name="0.0.0.0", share=False)
|
|
|
140 |
with open(pdb_path, "w") as f:
|
141 |
f.write("".join(pdb))
|
142 |
html = molecule(pdb_path)
|
143 |
+
return html
|
144 |
|
145 |
def load_protein_sequences(fasta_file):
|
146 |
protein_sequences = {}
|
|
|
165 |
]
|
166 |
)
|
167 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
168 |
with gr.Blocks() as demo1:
|
169 |
input_seqs = gr.File(label="FASTA File With Protein Sequences")
|
170 |
@gr.render(inputs=input_seqs)
|
|
|
176 |
print("Loaded sequences")
|
177 |
for seq in seqs:
|
178 |
pdb_path = f'{seq.replace(" ", "_").replace(",","")}.pdb'
|
179 |
+
html, pdb = fold_protein_wpdb(seqs[seq], pdb_path)
|
180 |
print(f"Prediction for {seq} is over")
|
181 |
gr.HTML(html, label=f"{seq} structural representation")
|
182 |
|
183 |
+
|
184 |
demo = gr.TabbedInterface([iface, demo1], ["Single Protein Structure Prediction", "Bulk Protein Structure Prediction"])
|
185 |
|
186 |
demo.launch(server_name="0.0.0.0", share=False)
|