Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ from utils import (
|
|
11 |
wens_method_heatmap,
|
12 |
plot_fcgr,
|
13 |
plot_persistence_homology,
|
|
|
14 |
)
|
15 |
import os
|
16 |
import matplotlib as mpl
|
@@ -70,6 +71,23 @@ with ui.navset_card_tab(id="tab"):
|
|
70 |
elif plot_type == "Persistant Homology":
|
71 |
filtered_df = df.groupby("Organism_Name").apply(filter_and_select).reset_index(drop=True)
|
72 |
return plot_persistence_homology(filtered_df["Sequence"], filtered_df["Organism_Name"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
with ui.nav_panel("Viral Microstructure"):
|
75 |
ui.panel_title("Kmer Distribution")
|
|
|
11 |
wens_method_heatmap,
|
12 |
plot_fcgr,
|
13 |
plot_persistence_homology,
|
14 |
+
plot_distrobutions
|
15 |
)
|
16 |
import os
|
17 |
import matplotlib as mpl
|
|
|
71 |
elif plot_type == "Persistant Homology":
|
72 |
filtered_df = df.groupby("Organism_Name").apply(filter_and_select).reset_index(drop=True)
|
73 |
return plot_persistence_homology(filtered_df["Sequence"], filtered_df["Organism_Name"])
|
74 |
+
|
75 |
+
with ui.nav_panel("Viral Genome Distributions"):
|
76 |
+
ui.panel_title("How does sequence distribution vary across sequence length?")
|
77 |
+
with ui.layout_columns():
|
78 |
+
with ui.card():
|
79 |
+
ui.input_selectize("virus_selector_1", "Select your viruses:", virus, multiple=True, selected=None)
|
80 |
+
with ui.card():
|
81 |
+
ui.input_slider(
|
82 |
+
"basepair","Select basepair",0, 1000, 15
|
83 |
+
)
|
84 |
+
|
85 |
+
@render.plot()
|
86 |
+
def plot_distro():
|
87 |
+
df = pd.read_parquet("virus_ds.parquet")
|
88 |
+
df = df[df["Organism_Name"].isin(input.virus_selector())]
|
89 |
+
grouped = df.groupby("Organism_Name")["Sequence"].apply(list)
|
90 |
+
return plot_distrobutions(grouped, grouped.index, input.basepair())
|
91 |
|
92 |
with ui.nav_panel("Viral Microstructure"):
|
93 |
ui.panel_title("Kmer Distribution")
|