Repository navigation
Expand file tree
/
Copy pathapp.py
More file actions
45 lines (39 loc) Β· 2.05 KB
/
Copy pathapp.py
File metadata and controls
45 lines (39 loc) Β· 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Needed as polars doesnt work well with forking on unix systems
import multiprocessing as mp
if mp.get_start_method(allow_none=True) != "spawn":
mp.set_start_method("spawn", force=True)
import streamlit as st
from pathlib import Path
import json
# For some reason the windows version only works if this is imported here
import pyopenms
if "settings" not in st.session_state:
with open("settings.json", "r") as f:
st.session_state.settings = json.load(f)
if __name__ == '__main__':
# A local install exports results to a folder instead of downloading them.
export = "Export" if not st.session_state.settings["online_deployment"] else "Download"
export_icon = "π€" if export == "Export" else "β¬οΈ"
pages = {
"FLASHApp" : [
st.Page(Path("content", "quickstart.py"), title="Quickstart", icon="π"),
#st.Page(Path("content", "user_guide.md").read_text(encoding="utf-8"), unsafe_allow_html=True),
st.Page(Path("content", "user_guide.py"), title="User Guide", icon="π"),
],
# One workflow: FLASHDeconv for every run, FLASHTnT when a database is given
"β‘οΈ Top-down analysis" : [
st.Page(Path("content", "TopDown", "TopDownConfigure.py"), title="Describe experiment", icon="βοΈ"),
st.Page(Path("content", "TopDown", "TopDownRun.py"), title="Run analysis", icon="π"),
st.Page(Path("content", "TopDown", "TopDownViewer.py"), title="Viewer", icon="π"),
st.Page(Path("content", "TopDown", "TopDownDownload.py"), title=export, icon=export_icon),
],
}
# FLASHIda: developer feature of the local app (βοΈ Settings β Developer password)
from src import flashida
if flashida.available():
pages["π§ FLASHIda"] = [
st.Page(Path("content", "FLASHIda", "FLASHIdaAcquisition.py"), title="Acquisition", icon="βοΈ"),
st.Page(Path("content", "FLASHIda", "FLASHIdaViewer.py"), title="Viewer", icon="π"),
]
pg = st.navigation(pages, expanded=True)
pg.run()