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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -464,6 +464,8 @@ def build_maximum_likelihood_tree(f_gene_sequence):
464
  return False, f"ML tree construction failed: {str(e)}", None, None
465
 
466
  # --- NEW Tree Analysis Function (Using the new analyzer API) ---
 
 
467
  def analyze_sequence_for_tree(sequence: str, matching_percentage: float) -> tuple:
468
  """
469
  Analyze sequence and create phylogenetic tree and detailed report using the new analyzer API
@@ -514,8 +516,8 @@ 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 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"
 
464
  return False, f"ML tree construction failed: {str(e)}", None, None
465
 
466
  # --- NEW Tree Analysis Function (Using the new analyzer API) ---
467
+ # Replace this part in your analyze_sequence_for_tree function:
468
+
469
  def analyze_sequence_for_tree(sequence: str, matching_percentage: float) -> tuple:
470
  """
471
  Analyze sequence and create phylogenetic tree and detailed report using the new analyzer API
 
516
  tree_html_path = os.path.join(temp_dir, f'phylogenetic_tree_interactive_{query_id}.html')
517
  fig.write_html(tree_html_path)
518
 
519
+ # Generate detailed report - FIXED: Pass the user's input threshold
520
+ report_success = analyzer.generate_detailed_report(matched_ids, actual_percentage, matching_percentage)
521
  report_html_path = None
522
  if report_success:
523
  report_filename = f"detailed_report_{query_id.replace('/', '_')}.html"