Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -446,7 +446,7 @@ def view_protein(target_name: str, view_style: str) -> Tuple[str, str]:
|
|
| 446 |
return viewer_html, info_html
|
| 447 |
|
| 448 |
|
| 449 |
-
def run_docking(target_name: str, compounds: List[str]
|
| 450 |
"""Run docking simulation."""
|
| 451 |
if not target_name:
|
| 452 |
return "Please select a target protein", "", ""
|
|
@@ -464,27 +464,11 @@ def run_docking(target_name: str, compounds: List[str], progress=gr.Progress())
|
|
| 464 |
if comp:
|
| 465 |
compound_ids.append(comp["id"])
|
| 466 |
|
| 467 |
-
# Simulate docking
|
| 468 |
-
|
| 469 |
-
time.sleep(0.5)
|
| 470 |
|
| 471 |
-
progress(0.2, desc="Loading protein structure...")
|
| 472 |
-
time.sleep(0.3)
|
| 473 |
-
|
| 474 |
-
progress(0.4, desc="Preparing compound library...")
|
| 475 |
-
time.sleep(0.3)
|
| 476 |
-
|
| 477 |
-
progress(0.6, desc="Running molecular docking...")
|
| 478 |
-
time.sleep(0.5)
|
| 479 |
-
|
| 480 |
-
progress(0.8, desc="Analyzing binding poses...")
|
| 481 |
-
time.sleep(0.3)
|
| 482 |
-
|
| 483 |
-
progress(0.95, desc="Generating results...")
|
| 484 |
results_text, chart_html, receipt = generate_docking_result(target["id"], compound_ids)
|
| 485 |
|
| 486 |
-
progress(1.0, desc="Complete!")
|
| 487 |
-
|
| 488 |
return results_text, chart_html, receipt
|
| 489 |
|
| 490 |
|
|
|
|
| 446 |
return viewer_html, info_html
|
| 447 |
|
| 448 |
|
| 449 |
+
def run_docking(target_name: str, compounds: List[str]) -> Tuple[str, str, str]:
|
| 450 |
"""Run docking simulation."""
|
| 451 |
if not target_name:
|
| 452 |
return "Please select a target protein", "", ""
|
|
|
|
| 464 |
if comp:
|
| 465 |
compound_ids.append(comp["id"])
|
| 466 |
|
| 467 |
+
# Simulate docking (small delay for effect)
|
| 468 |
+
time.sleep(1.5)
|
|
|
|
| 469 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 470 |
results_text, chart_html, receipt = generate_docking_result(target["id"], compound_ids)
|
| 471 |
|
|
|
|
|
|
|
| 472 |
return results_text, chart_html, receipt
|
| 473 |
|
| 474 |
|