re-type commited on
Commit
ce804fc
·
verified ·
1 Parent(s): dc0ba8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
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 and save detailed report
518
- report_html_content = analyzer.generate_detailed_report(matched_ids, actual_percentage)
519
- report_html_path = os.path.join(temp_dir, f'detailed_report_{query_id}.html')
520
- with open(report_html_path, 'w', encoding='utf-8') as f:
521
- f.write(report_html_content)
 
 
 
 
 
 
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