Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -713,30 +713,21 @@ def create_gradio_interface():
|
|
| 713 |
value="<div style='text-align: center; color: #666; padding: 20px;'>No report generated yet. Run analysis to see results.</div>"
|
| 714 |
)
|
| 715 |
|
| 716 |
-
# Event handlers
|
| 717 |
def handle_analysis_output(*outputs):
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
-
|
| 723 |
-
|
| 724 |
-
|
| 725 |
-
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
)
|
| 729 |
-
except Exception as handler_error:
|
| 730 |
-
logger.error(f"Error in handle_analysis_output: {handler_error}", exc_info=True)
|
| 731 |
-
return (
|
| 732 |
-
f"Error: {str(handler_error)}", "", "", "", "",
|
| 733 |
-
gr.File.update(visible=False), gr.File.update(visible=False),
|
| 734 |
-
gr.File.update(visible=False), gr.File.update(visible=False),
|
| 735 |
-
"", ""
|
| 736 |
-
)
|
| 737 |
|
| 738 |
analyze_btn.click(
|
| 739 |
-
fn=
|
| 740 |
inputs=[dna_input, similarity_score, build_ml_tree],
|
| 741 |
outputs=[
|
| 742 |
boundary_output, keras_output, ml_tree_output, tree_analysis_output, summary_output,
|
|
@@ -745,7 +736,7 @@ def create_gradio_interface():
|
|
| 745 |
)
|
| 746 |
|
| 747 |
analyze_file_btn.click(
|
| 748 |
-
fn=
|
| 749 |
inputs=[file_input, file_similarity_score, file_build_ml_tree],
|
| 750 |
outputs=[
|
| 751 |
boundary_output, keras_output, ml_tree_output, tree_analysis_output, summary_output,
|
|
|
|
| 713 |
value="<div style='text-align: center; color: #666; padding: 20px;'>No report generated yet. Run analysis to see results.</div>"
|
| 714 |
)
|
| 715 |
|
| 716 |
+
# Event handlers
|
| 717 |
def handle_analysis_output(*outputs):
|
| 718 |
+
boundary_output, keras_output, ml_tree_output, simplified_ml_output, summary_output, aligned_file, phy_file, _, _, tree_html_content, report_html_content, tree_html_path, report_html_path = outputs
|
| 719 |
+
return (
|
| 720 |
+
boundary_output, keras_output, ml_tree_output, simplified_ml_output, summary_output,
|
| 721 |
+
gr.File.update(value=aligned_file, visible=aligned_file is not None),
|
| 722 |
+
gr.File.update(value=phy_file, visible=phy_file is not None),
|
| 723 |
+
gr.File.update(value=tree_html_path, visible=tree_html_path is not None),
|
| 724 |
+
gr.File.update(value=report_html_path, visible=report_html_path is not None),
|
| 725 |
+
tree_html_content,
|
| 726 |
+
report_html_content
|
| 727 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 728 |
|
| 729 |
analyze_btn.click(
|
| 730 |
+
fn=run_pipeline,
|
| 731 |
inputs=[dna_input, similarity_score, build_ml_tree],
|
| 732 |
outputs=[
|
| 733 |
boundary_output, keras_output, ml_tree_output, tree_analysis_output, summary_output,
|
|
|
|
| 736 |
)
|
| 737 |
|
| 738 |
analyze_file_btn.click(
|
| 739 |
+
fn=run_pipeline_from_file,
|
| 740 |
inputs=[file_input, file_similarity_score, file_build_ml_tree],
|
| 741 |
outputs=[
|
| 742 |
boundary_output, keras_output, ml_tree_output, tree_analysis_output, summary_output,
|