Update app.py
Browse files
app.py
CHANGED
|
@@ -176,22 +176,30 @@ def render_ui():
|
|
| 176 |
st.subheader("AI summary")
|
| 177 |
st.info(res['ai_summary'])
|
| 178 |
|
| 179 |
-
|
| 180 |
with tabs[1]:
|
| 181 |
st.header("Gene / Variant signals")
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 189 |
st.markdown("### MeSH definitions")
|
| 190 |
-
for d in
|
| 191 |
st.write(f"- {d}")
|
| 192 |
-
|
|
|
|
|
|
|
|
|
|
| 193 |
st.markdown("### DisGeNET links")
|
| 194 |
-
st.json(
|
| 195 |
|
| 196 |
# --- Trials tab
|
| 197 |
with tabs[2]:
|
|
|
|
| 176 |
st.subheader("AI summary")
|
| 177 |
st.info(res['ai_summary'])
|
| 178 |
|
| 179 |
+
# --- Genes tab
|
| 180 |
with tabs[1]:
|
| 181 |
st.header("Gene / Variant signals")
|
| 182 |
+
# Filter out non-dict entries (e.g., errors)
|
| 183 |
+
valid_genes = [g for g in res['genes'] if isinstance(g, dict)]
|
| 184 |
+
if valid_genes:
|
| 185 |
+
for g in valid_genes:
|
| 186 |
+
sym = g.get('symbol') or g.get('name') or ''
|
| 187 |
+
st.write(f"- **{sym}**")
|
| 188 |
+
else:
|
| 189 |
+
st.info("No gene signals returned.")
|
| 190 |
+
|
| 191 |
+
# MeSH definitions (skip errors/non-strings)
|
| 192 |
+
mesh_list = [d for d in res['mesh_defs'] if isinstance(d, str) and d]
|
| 193 |
+
if mesh_list:
|
| 194 |
st.markdown("### MeSH definitions")
|
| 195 |
+
for d in mesh_list:
|
| 196 |
st.write(f"- {d}")
|
| 197 |
+
|
| 198 |
+
# DisGeNET links (skip non-dict entries)
|
| 199 |
+
gene_disease = [d for d in res['gene_disease'] if isinstance(d, dict)]
|
| 200 |
+
if gene_disease:
|
| 201 |
st.markdown("### DisGeNET links")
|
| 202 |
+
st.json(gene_disease[:15])
|
| 203 |
|
| 204 |
# --- Trials tab
|
| 205 |
with tabs[2]:
|