Spaces:
Running
Running
Commit
·
e2dd340
1
Parent(s):
159e2ff
debug
Browse files
app.py
CHANGED
@@ -990,11 +990,16 @@ def process_input(
|
|
990 |
#summary += f"Aromatic Cycles: {', '.join(aromatic_cycles)}\n"
|
991 |
|
992 |
if structure_files:
|
993 |
-
|
994 |
-
|
995 |
-
|
|
|
|
|
|
|
|
|
|
|
996 |
|
997 |
-
return summary, img_cyclic, img_linear, structure_files if structure_files else []
|
998 |
|
999 |
except Exception as e:
|
1000 |
return f"Error processing SMILES: {str(e)}", None, None, []
|
@@ -1087,7 +1092,7 @@ iface = gr.Interface(
|
|
1087 |
),
|
1088 |
gr.File(
|
1089 |
label="3D Structure Files",
|
1090 |
-
file_count=
|
1091 |
)
|
1092 |
],
|
1093 |
title="Peptide Structure Analyzer and Visualizer",
|
|
|
990 |
#summary += f"Aromatic Cycles: {', '.join(aromatic_cycles)}\n"
|
991 |
|
992 |
if structure_files:
|
993 |
+
szip_path = os.path.join(temp_dir, "structures.zip")
|
994 |
+
with zipfile.ZipFile(zip_path, "w") as zf:
|
995 |
+
for fpath in structure_files:
|
996 |
+
zf.write(fpath, os.path.basename(fpath))
|
997 |
+
# return the single ZIP instead of a list of SDFs:
|
998 |
+
return summary, img_cyclic, img_linear, zip_path
|
999 |
+
else:
|
1000 |
+
return summary, img_cyclic, img_linear, None
|
1001 |
|
1002 |
+
#return summary, img_cyclic, img_linear, structure_files if structure_files else []
|
1003 |
|
1004 |
except Exception as e:
|
1005 |
return f"Error processing SMILES: {str(e)}", None, None, []
|
|
|
1092 |
),
|
1093 |
gr.File(
|
1094 |
label="3D Structure Files",
|
1095 |
+
file_count=1
|
1096 |
)
|
1097 |
],
|
1098 |
title="Peptide Structure Analyzer and Visualizer",
|