Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -857,7 +857,7 @@ with ui.navset_card_tab(id="tab"):
|
|
| 857 |
)
|
| 858 |
with ui.card():
|
| 859 |
ui.input_selectize(
|
| 860 |
-
"
|
| 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.
|
| 881 |
fig = plot_2d_comparison(grouped, grouped.index)
|
| 882 |
-
if input.
|
| 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.
|
| 886 |
fig = wens_method_heatmap(df, df['Organism_Name'].unique())
|
| 887 |
-
if input.
|
| 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.
|
| 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
|