Hack90 commited on
Commit
35231a8
·
verified ·
1 Parent(s): 2fa0dd7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -857,7 +857,7 @@ with ui.navset_card_tab(id="tab"):
857
  )
858
  with ui.card():
859
  ui.input_selectize(
860
- "plot_type",
861
  "Select your method:",
862
  ["Chaos Game Representation", "2D Line", "ColorSquare", "Persistant Homology", "Wens Method"],
863
  multiple=False,
@@ -877,17 +877,17 @@ with ui.navset_card_tab(id="tab"):
877
 
878
  # plot the comparison
879
  fig = None
880
- if input.plot_type() == "2D Line":
881
  fig = plot_2d_comparison(grouped, grouped.index)
882
- if input.plot_type() == "ColorSquare":
883
  filtered_df = df.groupby('Organism_Name').apply(filter_and_select).reset_index(drop=True)
884
  fig = plot_color_square(filtered_df['Sequence'], filtered_df['Organism_Name'].unique())
885
- if input.plot_type() == "Wens Method":
886
  fig = wens_method_heatmap(df, df['Organism_Name'].unique())
887
- if input.plot_type() == "Chaos Game Representation":
888
  filtered_df = df.groupby('Organism_Name').apply(filter_and_select).reset_index(drop=True)
889
  fig = plot_fcgr(filtered_df['Sequence'], df['Organism_Name'].unique())
890
- if input.plot_type() == "Persistant Homology":
891
  filtered_df = df.groupby('Organism_Name').apply(filter_and_select).reset_index(drop=True)
892
  fig = plot_persistence_homology(filtered_df['Sequence'], filtered_df['Organism_Name'])
893
  return fig
 
857
  )
858
  with ui.card():
859
  ui.input_selectize(
860
+ "plot_type_macro",
861
  "Select your method:",
862
  ["Chaos Game Representation", "2D Line", "ColorSquare", "Persistant Homology", "Wens Method"],
863
  multiple=False,
 
877
 
878
  # plot the comparison
879
  fig = None
880
+ if input.plot_type_macro() == "2D Line":
881
  fig = plot_2d_comparison(grouped, grouped.index)
882
+ if input.plot_type_macro() == "ColorSquare":
883
  filtered_df = df.groupby('Organism_Name').apply(filter_and_select).reset_index(drop=True)
884
  fig = plot_color_square(filtered_df['Sequence'], filtered_df['Organism_Name'].unique())
885
+ if input.plot_type_macro() == "Wens Method":
886
  fig = wens_method_heatmap(df, df['Organism_Name'].unique())
887
+ if input.plot_type_macro() == "Chaos Game Representation":
888
  filtered_df = df.groupby('Organism_Name').apply(filter_and_select).reset_index(drop=True)
889
  fig = plot_fcgr(filtered_df['Sequence'], df['Organism_Name'].unique())
890
+ if input.plot_type_macro() == "Persistant Homology":
891
  filtered_df = df.groupby('Organism_Name').apply(filter_and_select).reset_index(drop=True)
892
  fig = plot_persistence_homology(filtered_df['Sequence'], filtered_df['Organism_Name'])
893
  return fig