Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -514,11 +514,17 @@ def analyze_sequence_for_tree(sequence: str, matching_percentage: float) -> tupl
|
|
| 514 |
tree_html_path = os.path.join(temp_dir, f'phylogenetic_tree_interactive_{query_id}.html')
|
| 515 |
fig.write_html(tree_html_path)
|
| 516 |
|
| 517 |
-
# Generate
|
| 518 |
-
|
| 519 |
-
report_html_path =
|
| 520 |
-
|
| 521 |
-
f.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 522 |
|
| 523 |
success_msg = f"✅ Analysis complete! Found {len(matched_ids)} similar sequences with {actual_percentage:.2f}% average similarity."
|
| 524 |
|
|
|
|
| 514 |
tree_html_path = os.path.join(temp_dir, f'phylogenetic_tree_interactive_{query_id}.html')
|
| 515 |
fig.write_html(tree_html_path)
|
| 516 |
|
| 517 |
+
# Generate detailed report
|
| 518 |
+
report_success = analyzer.generate_detailed_report(matched_ids, actual_percentage)
|
| 519 |
+
report_html_path = None
|
| 520 |
+
if report_success:
|
| 521 |
+
report_filename = f"detailed_report_{query_id.replace('/', '_')}.html"
|
| 522 |
+
report_html_path = os.path.abspath(report_filename)
|
| 523 |
+
if not os.path.exists(report_html_path):
|
| 524 |
+
logging.warning(f"Report file not found at {report_html_path}")
|
| 525 |
+
report_html_path = None
|
| 526 |
+
else:
|
| 527 |
+
logging.warning("Failed to generate detailed report")
|
| 528 |
|
| 529 |
success_msg = f"✅ Analysis complete! Found {len(matched_ids)} similar sequences with {actual_percentage:.2f}% average similarity."
|
| 530 |
|