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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -516,8 +516,11 @@ def analyze_sequence_for_tree(sequence: str, matching_percentage: float) -> tupl
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"
@@ -537,8 +540,7 @@ def analyze_sequence_for_tree(sequence: str, matching_percentage: float) -> tupl
537
  logging.error(error_msg)
538
  import traceback
539
  logging.error(f"Full traceback: {traceback.format_exc()}")
540
- return error_msg, None, None
541
- # --- Keras Prediction ---
542
  def predict_with_keras(sequence):
543
  try:
544
  if not keras_model or not kmer_to_index:
 
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
+ # Ensure the analyzer has the correct user input threshold for the report
520
+ analyzer.matching_percentage = matching_percentage
521
+
522
+ # Generate detailed report - FIXED: Only pass the two required parameters
523
+ report_success = analyzer.generate_detailed_report(matched_ids, actual_percentage)
524
  report_html_path = None
525
  if report_success:
526
  report_filename = f"detailed_report_{query_id.replace('/', '_')}.html"
 
540
  logging.error(error_msg)
541
  import traceback
542
  logging.error(f"Full traceback: {traceback.format_exc()}")
543
+ return error_msg, None, None# --- Keras Prediction ---
 
544
  def predict_with_keras(sequence):
545
  try:
546
  if not keras_model or not kmer_to_index: