-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
198 lines (179 loc) · 5.06 KB
/
Copy pathapp.py
File metadata and controls
198 lines (179 loc) · 5.06 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
"""
VOC-Insect-Plant Interaction Library
=====================================
A cheminformatics-enhanced library for Volatile Organic Compounds
and their interactions with insects, host plants, and natural enemies.
Run:
streamlit run app.py
"""
import streamlit as st
st.set_page_config(
page_title="VOC·BIO Library",
page_icon="🌿",
layout="wide",
initial_sidebar_state="expanded",
)
# ── Custom CSS ──────────────────────────────────────────────────────────────
st.markdown("""
<style>
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Mono:wght@400;600&family=Inter:wght@300;400;500;600&display=swap');
/* Global */
html, body, [class*="css"] {
font-family: 'Inter', sans-serif;
}
/* Dark sidebar */
[data-testid="stSidebar"] {
background: #0d1117 !important;
}
[data-testid="stSidebar"] * {
color: #c9d1d9 !important;
}
[data-testid="stSidebar"] .stRadio label {
font-size: 0.9rem;
padding: 4px 0;
}
/* Hero */
.hero-title {
font-family: 'DM Serif Display', serif;
font-size: 3.4rem;
color: #1a3a2a;
line-height: 1.1;
margin: 0;
}
.hero-subtitle {
font-family: 'IBM Plex Mono', monospace;
font-size: 0.85rem;
color: #4a7c59;
letter-spacing: 0.12em;
text-transform: uppercase;
margin-top: 8px;
}
/* Stat cards */
.stat-card {
background: linear-gradient(135deg, #f0f9f4 0%, #e6f3ec 100%);
border: 1px solid #b7dfc9;
border-radius: 12px;
padding: 20px 24px;
text-align: center;
}
.stat-number {
font-family: 'DM Serif Display', serif;
font-size: 2.4rem;
color: #1a3a2a;
line-height: 1;
}
.stat-label {
font-size: 0.78rem;
color: #4a7c59;
text-transform: uppercase;
letter-spacing: 0.1em;
margin-top: 4px;
}
/* Badges */
.badge-attractant {
background: #d1fae5; color: #065f46;
padding: 3px 10px; border-radius: 20px;
font-size: 0.78rem; font-weight: 600;
}
.badge-repellent {
background: #fee2e2; color: #991b1b;
padding: 3px 10px; border-radius: 20px;
font-size: 0.78rem; font-weight: 600;
}
.badge-class {
background: #ede9fe; color: #4c1d95;
padding: 3px 10px; border-radius: 20px;
font-size: 0.78rem; font-weight: 600;
}
/* Section headers */
.section-head {
font-family: 'DM Serif Display', serif;
font-size: 1.8rem;
color: #1a3a2a;
border-bottom: 2px solid #b7dfc9;
padding-bottom: 8px;
margin-bottom: 20px;
}
/* Mol card */
.mol-card {
background: white;
border: 1px solid #d1fae5;
border-radius: 12px;
padding: 16px;
margin-bottom: 12px;
}
/* SMILES display */
.smiles-box {
font-family: 'IBM Plex Mono', monospace;
font-size: 0.78rem;
background: #f6f8fa;
border: 1px solid #d0d7de;
border-radius: 6px;
padding: 6px 10px;
word-break: break-all;
color: #24292f;
}
/* Info box */
.info-box {
background: #f0fdf4;
border-left: 4px solid #22c55e;
border-radius: 0 8px 8px 0;
padding: 12px 16px;
font-size: 0.88rem;
color: #166534;
margin: 12px 0;
}
/* Footer */
.footer {
font-family: 'IBM Plex Mono', monospace;
font-size: 0.72rem;
color: #8b949e;
text-align: center;
margin-top: 40px;
padding-top: 20px;
border-top: 1px solid #e6f3ec;
}
</style>
""", unsafe_allow_html=True)
# ── Sidebar Navigation ───────────────────────────────────────────────────────
with st.sidebar:
st.markdown("### 🌿 VOC·BIO Library")
st.markdown("---")
page = st.radio(
"Navigate",
[
"Dashboard",
"VOC Library",
"Molecule Explorer",
"Insect–Plant Database",
"Bioassay Results",
"Interaction Network",
"Similarity Search",
],
label_visibility="collapsed",
)
st.markdown("---")
st.markdown("""
<div style='font-size:0.75rem; color:#8b949e; line-height:1.6;'>
Built with <b>Streamlit</b> + <b>RDKit</b><br>
Cheminformatics-enhanced<br>
insect–VOC–plant library<br><br>
<i>Taif University ×<br>Collaboration Project</i>
</div>
""", unsafe_allow_html=True)
# ── Page Router ──────────────────────────────────────────────────────────────
if page == "Dashboard":
from modules.dashboard import render
elif page == "VOC Library":
from modules.voc_library import render
elif page == "Molecule Explorer":
from modules.molecule_explorer import render
elif page == "Insect–Plant Database":
from modules.insect_plant import render
elif page == "Bioassay Results":
from modules.bioassay import render
elif page == "Interaction Network":
from modules.network import render
elif page == "Similarity Search":
from modules.similarity import render
render()