Delete app.py
Browse files
app.py
DELETED
|
@@ -1,755 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import pandas as pd
|
| 3 |
-
import numpy as np
|
| 4 |
-
import json, re, csv
|
| 5 |
-
import matplotlib
|
| 6 |
-
matplotlib.use("Agg")
|
| 7 |
-
import matplotlib.pyplot as plt
|
| 8 |
-
from io import BytesIO
|
| 9 |
-
from PIL import Image
|
| 10 |
-
from datetime import datetime
|
| 11 |
-
from pathlib import Path
|
| 12 |
-
|
| 13 |
-
BG = "#0f172a"
|
| 14 |
-
CARD = "#1e293b"
|
| 15 |
-
ACC = "#f97316"
|
| 16 |
-
ACC2 = "#38bdf8"
|
| 17 |
-
TXT = "#f1f5f9"
|
| 18 |
-
GRN = "#22c55e"
|
| 19 |
-
RED = "#ef4444"
|
| 20 |
-
DIM = "#8e9bae"
|
| 21 |
-
BORDER = "#334155"
|
| 22 |
-
|
| 23 |
-
LOG_PATH = Path("/tmp/lab_journal.csv")
|
| 24 |
-
|
| 25 |
-
def log_entry(tab, inputs, result, note=""):
|
| 26 |
-
try:
|
| 27 |
-
write_header = not LOG_PATH.exists()
|
| 28 |
-
with open(LOG_PATH, "a", newline="", encoding="utf-8") as f:
|
| 29 |
-
w = csv.DictWriter(f, fieldnames=["timestamp","tab","inputs","result","note"])
|
| 30 |
-
if write_header: w.writeheader()
|
| 31 |
-
w.writerow({"timestamp": datetime.now().strftime("%Y-%m-%d %H:%M"),
|
| 32 |
-
"tab": tab, "inputs": str(inputs),
|
| 33 |
-
"result": str(result)[:200], "note": note})
|
| 34 |
-
except Exception: pass
|
| 35 |
-
|
| 36 |
-
def load_journal():
|
| 37 |
-
try:
|
| 38 |
-
if not LOG_PATH.exists():
|
| 39 |
-
return pd.DataFrame(columns=["timestamp","tab","inputs","result","note"])
|
| 40 |
-
return pd.read_csv(LOG_PATH)
|
| 41 |
-
except Exception:
|
| 42 |
-
return pd.DataFrame(columns=["timestamp","tab","inputs","result","note"])
|
| 43 |
-
|
| 44 |
-
def save_note(note, tab, last_result):
|
| 45 |
-
log_entry(tab, "", last_result, note)
|
| 46 |
-
return "✅ Saved!", load_journal()
|
| 47 |
-
|
| 48 |
-
# ── DATABASES ─────────────────────────────────────────────────────────────────
|
| 49 |
-
MIRNA_DB = {
|
| 50 |
-
"BRCA2": [
|
| 51 |
-
{"miRNA":"hsa-miR-148a-3p","log2FC":-0.70,"padj":0.013,"targets":"DNMT1, AKT2","pathway":"Epigenetic reprogramming"},
|
| 52 |
-
{"miRNA":"hsa-miR-30e-5p","log2FC":-0.49,"padj":0.032,"targets":"MYC, KRAS","pathway":"Oncogene suppression"},
|
| 53 |
-
{"miRNA":"hsa-miR-551b-3p","log2FC":-0.59,"padj":0.048,"targets":"SMAD4, CDK6","pathway":"TGF-beta / CDK4/6"},
|
| 54 |
-
{"miRNA":"hsa-miR-22-3p","log2FC":-0.43,"padj":0.041,"targets":"HIF1A, PTEN","pathway":"Hypoxia / PI3K"},
|
| 55 |
-
{"miRNA":"hsa-miR-200c-3p","log2FC":-0.38,"padj":0.044,"targets":"ZEB1, ZEB2","pathway":"EMT suppression"},
|
| 56 |
-
],
|
| 57 |
-
"BRCA1": [
|
| 58 |
-
{"miRNA":"hsa-miR-155-5p","log2FC":-0.81,"padj":0.008,"targets":"SHIP1, SOCS1","pathway":"Immune evasion"},
|
| 59 |
-
{"miRNA":"hsa-miR-146a-5p","log2FC":-0.65,"padj":0.019,"targets":"TRAF6, IRAK1","pathway":"NF-kB signalling"},
|
| 60 |
-
{"miRNA":"hsa-miR-21-5p","log2FC":-0.55,"padj":0.027,"targets":"PTEN, PDCD4","pathway":"Apoptosis"},
|
| 61 |
-
{"miRNA":"hsa-miR-17-5p","log2FC":-0.47,"padj":0.036,"targets":"RB1, E2F1","pathway":"Cell cycle"},
|
| 62 |
-
{"miRNA":"hsa-miR-34a-5p","log2FC":-0.41,"padj":0.049,"targets":"BCL2, CDK6","pathway":"p53 axis"},
|
| 63 |
-
],
|
| 64 |
-
"TP53": [
|
| 65 |
-
{"miRNA":"hsa-miR-34a-5p","log2FC":-1.10,"padj":0.001,"targets":"BCL2, CDK6","pathway":"p53-miR-34 axis"},
|
| 66 |
-
{"miRNA":"hsa-miR-192-5p","log2FC":-0.90,"padj":0.005,"targets":"MDM2, DHFR","pathway":"p53 feedback"},
|
| 67 |
-
{"miRNA":"hsa-miR-145-5p","log2FC":-0.75,"padj":0.012,"targets":"MYC, EGFR","pathway":"Growth suppression"},
|
| 68 |
-
{"miRNA":"hsa-miR-107","log2FC":-0.62,"padj":0.023,"targets":"CDK6, HIF1B","pathway":"Hypoxia / cell cycle"},
|
| 69 |
-
{"miRNA":"hsa-miR-215-5p","log2FC":-0.51,"padj":0.038,"targets":"DTL, DHFR","pathway":"DNA damage response"},
|
| 70 |
-
],
|
| 71 |
-
}
|
| 72 |
-
SIRNA_DB = {
|
| 73 |
-
"LUAD": [
|
| 74 |
-
{"Gene":"SPC24","dCERES":-0.175,"log2FC":1.13,"Drug_status":"Novel","siRNA":"GCAGCUGAAGAAACUGAAU"},
|
| 75 |
-
{"Gene":"BUB1B","dCERES":-0.119,"log2FC":1.12,"Drug_status":"Novel","siRNA":"CCAAAGAGCUGAAGAACAU"},
|
| 76 |
-
{"Gene":"CDC45","dCERES":-0.144,"log2FC":1.26,"Drug_status":"Novel","siRNA":"GCAUCAAGAUGAAGGAGAU"},
|
| 77 |
-
{"Gene":"PLK1","dCERES":-0.239,"log2FC":1.03,"Drug_status":"Clinical","siRNA":"GACGCUCAAGAUGCAGAUU"},
|
| 78 |
-
{"Gene":"CDK1","dCERES":-0.201,"log2FC":1.00,"Drug_status":"Clinical","siRNA":"GCAGAAGCACUGAAGAUUU"},
|
| 79 |
-
],
|
| 80 |
-
"BRCA": [
|
| 81 |
-
{"Gene":"AURKA","dCERES":-0.165,"log2FC":1.20,"Drug_status":"Clinical","siRNA":"GCACUGAAGAUGCAGAAUU"},
|
| 82 |
-
{"Gene":"AURKB","dCERES":-0.140,"log2FC":1.15,"Drug_status":"Clinical","siRNA":"CCUGAAGACGCUCAAGGUU"},
|
| 83 |
-
{"Gene":"CENPW","dCERES":-0.125,"log2FC":0.95,"Drug_status":"Novel","siRNA":"GCAGAAGCACUGAAGAUUU"},
|
| 84 |
-
{"Gene":"RFC2","dCERES":-0.136,"log2FC":0.50,"Drug_status":"Novel","siRNA":"GCAAGAUGCAGAAGCACUU"},
|
| 85 |
-
{"Gene":"TYMS","dCERES":-0.131,"log2FC":0.72,"Drug_status":"Approved","siRNA":"GGACGCUCAAGAUGCAGAU"},
|
| 86 |
-
],
|
| 87 |
-
"COAD": [
|
| 88 |
-
{"Gene":"KRAS","dCERES":-0.210,"log2FC":0.80,"Drug_status":"Clinical","siRNA":"GCUGGAGCUGGUGGUAGUU"},
|
| 89 |
-
{"Gene":"WEE1","dCERES":-0.180,"log2FC":1.05,"Drug_status":"Clinical","siRNA":"GCAGCUGAAGAAACUGAAU"},
|
| 90 |
-
{"Gene":"CHEK1","dCERES":-0.155,"log2FC":0.90,"Drug_status":"Clinical","siRNA":"CCAAAGAGCUGAAGAACAU"},
|
| 91 |
-
{"Gene":"RFC2","dCERES":-0.130,"log2FC":0.55,"Drug_status":"Novel","siRNA":"GCAUCAAGAUGAAGGAGAU"},
|
| 92 |
-
{"Gene":"PKMYT1","dCERES":-0.122,"log2FC":1.07,"Drug_status":"Clinical","siRNA":"GACGCUCAAGAUGCAGAUU"},
|
| 93 |
-
],
|
| 94 |
-
}
|
| 95 |
-
CERNA = [
|
| 96 |
-
{"lncRNA":"CYTOR","miRNA":"hsa-miR-138-5p","target":"AKT1","pathway":"TREM2 core signaling"},
|
| 97 |
-
{"lncRNA":"CYTOR","miRNA":"hsa-miR-138-5p","target":"NFKB1","pathway":"Neuroinflammation"},
|
| 98 |
-
{"lncRNA":"GAS5","miRNA":"hsa-miR-21-5p","target":"PTEN","pathway":"Neuroinflammation"},
|
| 99 |
-
{"lncRNA":"GAS5","miRNA":"hsa-miR-222-3p","target":"IL1B","pathway":"Neuroinflammation"},
|
| 100 |
-
{"lncRNA":"HOTAIRM1","miRNA":"hsa-miR-9-5p","target":"TREM2","pathway":"Direct TREM2 regulation"},
|
| 101 |
-
]
|
| 102 |
-
ASO = [
|
| 103 |
-
{"lncRNA":"GAS5","position":119,"accessibility":0.653,"GC_pct":50,"Tm":47.2,"priority":"HIGH"},
|
| 104 |
-
{"lncRNA":"CYTOR","position":507,"accessibility":0.653,"GC_pct":50,"Tm":46.8,"priority":"HIGH"},
|
| 105 |
-
{"lncRNA":"HOTAIRM1","position":234,"accessibility":0.621,"GC_pct":44,"Tm":44.1,"priority":"MEDIUM"},
|
| 106 |
-
{"lncRNA":"LINC00847","position":89,"accessibility":0.598,"GC_pct":56,"Tm":48.3,"priority":"MEDIUM"},
|
| 107 |
-
{"lncRNA":"ZFAS1","position":312,"accessibility":0.571,"GC_pct":48,"Tm":45.5,"priority":"MEDIUM"},
|
| 108 |
-
]
|
| 109 |
-
FGFR3 = {
|
| 110 |
-
"P1 (hairpin loop)": [
|
| 111 |
-
{"Compound":"CHEMBL1575701","RNA_score":0.809,"Toxicity":0.01,"Final_score":0.793},
|
| 112 |
-
{"Compound":"CHEMBL15727","RNA_score":0.805,"Toxicity":0.00,"Final_score":0.789},
|
| 113 |
-
{"Compound":"Thioguanine","RNA_score":0.888,"Toxicity":32.5,"Final_score":0.742},
|
| 114 |
-
{"Compound":"Deazaguanine","RNA_score":0.888,"Toxicity":35.0,"Final_score":0.735},
|
| 115 |
-
{"Compound":"CHEMBL441","RNA_score":0.775,"Toxicity":5.2,"Final_score":0.721},
|
| 116 |
-
],
|
| 117 |
-
"P10 (G-quadruplex)": [
|
| 118 |
-
{"Compound":"CHEMBL15727","RNA_score":0.805,"Toxicity":0.00,"Final_score":0.789},
|
| 119 |
-
{"Compound":"CHEMBL5411515","RNA_score":0.945,"Toxicity":37.1,"Final_score":0.761},
|
| 120 |
-
{"Compound":"CHEMBL90","RNA_score":0.760,"Toxicity":2.1,"Final_score":0.745},
|
| 121 |
-
{"Compound":"CHEMBL102","RNA_score":0.748,"Toxicity":8.4,"Final_score":0.712},
|
| 122 |
-
{"Compound":"Berberine","RNA_score":0.735,"Toxicity":3.2,"Final_score":0.708},
|
| 123 |
-
],
|
| 124 |
-
}
|
| 125 |
-
VARIANT_DB = {
|
| 126 |
-
"BRCA1:p.R1699Q": {"score":0.03,"cls":"Benign","conf":"High"},
|
| 127 |
-
"BRCA1:p.R1699W": {"score":0.97,"cls":"Pathogenic","conf":"High"},
|
| 128 |
-
"BRCA2:p.D2723A": {"score":0.999,"cls":"Pathogenic","conf":"High"},
|
| 129 |
-
"TP53:p.R248W": {"score":0.998,"cls":"Pathogenic","conf":"High"},
|
| 130 |
-
"TP53:p.R248Q": {"score":0.995,"cls":"Pathogenic","conf":"High"},
|
| 131 |
-
"EGFR:p.L858R": {"score":0.96,"cls":"Pathogenic","conf":"High"},
|
| 132 |
-
"ALK:p.F1174L": {"score":0.94,"cls":"Pathogenic","conf":"High"},
|
| 133 |
-
}
|
| 134 |
-
PLAIN = {
|
| 135 |
-
"Pathogenic": "This variant is likely to cause disease. Clinical follow-up is strongly recommended.",
|
| 136 |
-
"Likely Pathogenic": "This variant is probably harmful. Discuss with your doctor.",
|
| 137 |
-
"Benign": "This variant is likely harmless. Common in the general population.",
|
| 138 |
-
"Likely Benign": "This variant is probably harmless. No strong reason for concern.",
|
| 139 |
-
}
|
| 140 |
-
BM_W = {
|
| 141 |
-
"CTHRC1":0.18,"FHL2":0.15,"LDHA":0.14,"P4HA1":0.13,
|
| 142 |
-
"SERPINH1":0.12,"ABCA8":-0.11,"CA4":-0.10,"CKB":-0.09,
|
| 143 |
-
"NNMT":0.08,"CACNA2D2":-0.07
|
| 144 |
-
}
|
| 145 |
-
PROTEINS = ["albumin","apolipoprotein","fibrinogen","vitronectin",
|
| 146 |
-
"clusterin","igm","iga","igg","complement","transferrin",
|
| 147 |
-
"alpha-2-macroglobulin"]
|
| 148 |
-
|
| 149 |
-
# ── LOGIC ─────────────────────────────────────────────────────────────────────
|
| 150 |
-
def predict_mirna(gene):
|
| 151 |
-
df = pd.DataFrame(MIRNA_DB.get(gene, []))
|
| 152 |
-
log_entry("S1-B | S1-R2 | miRNA", gene, f"{len(df)} miRNAs")
|
| 153 |
-
return df
|
| 154 |
-
|
| 155 |
-
def predict_sirna(cancer):
|
| 156 |
-
df = pd.DataFrame(SIRNA_DB.get(cancer, []))
|
| 157 |
-
log_entry("S1-B | S1-R3 | siRNA", cancer, f"{len(df)} targets")
|
| 158 |
-
return df
|
| 159 |
-
|
| 160 |
-
def get_lncrna():
|
| 161 |
-
log_entry("S1-B | S1-R4 | lncRNA", "load", "ceRNA+ASO")
|
| 162 |
-
return pd.DataFrame(CERNA), pd.DataFrame(ASO)
|
| 163 |
-
|
| 164 |
-
def predict_drug(pocket):
|
| 165 |
-
df = pd.DataFrame(FGFR3.get(pocket, []))
|
| 166 |
-
fig, ax = plt.subplots(figsize=(6, 4), facecolor=CARD)
|
| 167 |
-
ax.set_facecolor(CARD)
|
| 168 |
-
ax.barh(df["Compound"], df["Final_score"], color=ACC)
|
| 169 |
-
ax.set_xlabel("Final Score", color=TXT); ax.tick_params(colors=TXT)
|
| 170 |
-
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 171 |
-
ax.set_title(f"Top compounds — {pocket}", color=TXT, fontsize=10)
|
| 172 |
-
plt.tight_layout()
|
| 173 |
-
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 174 |
-
log_entry("S1-C | S1-R5 | Drug", pocket, f"Top: {df.iloc[0]['Compound'] if len(df) else 'none'}")
|
| 175 |
-
return df, Image.open(buf)
|
| 176 |
-
|
| 177 |
-
def predict_variant(hgvs, sift, polyphen, gnomad):
|
| 178 |
-
hgvs = hgvs.strip()
|
| 179 |
-
if hgvs in VARIANT_DB:
|
| 180 |
-
r = VARIANT_DB[hgvs]; cls, conf, score = r["cls"], r["conf"], r["score"]
|
| 181 |
-
else:
|
| 182 |
-
score = 0.0
|
| 183 |
-
if sift < 0.05: score += 0.4
|
| 184 |
-
if polyphen > 0.85: score += 0.35
|
| 185 |
-
if gnomad < 0.0001: score += 0.25
|
| 186 |
-
score = round(score, 3)
|
| 187 |
-
cls = "Pathogenic" if score > 0.6 else "Likely Pathogenic" if score > 0.4 else "Benign"
|
| 188 |
-
conf = "High" if (sift < 0.01 or sift > 0.9) else "Moderate"
|
| 189 |
-
colour = RED if "Pathogenic" in cls else GRN
|
| 190 |
-
icon = "⚠️ WARNING" if "Pathogenic" in cls else "✅ OK"
|
| 191 |
-
log_entry("S1-A | S1-R1 | OpenVariant", hgvs or f"SIFT={sift}", f"{cls} score={score}")
|
| 192 |
-
return (
|
| 193 |
-
f"<div style=\'background:{CARD};padding:16px;border-radius:8px;font-family:sans-serif;color:{TXT}\'>"
|
| 194 |
-
f"<p style=\'font-size:11px;color:{DIM};margin:0 0 8px\'>S1-A · PHYLO-GENOMICS · S1-R1</p>"
|
| 195 |
-
f"<h3 style=\'color:{colour};margin:0 0 8px\'>{icon} {cls}</h3>"
|
| 196 |
-
f"<p>Score: <b>{score:.3f}</b> | Confidence: <b>{conf}</b></p>"
|
| 197 |
-
f"<div style=\'background:{BORDER};border-radius:4px;height:14px\'>"
|
| 198 |
-
f"<div style=\'background:{colour};height:14px;border-radius:4px;width:{int(score*100)}%\'></div></div>"
|
| 199 |
-
f"<p style=\'margin-top:12px\'>{PLAIN.get(cls,'')}</p>"
|
| 200 |
-
f"<p style=\'font-size:11px;color:{DIM}\'>Research only. Not clinical advice.</p></div>"
|
| 201 |
-
)
|
| 202 |
-
|
| 203 |
-
def predict_corona(size, zeta, peg, lipid):
|
| 204 |
-
score = 0
|
| 205 |
-
if lipid == "Ionizable": score += 2
|
| 206 |
-
elif lipid == "Cationic": score += 1
|
| 207 |
-
if abs(zeta) < 10: score += 1
|
| 208 |
-
if peg > 1.5: score += 2
|
| 209 |
-
if size < 100: score += 1
|
| 210 |
-
dominant = ["ApoE","Albumin","Fibrinogen","Vitronectin","ApoA-I"][min(score, 4)]
|
| 211 |
-
efficacy = "High" if score >= 4 else "Medium" if score >= 2 else "Low"
|
| 212 |
-
log_entry("S1-D | S1-R6 | Corona", f"size={size},peg={peg}", f"dominant={dominant}")
|
| 213 |
-
return f"**Dominant corona protein:** {dominant}\n\n**Predicted efficacy:** {efficacy}\n\n**Score:** {score}/6"
|
| 214 |
-
|
| 215 |
-
def predict_cancer(c1,c2,c3,c4,c5,c6,c7,c8,c9,c10):
|
| 216 |
-
vals = [c1,c2,c3,c4,c5,c6,c7,c8,c9,c10]
|
| 217 |
-
names, weights = list(BM_W.keys()), list(BM_W.values())
|
| 218 |
-
raw = sum(v*w for v,w in zip(vals, weights))
|
| 219 |
-
prob = 1 / (1 + np.exp(-raw * 2))
|
| 220 |
-
label = "CANCER" if prob > 0.5 else "HEALTHY"
|
| 221 |
-
colour = RED if prob > 0.5 else GRN
|
| 222 |
-
contribs = [v*w for v,w in zip(vals, weights)]
|
| 223 |
-
fig, ax = plt.subplots(figsize=(6, 3.5), facecolor=CARD)
|
| 224 |
-
ax.set_facecolor(CARD)
|
| 225 |
-
ax.barh(names, contribs, color=[ACC if c > 0 else ACC2 for c in contribs])
|
| 226 |
-
ax.axvline(0, color=TXT, linewidth=0.8)
|
| 227 |
-
ax.set_xlabel("Contribution to cancer score", color=TXT)
|
| 228 |
-
ax.tick_params(colors=TXT, labelsize=8)
|
| 229 |
-
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 230 |
-
ax.set_title("Protein contributions", color=TXT, fontsize=10)
|
| 231 |
-
plt.tight_layout()
|
| 232 |
-
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 233 |
-
log_entry("S1-E | S1-R9 | LiquidBiopsy", f"CTHRC1={c1},FHL2={c2}", f"{label} {prob:.2f}")
|
| 234 |
-
return (
|
| 235 |
-
f"<div style=\'background:{CARD};padding:14px;border-radius:8px;font-family:sans-serif;\'>"
|
| 236 |
-
f"<p style=\'font-size:11px;color:{DIM};margin:0 0 6px\'>S1-E · PHYLO-BIOMARKERS · S1-R9</p>"
|
| 237 |
-
f"<span style=\'color:{colour};font-size:24px;font-weight:bold\'>{label}</span><br>"
|
| 238 |
-
f"<span style=\'color:{TXT};font-size:14px\'>Probability: {prob:.2f}</span></div>"
|
| 239 |
-
), Image.open(buf)
|
| 240 |
-
|
| 241 |
-
def predict_flow(size, zeta, peg, charge, flow_rate):
|
| 242 |
-
csi = round(min((flow_rate/40)*0.6 + (peg/5)*0.2 + (1 if charge=="Cationic" else 0)*0.2, 1.0), 3)
|
| 243 |
-
stability = "High remodeling" if csi > 0.6 else "Medium" if csi > 0.3 else "Stable"
|
| 244 |
-
t = np.linspace(0, 60, 200)
|
| 245 |
-
kf, ks = 0.03*(1+flow_rate/40), 0.038*(1+flow_rate/40)
|
| 246 |
-
fig, ax = plt.subplots(figsize=(6, 3.5), facecolor=CARD)
|
| 247 |
-
ax.set_facecolor(CARD)
|
| 248 |
-
ax.plot(t, 60*np.exp(-0.03*t)+20, color="#60a5fa", ls="--", label="Albumin (static)")
|
| 249 |
-
ax.plot(t, 60*np.exp(-kf*t)+10, color="#60a5fa", label="Albumin (flow)")
|
| 250 |
-
ax.plot(t, 14*(1-np.exp(-0.038*t))+5, color=ACC, ls="--", label="ApoE (static)")
|
| 251 |
-
ax.plot(t, 20*(1-np.exp(-ks*t))+5, color=ACC, label="ApoE (flow)")
|
| 252 |
-
ax.set_xlabel("Time (min)", color=TXT); ax.set_ylabel("% Corona", color=TXT)
|
| 253 |
-
ax.tick_params(colors=TXT); ax.legend(fontsize=7, labelcolor=TXT, facecolor=CARD)
|
| 254 |
-
for sp in ax.spines.values(): sp.set_edgecolor(BORDER)
|
| 255 |
-
ax.set_title("Vroman Effect — flow vs static", color=TXT, fontsize=9)
|
| 256 |
-
plt.tight_layout()
|
| 257 |
-
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 258 |
-
log_entry("S1-D | S1-R7 | FlowCorona", f"flow={flow_rate}", f"CSI={csi}")
|
| 259 |
-
return f"**Corona Shift Index: {csi}** — {stability}", Image.open(buf)
|
| 260 |
-
|
| 261 |
-
def predict_bbb(smiles, pka, zeta):
|
| 262 |
-
logp = smiles.count("C")*0.3 - smiles.count("O")*0.5 + 1.5
|
| 263 |
-
apoe_pct = max(0, min(40, (7.0-pka)*8 + abs(zeta)*0.5 + logp*0.8))
|
| 264 |
-
bbb_prob = min(0.95, apoe_pct/30)
|
| 265 |
-
tier = "HIGH (>20%)" if apoe_pct > 20 else "MEDIUM (10-20%)" if apoe_pct > 10 else "LOW (<10%)"
|
| 266 |
-
cats = ["ApoE%","BBB","logP","pKa fit","Zeta"]
|
| 267 |
-
vals = [apoe_pct/40, bbb_prob, min(logp/5,1), (7-abs(pka-6.5))/7, (10-abs(zeta))/10]
|
| 268 |
-
angles = np.linspace(0, 2*np.pi, len(cats), endpoint=False).tolist()
|
| 269 |
-
v2, a2 = vals+[vals[0]], angles+[angles[0]]
|
| 270 |
-
fig, ax = plt.subplots(figsize=(5, 4), subplot_kw={"polar":True}, facecolor=CARD)
|
| 271 |
-
ax.set_facecolor(CARD)
|
| 272 |
-
ax.plot(a2, v2, color=ACC, linewidth=2); ax.fill(a2, v2, color=ACC, alpha=0.2)
|
| 273 |
-
ax.set_xticks(angles); ax.set_xticklabels(cats, color=TXT, fontsize=8)
|
| 274 |
-
ax.tick_params(colors=TXT)
|
| 275 |
-
plt.tight_layout()
|
| 276 |
-
buf = BytesIO(); plt.savefig(buf, format="png", dpi=120, facecolor=CARD); plt.close(); buf.seek(0)
|
| 277 |
-
log_entry("S1-D | S1-R8 | LNPBrain", f"pka={pka},zeta={zeta}", f"ApoE={apoe_pct:.1f}%")
|
| 278 |
-
return f"**Predicted ApoE:** {apoe_pct:.1f}% — {tier}\n\n**BBB Probability:** {bbb_prob:.2f}", Image.open(buf)
|
| 279 |
-
|
| 280 |
-
def extract_corona(text):
|
| 281 |
-
out = {"nanoparticle_composition":"","size_nm":None,"zeta_mv":None,"PDI":None,
|
| 282 |
-
"protein_source":"","corona_proteins":[],"confidence":{}}
|
| 283 |
-
for pat, key in [(r"(\d+\.?\d*)\s*(?:nm|nanometer)","size_nm"),
|
| 284 |
-
(r"([+-]?\d+\.?\d*)\s*mV","zeta_mv"),
|
| 285 |
-
(r"PDI\s*[=:of]*\s*(\d+\.?\d*)","PDI")]:
|
| 286 |
-
m = re.search(pat, text, re.I)
|
| 287 |
-
if m: out[key] = float(m.group(1)); out["confidence"][key] = "HIGH"
|
| 288 |
-
for src in ["human plasma","human serum","fetal bovine serum","FBS","PBS"]:
|
| 289 |
-
if src.lower() in text.lower():
|
| 290 |
-
out["protein_source"] = src; out["confidence"]["protein_source"] = "HIGH"; break
|
| 291 |
-
out["corona_proteins"] = [{"name":p,"confidence":"MEDIUM"} for p in PROTEINS if p in text.lower()]
|
| 292 |
-
for lip in ["DSPC","DOPE","MC3","DLin","cholesterol","PEG","DOTAP"]:
|
| 293 |
-
if lip in text: out["nanoparticle_composition"] += lip + " "
|
| 294 |
-
out["nanoparticle_composition"] = out["nanoparticle_composition"].strip()
|
| 295 |
-
flags = []
|
| 296 |
-
if not out["size_nm"]: flags.append("size_nm not found")
|
| 297 |
-
if not out["zeta_mv"]: flags.append("zeta_mv not found")
|
| 298 |
-
if not out["corona_proteins"]: flags.append("no proteins detected")
|
| 299 |
-
summary = "All key fields extracted" if not flags else " | ".join(flags)
|
| 300 |
-
log_entry("S1-D | S1-R10 | NLP", text[:80], f"proteins={len(out['corona_proteins'])}")
|
| 301 |
-
return json.dumps(out, indent=2), summary
|
| 302 |
-
|
| 303 |
-
# ── HELPERS ───────────────────────────────────────────────────────────────────
|
| 304 |
-
def section_header(code, name, tagline, projects_html):
|
| 305 |
-
return (
|
| 306 |
-
f"<div style=\'background:{BG};border:1px solid {BORDER};padding:14px 18px;"
|
| 307 |
-
f"border-radius:8px;margin-bottom:12px;\'>"
|
| 308 |
-
f"<div style=\'display:flex;align-items:baseline;gap:10px;\'>"
|
| 309 |
-
f"<span style=\'color:{ACC2};font-size:16px;font-weight:700\'>{code}</span>"
|
| 310 |
-
f"<span style=\'color:{TXT};font-size:14px;font-weight:600\'>{name}</span>"
|
| 311 |
-
f"<span style=\'color:{DIM};font-size:12px\'>{tagline}</span></div>"
|
| 312 |
-
f"<div style=\'margin-top:8px;font-size:12px;color:{DIM}\'>{projects_html}</div>"
|
| 313 |
-
f"</div>"
|
| 314 |
-
)
|
| 315 |
-
|
| 316 |
-
def proj_badge(code, title, metric=""):
|
| 317 |
-
m = (f"<span style=\'background:#0f2a3f;color:{ACC2};padding:1px 7px;border-radius:3px;"
|
| 318 |
-
f"font-size:10px;margin-left:6px\'>{metric}</span>") if metric else ""
|
| 319 |
-
return (
|
| 320 |
-
f"<div style=\'background:{CARD};border-left:3px solid {ACC};"
|
| 321 |
-
f"padding:8px 12px;border-radius:0 6px 6px 0;margin-bottom:8px;\'>"
|
| 322 |
-
f"<span style=\'color:{DIM};font-size:11px\'>{code}</span>{m}<br>"
|
| 323 |
-
f"<span style=\'color:{TXT};font-size:14px;font-weight:600\'>{title}</span>"
|
| 324 |
-
f"</div>"
|
| 325 |
-
)
|
| 326 |
-
|
| 327 |
-
# ── CSS ───────────────────────────────────────────────────────────────────────
|
| 328 |
-
css = f"""
|
| 329 |
-
body, .gradio-container {{ background: {BG} !important; color: {TXT} !important; }}
|
| 330 |
-
|
| 331 |
-
/* OUTER tab bar — PHYLO categories */
|
| 332 |
-
.outer-tabs .tab-nav button {{
|
| 333 |
-
color: {TXT} !important;
|
| 334 |
-
background: {CARD} !important;
|
| 335 |
-
font-size: 13px !important;
|
| 336 |
-
font-weight: 600 !important;
|
| 337 |
-
padding: 8px 16px !important;
|
| 338 |
-
border-radius: 6px 6px 0 0 !important;
|
| 339 |
-
}}
|
| 340 |
-
.outer-tabs .tab-nav button.selected {{
|
| 341 |
-
border-bottom: 3px solid {ACC} !important;
|
| 342 |
-
color: {ACC} !important;
|
| 343 |
-
background: {BG} !important;
|
| 344 |
-
}}
|
| 345 |
-
|
| 346 |
-
/* INNER sub-tab bar — individual tools */
|
| 347 |
-
.inner-tabs .tab-nav button {{
|
| 348 |
-
color: {DIM} !important;
|
| 349 |
-
background: {BG} !important;
|
| 350 |
-
font-size: 12px !important;
|
| 351 |
-
font-weight: 500 !important;
|
| 352 |
-
padding: 5px 12px !important;
|
| 353 |
-
border-radius: 4px 4px 0 0 !important;
|
| 354 |
-
border: 1px solid {BORDER} !important;
|
| 355 |
-
border-bottom: none !important;
|
| 356 |
-
margin-right: 3px !important;
|
| 357 |
-
}}
|
| 358 |
-
.inner-tabs .tab-nav button.selected {{
|
| 359 |
-
color: {ACC2} !important;
|
| 360 |
-
background: {CARD} !important;
|
| 361 |
-
border-color: {ACC2} !important;
|
| 362 |
-
border-bottom: none !important;
|
| 363 |
-
}}
|
| 364 |
-
.inner-tabs > .tabitem {{
|
| 365 |
-
background: {CARD} !important;
|
| 366 |
-
border: 1px solid {BORDER} !important;
|
| 367 |
-
border-radius: 0 6px 6px 6px !important;
|
| 368 |
-
padding: 14px !important;
|
| 369 |
-
}}
|
| 370 |
-
|
| 371 |
-
h1, h2, h3 {{ color: {ACC} !important; }}
|
| 372 |
-
.gr-button-primary {{ background: {ACC} !important; border: none !important; }}
|
| 373 |
-
footer {{ display: none !important; }}
|
| 374 |
-
"""
|
| 375 |
-
|
| 376 |
-
# ── LAB MAP HTML ──────────────────────────────────────────────────────────────
|
| 377 |
-
MAP_HTML = f"""
|
| 378 |
-
<div style="background:{CARD};padding:22px;border-radius:8px;font-family:monospace;
|
| 379 |
-
font-size:13px;line-height:2.0;color:{TXT}">
|
| 380 |
-
|
| 381 |
-
<span style="color:{ACC};font-size:16px;font-weight:bold">K R&D Lab · S1 Biomedical</span>
|
| 382 |
-
<span style="color:{DIM};font-size:11px;margin-left:12px">Science Sphere — sub-direction 1</span>
|
| 383 |
-
<br><br>
|
| 384 |
-
|
| 385 |
-
<span style="color:{ACC2};font-weight:600">S1-A · PHYLO-GENOMICS</span>
|
| 386 |
-
<span style="color:{DIM}"> — What breaks in DNA</span><br>
|
| 387 |
-
├─ <b>S1-R1</b> OpenVariant
|
| 388 |
-
<span style="color:{GRN}"> AUC=0.939 ✅</span><br>
|
| 389 |
-
├─ <b>S1-R1b</b> Somatic classifier
|
| 390 |
-
<span style="color:#f59e0b"> 🔶 In progress</span><br>
|
| 391 |
-
└─ <b>S1-R12a</b> Rare variants (DIPG · UVM)
|
| 392 |
-
<span style="color:{DIM}"> 🔴 Planned</span><br><br>
|
| 393 |
-
|
| 394 |
-
<span style="color:{ACC2};font-weight:600">S1-B · PHYLO-RNA</span>
|
| 395 |
-
<span style="color:{DIM}"> — How to silence it via RNA</span><br>
|
| 396 |
-
├─ <b>S1-R2</b> miRNA silencing (BRCA1/2, TP53)
|
| 397 |
-
<span style="color:{GRN}"> ✅</span><br>
|
| 398 |
-
├─ <b>S1-R3</b> siRNA synthetic lethal (LUAD · BRCA · COAD)
|
| 399 |
-
<span style="color:{GRN}"> ✅</span><br>
|
| 400 |
-
├─ <b>S1-R4</b> lncRNA-TREM2 ceRNA network
|
| 401 |
-
<span style="color:{GRN}"> ✅</span><br>
|
| 402 |
-
└─ <b>S1-R4b</b> ASO designer
|
| 403 |
-
<span style="color:{GRN}"> ✅</span><br><br>
|
| 404 |
-
|
| 405 |
-
<span style="color:{ACC2};font-weight:600">S1-C · PHYLO-DRUG</span>
|
| 406 |
-
<span style="color:{DIM}"> — Which molecule treats it</span><br>
|
| 407 |
-
├─ <b>S1-R5</b> FGFR3 RNA-directed compounds
|
| 408 |
-
<span style="color:{GRN}"> ✅</span><br>
|
| 409 |
-
├─ <b>S1-R5b</b> Synthetic lethal drug mapping
|
| 410 |
-
<span style="color:#f59e0b"> 🔶</span><br>
|
| 411 |
-
└─ <b>S1-R13</b> m6A × Ferroptosis × Circadian ⭐
|
| 412 |
-
<span style="color:{DIM}"> 🔴 Frontier</span><br><br>
|
| 413 |
-
|
| 414 |
-
<span style="color:{ACC2};font-weight:600">S1-D · PHYLO-LNP</span>
|
| 415 |
-
<span style="color:{DIM}"> — How to deliver the drug</span><br>
|
| 416 |
-
├─ <b>S1-R6</b> LNP corona (serum)
|
| 417 |
-
<span style="color:{GRN}"> AUC=0.791 ✅</span><br>
|
| 418 |
-
├─ <b>S1-R7</b> Flow corona — Vroman effect
|
| 419 |
-
<span style="color:{GRN}"> ✅</span><br>
|
| 420 |
-
├─ <b>S1-R8</b> LNP brain / BBB / ApoE
|
| 421 |
-
<span style="color:{GRN}"> ✅</span><br>
|
| 422 |
-
├─ <b>S1-R10</b> AutoCorona NLP
|
| 423 |
-
<span style="color:{GRN}"> F1=0.71 ✅</span><br>
|
| 424 |
-
└─ <b>S1-R11</b> CSF · Vitreous · Bone Marrow ⭐
|
| 425 |
-
<span style="color:{DIM}"> 🔴 0 prior studies</span><br><br>
|
| 426 |
-
|
| 427 |
-
<span style="color:{ACC2};font-weight:600">S1-E · PHYLO-BIOMARKERS</span>
|
| 428 |
-
<span style="color:{DIM}"> — Detect without biopsy</span><br>
|
| 429 |
-
├─ <b>S1-R9</b> Liquid Biopsy classifier
|
| 430 |
-
<span style="color:{GRN}"> AUC=0.992* ✅</span><br>
|
| 431 |
-
├─ <b>S1-R9b</b> Protein panel validator
|
| 432 |
-
<span style="color:#f59e0b"> 🔶</span><br>
|
| 433 |
-
└─ <b>S1-R9c</b> ctDNA gap analysis
|
| 434 |
-
<span style="color:{DIM}"> 🔴</span><br><br>
|
| 435 |
-
|
| 436 |
-
<span style="color:{ACC2};font-weight:600">S1-F · PHYLO-RARE</span>
|
| 437 |
-
<span style="color:{DIM}"> — Where nobody looked yet</span><br>
|
| 438 |
-
├─ <b>S1-R12b</b> DIPG toolkit (H3K27M)
|
| 439 |
-
<span style="color:{DIM}"> 🔴</span><br>
|
| 440 |
-
├─ <b>S1-R12c</b> UVM toolkit (GNAQ/GNA11)
|
| 441 |
-
<span style="color:{DIM}"> 🔴</span><br>
|
| 442 |
-
└─ <b>S1-R12d</b> pAML toolkit (FLT3-ITD)
|
| 443 |
-
<span style="color:{DIM}"> 🔴</span><br><br>
|
| 444 |
-
|
| 445 |
-
<span style="color:{DIM};font-size:11px">
|
| 446 |
-
✅ Active in this demo · 🔶 In progress · 🔴 Planned / Frontier<br>
|
| 447 |
-
⭐ gap research (0–1 prior studies globally) · * tissue proxy, plasma validation pending
|
| 448 |
-
</span>
|
| 449 |
-
</div>
|
| 450 |
-
"""
|
| 451 |
-
|
| 452 |
-
# ── UI ────────────────────────────────────────────────────────────────────────
|
| 453 |
-
with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
| 454 |
-
|
| 455 |
-
gr.Markdown(
|
| 456 |
-
"# 🔬 K R&D Lab · Science Sphere — S1 Biomedical\n"
|
| 457 |
-
"**Oksana Kolisnyk** · [KOSATIKS GROUP](https://kosatiks-group.pp.ua) | "
|
| 458 |
-
"[GitHub](https://github.com/K-RnD-Lab) "
|
| 459 |
-
"[HuggingFace](https://huggingface.co/K-RnD-Lab) | "
|
| 460 |
-
"*Research only. Not clinical advice.*"
|
| 461 |
-
)
|
| 462 |
-
|
| 463 |
-
# ═══════════════════════════════════════════════════════
|
| 464 |
-
# OUTER TABS — one per PHYLO-* category
|
| 465 |
-
# ═══════════════════════════════════════════════════════
|
| 466 |
-
with gr.Tabs(elem_classes="outer-tabs"):
|
| 467 |
-
|
| 468 |
-
# ── 🗺️ MAP ─────────────────────────────────────────
|
| 469 |
-
with gr.Tab("🗺️ Lab Map"):
|
| 470 |
-
gr.HTML(MAP_HTML)
|
| 471 |
-
|
| 472 |
-
# ── 🧬 S1-A · PHYLO-GENOMICS ───────────────────────
|
| 473 |
-
with gr.Tab("🧬 S1-A PHYLO-GENOMICS"):
|
| 474 |
-
gr.HTML(section_header(
|
| 475 |
-
"S1-A", "PHYLO-GENOMICS", "— What breaks in DNA",
|
| 476 |
-
"S1-R1 OpenVariant ✅ · S1-R1b Somatic classifier 🔶 · S1-R12a Rare variants 🔴"
|
| 477 |
-
))
|
| 478 |
-
with gr.Tabs(elem_classes="inner-tabs"):
|
| 479 |
-
|
| 480 |
-
with gr.Tab("S1-R1 · OpenVariant"):
|
| 481 |
-
gr.HTML(proj_badge("S1-A · PHYLO-GENOMICS · S1-R1",
|
| 482 |
-
"OpenVariant — SNV Pathogenicity Classifier", "AUC = 0.939"))
|
| 483 |
-
hgvs = gr.Textbox(label="HGVS notation", placeholder="BRCA1:p.R1699Q")
|
| 484 |
-
gr.Markdown("**Or enter functional scores manually:**")
|
| 485 |
-
with gr.Row():
|
| 486 |
-
sift = gr.Slider(0,1,value=0.5,step=0.01,label="SIFT (0=damaging)")
|
| 487 |
-
pp = gr.Slider(0,1,value=0.5,step=0.01,label="PolyPhen-2")
|
| 488 |
-
gn = gr.Slider(0,0.01,value=0.001,step=0.0001,label="gnomAD AF")
|
| 489 |
-
b_v = gr.Button("Predict Pathogenicity", variant="primary")
|
| 490 |
-
o_v = gr.HTML()
|
| 491 |
-
gr.Examples([["BRCA1:p.R1699Q",0.82,0.05,0.0012],
|
| 492 |
-
["TP53:p.R248W",0.00,1.00,0.0],
|
| 493 |
-
["BRCA2:p.D2723A",0.01,0.98,0.0]], inputs=[hgvs,sift,pp,gn])
|
| 494 |
-
b_v.click(predict_variant, [hgvs,sift,pp,gn], o_v)
|
| 495 |
-
|
| 496 |
-
with gr.Tab("S1-R1b · Somatic 🔶"):
|
| 497 |
-
gr.HTML(proj_badge("S1-A · PHYLO-GENOMICS · S1-R1b",
|
| 498 |
-
"Somatic Mutation Classifier — BRCA · LUAD panels", "🔶 In progress"))
|
| 499 |
-
gr.Markdown("> This module is in active development. Coming in the next release.")
|
| 500 |
-
|
| 501 |
-
# ── 🔬 S1-B · PHYLO-RNA ────────────────────────────
|
| 502 |
-
with gr.Tab("🔬 S1-B PHYLO-RNA"):
|
| 503 |
-
gr.HTML(section_header(
|
| 504 |
-
"S1-B", "PHYLO-RNA", "— How to silence it via RNA",
|
| 505 |
-
"S1-R2 miRNA ✅ · S1-R3 siRNA ✅ · S1-R4 lncRNA ✅ · S1-R4b ASO ✅"
|
| 506 |
-
))
|
| 507 |
-
with gr.Tabs(elem_classes="inner-tabs"):
|
| 508 |
-
|
| 509 |
-
with gr.Tab("S1-R2 · miRNA"):
|
| 510 |
-
gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R2",
|
| 511 |
-
"miRNA Silencing — BRCA1/2 · TP53 tumor suppressors"))
|
| 512 |
-
g1 = gr.Dropdown(["BRCA2","BRCA1","TP53"], value="BRCA2", label="Gene")
|
| 513 |
-
b1 = gr.Button("Find miRNAs", variant="primary")
|
| 514 |
-
o1 = gr.Dataframe(label="Top 5 downregulated miRNAs")
|
| 515 |
-
gr.Examples([["BRCA2"],["BRCA1"],["TP53"]], inputs=[g1])
|
| 516 |
-
b1.click(predict_mirna, g1, o1)
|
| 517 |
-
|
| 518 |
-
with gr.Tab("S1-R3 · siRNA"):
|
| 519 |
-
gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R3",
|
| 520 |
-
"siRNA Synthetic Lethal — TP53-null · LUAD · BRCA · COAD"))
|
| 521 |
-
g2 = gr.Dropdown(["LUAD","BRCA","COAD"], value="LUAD", label="Cancer type")
|
| 522 |
-
b2 = gr.Button("Find Targets", variant="primary")
|
| 523 |
-
o2 = gr.Dataframe(label="Top 5 synthetic lethal targets")
|
| 524 |
-
gr.Examples([["LUAD"],["BRCA"],["COAD"]], inputs=[g2])
|
| 525 |
-
b2.click(predict_sirna, g2, o2)
|
| 526 |
-
|
| 527 |
-
with gr.Tab("S1-R4 · lncRNA + ASO"):
|
| 528 |
-
gr.HTML(proj_badge("S1-B · PHYLO-RNA · S1-R4 + S1-R4b",
|
| 529 |
-
"lncRNA-TREM2 ceRNA Network + ASO Candidates · Alzheimer neuroinflammation"))
|
| 530 |
-
b3 = gr.Button("Load Results", variant="primary")
|
| 531 |
-
o3a = gr.Dataframe(label="ceRNA Network (S1-R4)")
|
| 532 |
-
o3b = gr.Dataframe(label="ASO Candidates (S1-R4b)")
|
| 533 |
-
b3.click(get_lncrna, [], [o3a, o3b])
|
| 534 |
-
|
| 535 |
-
# ── 💊 S1-C · PHYLO-DRUG ───────────────────────────
|
| 536 |
-
with gr.Tab("💊 S1-C PHYLO-DRUG"):
|
| 537 |
-
gr.HTML(section_header(
|
| 538 |
-
"S1-C", "PHYLO-DRUG", "— Which molecule treats it",
|
| 539 |
-
"S1-R5 FGFR3 ✅ · S1-R5b SL drug mapping 🔶 · S1-R13 m6A×Ferroptosis×Circadian 🔴⭐"
|
| 540 |
-
))
|
| 541 |
-
with gr.Tabs(elem_classes="inner-tabs"):
|
| 542 |
-
|
| 543 |
-
with gr.Tab("S1-R5 · FGFR3"):
|
| 544 |
-
gr.HTML(proj_badge("S1-C · PHYLO-DRUG · S1-R5",
|
| 545 |
-
"FGFR3 RNA-Directed Drug Discovery · ChEMBL screen",
|
| 546 |
-
"top score 0.793"))
|
| 547 |
-
g4 = gr.Radio(["P1 (hairpin loop)","P10 (G-quadruplex)"],
|
| 548 |
-
value="P1 (hairpin loop)", label="Target pocket")
|
| 549 |
-
b4 = gr.Button("Screen Compounds", variant="primary")
|
| 550 |
-
o4t = gr.Dataframe(label="Top 5 candidates")
|
| 551 |
-
o4p = gr.Image(label="Binding scores")
|
| 552 |
-
gr.Examples([["P1 (hairpin loop)"],["P10 (G-quadruplex)"]], inputs=[g4])
|
| 553 |
-
b4.click(predict_drug, g4, [o4t, o4p])
|
| 554 |
-
|
| 555 |
-
with gr.Tab("S1-R13 · Frontier 🔴⭐"):
|
| 556 |
-
gr.HTML(proj_badge("S1-C · PHYLO-DRUG · S1-R13",
|
| 557 |
-
"m6A × Ferroptosis × Circadian — Pan-cancer triad", "🔴 Frontier"))
|
| 558 |
-
gr.Markdown(
|
| 559 |
-
"> **Research gap:** This triple intersection has never been studied as an integrated system.\n\n"
|
| 560 |
-
"> **Planned datasets:** TCGA-PAAD · GEO m6A atlases · Circadian gene panels\n\n"
|
| 561 |
-
"> **Expected timeline:** Q3 2026"
|
| 562 |
-
)
|
| 563 |
-
|
| 564 |
-
# ── 🧪 S1-D · PHYLO-LNP ────────────────────────────
|
| 565 |
-
with gr.Tab("🧪 S1-D PHYLO-LNP"):
|
| 566 |
-
gr.HTML(section_header(
|
| 567 |
-
"S1-D", "PHYLO-LNP", "— How to deliver the drug to the cell",
|
| 568 |
-
"S1-R6 Corona ✅ · S1-R7 Flow ✅ · S1-R8 Brain ✅ · S1-R10 NLP ✅ · S1-R11 CSF/BM 🔴⭐"
|
| 569 |
-
))
|
| 570 |
-
with gr.Tabs(elem_classes="inner-tabs"):
|
| 571 |
-
|
| 572 |
-
with gr.Tab("S1-R6 · Corona"):
|
| 573 |
-
gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R6",
|
| 574 |
-
"LNP Protein Corona (Serum)", "AUC = 0.791"))
|
| 575 |
-
with gr.Row():
|
| 576 |
-
sz = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
| 577 |
-
zt = gr.Slider(-40,10,value=-5,step=1,label="Zeta (mV)")
|
| 578 |
-
with gr.Row():
|
| 579 |
-
pg = gr.Slider(0,5,value=1.5,step=0.1,label="PEG mol%")
|
| 580 |
-
lp = gr.Dropdown(["Ionizable","Cationic","Anionic","Neutral"],value="Ionizable",label="Lipid type")
|
| 581 |
-
b6 = gr.Button("Predict", variant="primary"); o6 = gr.Markdown()
|
| 582 |
-
gr.Examples([[100,-5,1.5,"Ionizable"],[80,5,0.5,"Cationic"]], inputs=[sz,zt,pg,lp])
|
| 583 |
-
b6.click(predict_corona, [sz,zt,pg,lp], o6)
|
| 584 |
-
|
| 585 |
-
with gr.Tab("S1-R7 · Flow"):
|
| 586 |
-
gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R7",
|
| 587 |
-
"Flow Corona — Vroman Effect · albumin→ApoE kinetics"))
|
| 588 |
-
with gr.Row():
|
| 589 |
-
s8 = gr.Slider(50,300,value=100,step=1,label="Size (nm)")
|
| 590 |
-
z8 = gr.Slider(-40,10,value=-5,step=1,label="Zeta (mV)")
|
| 591 |
-
pg8 = gr.Slider(0,5,value=1.5,step=0.1,label="PEG mol%")
|
| 592 |
-
with gr.Row():
|
| 593 |
-
ch8 = gr.Dropdown(["Ionizable","Cationic","Anionic","Neutral"],value="Ionizable",label="Charge")
|
| 594 |
-
fl8 = gr.Slider(0,40,value=20,step=1,label="Flow cm/s (aorta=40)")
|
| 595 |
-
b8 = gr.Button("Model Vroman Effect", variant="primary")
|
| 596 |
-
o8t = gr.Markdown(); o8p = gr.Image(label="Kinetics")
|
| 597 |
-
gr.Examples([[100,-5,1.5,"Ionizable",40],[150,5,0.5,"Cationic",10]], inputs=[s8,z8,pg8,ch8,fl8])
|
| 598 |
-
b8.click(predict_flow, [s8,z8,pg8,ch8,fl8], [o8t,o8p])
|
| 599 |
-
|
| 600 |
-
with gr.Tab("S1-R8 · Brain"):
|
| 601 |
-
gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R8",
|
| 602 |
-
"LNP Brain Delivery — ApoE% + BBB probability"))
|
| 603 |
-
smi = gr.Textbox(label="Ionizable lipid SMILES",
|
| 604 |
-
value="CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C")
|
| 605 |
-
with gr.Row():
|
| 606 |
-
pk = gr.Slider(4,8,value=6.5,step=0.1,label="pKa")
|
| 607 |
-
zt9 = gr.Slider(-20,10,value=-3,step=1,label="Zeta (mV)")
|
| 608 |
-
b9 = gr.Button("Predict BBB Crossing", variant="primary")
|
| 609 |
-
o9t = gr.Markdown(); o9p = gr.Image(label="Radar profile")
|
| 610 |
-
gr.Examples([["CC(C)CC(=O)OCC(COC(=O)CC(C)C)OC(=O)CC(C)C",6.5,-3]], inputs=[smi,pk,zt9])
|
| 611 |
-
b9.click(predict_bbb, [smi,pk,zt9], [o9t,o9p])
|
| 612 |
-
|
| 613 |
-
with gr.Tab("S1-R10 · NLP"):
|
| 614 |
-
gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R10",
|
| 615 |
-
"AutoCorona NLP — structured data from PMC abstracts", "F1 = 0.71"))
|
| 616 |
-
txt = gr.Textbox(lines=5,label="Paper abstract",placeholder="Paste abstract here...")
|
| 617 |
-
b10 = gr.Button("Extract Data", variant="primary")
|
| 618 |
-
o10j = gr.Code(label="Extracted JSON", language="json")
|
| 619 |
-
o10f = gr.Textbox(label="Validation flags")
|
| 620 |
-
gr.Examples([[
|
| 621 |
-
"LNPs composed of MC3, DSPC, Cholesterol (50:10:40 mol%) with 1.5% PEG-DMG. "
|
| 622 |
-
"Hydrodynamic diameter was 98 nm, zeta potential -3.2 mV, PDI 0.12. "
|
| 623 |
-
"Incubated in human plasma. Corona: albumin, apolipoprotein E, fibrinogen."
|
| 624 |
-
]], inputs=[txt])
|
| 625 |
-
b10.click(extract_corona, txt, [o10j, o10f])
|
| 626 |
-
|
| 627 |
-
with gr.Tab("S1-R11 · CSF/BM 🔴⭐"):
|
| 628 |
-
gr.HTML(proj_badge("S1-D · PHYLO-LNP · S1-R11",
|
| 629 |
-
"LNP Corona in CSF · Vitreous · Bone Marrow", "🔴 0 prior studies"))
|
| 630 |
-
gr.Markdown(
|
| 631 |
-
"> **Research gap:** Protein corona has only been characterized in serum/plasma. "
|
| 632 |
-
"CSF, vitreous humor, and bone marrow interstitial fluid remain completely unstudied.\n\n"
|
| 633 |
-
"> **Target cancers:** DIPG (CSF) · UVM (vitreous) · pAML (bone marrow)\n\n"
|
| 634 |
-
"> **Expected timeline:** Q2–Q3 2026"
|
| 635 |
-
)
|
| 636 |
-
|
| 637 |
-
# ── 🩸 S1-E · PHYLO-BIOMARKERS ─────────────────────
|
| 638 |
-
with gr.Tab("🩸 S1-E PHYLO-BIOMARKERS"):
|
| 639 |
-
gr.HTML(section_header(
|
| 640 |
-
"S1-E", "PHYLO-BIOMARKERS", "— Detect cancer without tissue biopsy",
|
| 641 |
-
"S1-R9 Liquid Biopsy ✅ · S1-R9b Panel validator 🔶 · S1-R9c ctDNA gap 🔴"
|
| 642 |
-
))
|
| 643 |
-
with gr.Tabs(elem_classes="inner-tabs"):
|
| 644 |
-
|
| 645 |
-
with gr.Tab("S1-R9 · Liquid Biopsy"):
|
| 646 |
-
gr.HTML(proj_badge("S1-E · PHYLO-BIOMARKERS · S1-R9",
|
| 647 |
-
"Liquid Biopsy Classifier — CTHRC1 · FHL2 · LDHA panel",
|
| 648 |
-
"AUC = 0.992*"))
|
| 649 |
-
with gr.Row():
|
| 650 |
-
p1=gr.Slider(-3,3,value=0,step=0.1,label="CTHRC1")
|
| 651 |
-
p2=gr.Slider(-3,3,value=0,step=0.1,label="FHL2")
|
| 652 |
-
p3=gr.Slider(-3,3,value=0,step=0.1,label="LDHA")
|
| 653 |
-
p4=gr.Slider(-3,3,value=0,step=0.1,label="P4HA1")
|
| 654 |
-
p5=gr.Slider(-3,3,value=0,step=0.1,label="SERPINH1")
|
| 655 |
-
with gr.Row():
|
| 656 |
-
p6=gr.Slider(-3,3,value=0,step=0.1,label="ABCA8")
|
| 657 |
-
p7=gr.Slider(-3,3,value=0,step=0.1,label="CA4")
|
| 658 |
-
p8=gr.Slider(-3,3,value=0,step=0.1,label="CKB")
|
| 659 |
-
p9=gr.Slider(-3,3,value=0,step=0.1,label="NNMT")
|
| 660 |
-
p10=gr.Slider(-3,3,value=0,step=0.1,label="CACNA2D2")
|
| 661 |
-
b7=gr.Button("Classify", variant="primary")
|
| 662 |
-
o7t=gr.HTML(); o7p=gr.Image(label="Feature contributions")
|
| 663 |
-
gr.Examples([[2,2,1.5,1.8,1.6,-1,-1.2,-0.8,1.4,-1.1],[0]*10],
|
| 664 |
-
inputs=[p1,p2,p3,p4,p5,p6,p7,p8,p9,p10])
|
| 665 |
-
b7.click(predict_cancer, [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10], [o7t,o7p])
|
| 666 |
-
|
| 667 |
-
with gr.Tab("S1-R9b · Validator 🔶"):
|
| 668 |
-
gr.HTML(proj_badge("S1-E · PHYLO-BIOMARKERS · S1-R9b",
|
| 669 |
-
"Protein Panel Validator — multi-cancer plasma validation", "🔶 In progress"))
|
| 670 |
-
gr.Markdown("> Coming next — validates S1-R9 results against GEO plasma proteomics datasets.")
|
| 671 |
-
|
| 672 |
-
# ── 📓 JOURNAL ──────────────────────────────────────
|
| 673 |
-
with gr.Tab("📓 Journal"):
|
| 674 |
-
gr.Markdown("### Lab Journal\nEvery tool call auto-logged with project code.")
|
| 675 |
-
with gr.Row():
|
| 676 |
-
note_text = gr.Textbox(label="📝 Observation", placeholder="What did you discover?", lines=3)
|
| 677 |
-
note_tab = gr.Textbox(label="Project code (e.g. S1-R1)", value="General")
|
| 678 |
-
note_last = gr.Textbox(visible=False)
|
| 679 |
-
save_btn = gr.Button("💾 Save", variant="primary")
|
| 680 |
-
save_msg = gr.Markdown()
|
| 681 |
-
journal_df = gr.Dataframe(label="📋 Full History", value=load_journal(), interactive=False)
|
| 682 |
-
refresh_btn = gr.Button("🔄 Refresh")
|
| 683 |
-
refresh_btn.click(load_journal, [], journal_df)
|
| 684 |
-
save_btn.click(save_note, [note_text,note_tab,note_last], [save_msg,journal_df])
|
| 685 |
-
|
| 686 |
-
# ── 📚 LEARNING ─────────────────────────────────────
|
| 687 |
-
with gr.Tab("📚 Learning"):
|
| 688 |
-
gr.Markdown("""
|
| 689 |
-
## 🧪 Guided Investigations — S1 Biomedical
|
| 690 |
-
> 🟢 Beginner → 🟡 Intermediate → 🔴 Advanced
|
| 691 |
-
|
| 692 |
-
---
|
| 693 |
-
### 🟢 Case 1 · S1-A · S1-R1
|
| 694 |
-
**Why does the same position give two different outcomes?**
|
| 695 |
-
1. PHYLO-GENOMICS → OpenVariant → `BRCA1:p.R1699Q` → Benign
|
| 696 |
-
2. Enter `BRCA1:p.R1699W` → Pathogenic
|
| 697 |
-
3. Same position, different amino acid — Q (polar) vs W (bulky-aromatic)
|
| 698 |
-
|
| 699 |
-
---
|
| 700 |
-
### 🟢 Case 2 · S1-D · S1-R6 + S1-R8
|
| 701 |
-
**How does PEG% control which protein coats the nanoparticle?**
|
| 702 |
-
1. PHYLO-LNP → Corona → Ionizable, Zeta=−5, PEG=**0.5%** → note protein
|
| 703 |
-
2. Change PEG=**2.5%** → compare
|
| 704 |
-
3. Brain tab → pKa=6.5 → check ApoE%
|
| 705 |
-
|
| 706 |
-
---
|
| 707 |
-
### 🟡 Case 3 · S1-D · S1-R7
|
| 708 |
-
**Does blood flow reshape the corona over time?**
|
| 709 |
-
1. PHYLO-LNP → Flow → Flow=0 → observe ApoE curve
|
| 710 |
-
2. Flow=40 (arterial) → compare
|
| 711 |
-
3. At what minute does ApoE dominate?
|
| 712 |
-
|
| 713 |
-
---
|
| 714 |
-
### 🟡 Case 4 · S1-B · S1-R3
|
| 715 |
-
**Which cancer has the most novel (undrugged) siRNA targets?**
|
| 716 |
-
1. PHYLO-RNA → siRNA → LUAD → count "Novel"
|
| 717 |
-
2. Repeat BRCA, COAD
|
| 718 |
-
|
| 719 |
-
---
|
| 720 |
-
### 🔴 Case 5 · S1-E · S1-R9
|
| 721 |
-
**Minimum protein signal that flips to CANCER?**
|
| 722 |
-
1. PHYLO-BIOMARKERS → Liquid Biopsy → all=0 → HEALTHY
|
| 723 |
-
2. Set CTHRC1=2.5, FHL2=2.0, LDHA=1.8 → observe
|
| 724 |
-
3. Reset. Increase only CTHRC1 step by step.
|
| 725 |
-
|
| 726 |
-
---
|
| 727 |
-
### 🔴 Case 6 · S1-B + S1-C — Cross-tool convergence
|
| 728 |
-
1. PHYLO-RNA → miRNA → TP53 → find top targets (BCL2, CDK6)
|
| 729 |
-
2. PHYLO-DRUG → FGFR3 → check CDK6 pathway overlap
|
| 730 |
-
3. PHYLO-RNA → siRNA → BRCA → does CDK6 appear?
|
| 731 |
-
|
| 732 |
-
---
|
| 733 |
-
### 📖 Tool Index
|
| 734 |
-
| Code | Module | Tool | Metric |
|
| 735 |
-
|------|--------|------|--------|
|
| 736 |
-
| S1-R1 | PHYLO-GENOMICS | OpenVariant | AUC=0.939 |
|
| 737 |
-
| S1-R2 | PHYLO-RNA | miRNA silencing | top: hsa-miR-148a |
|
| 738 |
-
| S1-R3 | PHYLO-RNA | siRNA SL | SPC24 top LUAD |
|
| 739 |
-
| S1-R4 | PHYLO-RNA | lncRNA-TREM2 | CYTOR→AKT1 |
|
| 740 |
-
| S1-R5 | PHYLO-DRUG | FGFR3 drug | score=0.793 |
|
| 741 |
-
| S1-R6 | PHYLO-LNP | Corona | AUC=0.791 |
|
| 742 |
-
| S1-R7 | PHYLO-LNP | Flow Vroman | 3–4× faster |
|
| 743 |
-
| S1-R8 | PHYLO-LNP | LNP Brain | pKa 6.2–6.8 |
|
| 744 |
-
| S1-R9 | PHYLO-BIOMARKERS | Liquid Biopsy | AUC=0.992* |
|
| 745 |
-
| S1-R10 | PHYLO-LNP | AutoCorona NLP | F1=0.71 |
|
| 746 |
-
""")
|
| 747 |
-
|
| 748 |
-
gr.Markdown(
|
| 749 |
-
"---\n**K R&D Lab** · Science Sphere · S1 Biomedical · "
|
| 750 |
-
"[GitHub](https://github.com/K-RnD-Lab) · "
|
| 751 |
-
"[HuggingFace](https://huggingface.co/K-RnD-Lab) · "
|
| 752 |
-
"[KOSATIKS GROUP 🦈](https://kosatiks-group.pp.ua) · MIT License"
|
| 753 |
-
)
|
| 754 |
-
|
| 755 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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