diff --git a/app.py b/app.py index 43a2ebe..fab6517 100644 --- a/app.py +++ b/app.py @@ -4,13 +4,15 @@ import variant_deconv import resistance_mut import resistance_mut_silo +import web_explorer PAGES = { "Home": {"module": index}, "Mutation Frequency": {"module": mutation_freq}, "Variant Deconvolution": {"module": variant_deconv}, "Resistance Mutations (clinical)": {"module": resistance_mut}, - "Resistance Mutations (ww)": {"module": resistance_mut_silo} + "Resistance Mutations (ww)": {"module": resistance_mut_silo}, + "Web Explore": {"module": web_explorer} } def sidebar(): diff --git a/resistance_mut_silo.py b/resistance_mut_silo.py index aab2bd6..78f0cca 100644 --- a/resistance_mut_silo.py +++ b/resistance_mut_silo.py @@ -142,8 +142,9 @@ def app(): # Apply the lambda function to each element in the mutations list formatted_mutations = [format_mutation(mutation) for mutation in mutations] - st.write(f"Selected mutations:") - st.write(formatted_mutations) + if st.button("Show Mutations"): + st.write(f"Selected mutations:") + st.write(formatted_mutations) # Allow the user to choose a date range diff --git a/web_explorer.py b/web_explorer.py new file mode 100644 index 0000000..a1c5dbe --- /dev/null +++ b/web_explorer.py @@ -0,0 +1,59 @@ +import streamlit as st +import streamlit.components.v1 as components +import pandas as pd + +LAPIS_URL = "http://localhost:8080" + + +def app(): + + ## Add a title + st.title("V-Pipe Web Explorer") + + ## Add a header + st.header("Explore Mutations Over Time") + + ## Add a subheader + st.subheader("This page allows you to explore mutations over time by gene and proportion.") + + ## select dat range + st.write("Select a date range:") + date_range = st.date_input("Select a date range:", [pd.to_datetime("2024-09-30"), pd.to_datetime("2024-10-16")]) + + ## Add a horizontal line + st.markdown("---") + + start_date = date_range[0].strftime("%Y-%m-%d") + end_date = date_range[1].strftime("%Y-%m-%d") + + components.html( + f""" + + + + + + + + + + + + + + + """, + height=3000, + ) + + +if __name__ == "__main__": + app() \ No newline at end of file