mgbam commited on
Commit
7716bcb
Β·
verified Β·
1 Parent(s): 4669711

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +64 -91
app.py CHANGED
@@ -1,91 +1,64 @@
1
- import gradio as gr
2
- from genesis.pipeline import research_once
3
- from genesis.visualization import generate_pathway_graph, generate_funding_network
4
-
5
- # Preloaded killer demo queries
6
- DEMO_QUERIES = [
7
- "CRISPR living therapeutics in clinical trials since 2020",
8
- "AI-designed enzymes for plastic degradation β€” literature + pathways",
9
- "Synthetic biology startups in oncology β€” funding map",
10
- "Metabolic pathway for artemisinin biosynthesis in yeast",
11
- "Oncolytic virus engineering β€” biosecurity risk analysis"
12
- ]
13
-
14
- def run_literature_review(query):
15
- report = research_once(query)
16
- return (
17
- report["summary"],
18
- report["citations"],
19
- report["structures"],
20
- report["visual_image_url"],
21
- report["audio_url"]
22
- )
23
-
24
- def run_pathway_graph():
25
- entities = ["CRISPR", "Cas9", "DNA Repair", "Therapeutic Delivery"]
26
- relationships = [
27
- {"source": "CRISPR", "target": "Cas9", "type": "guides"},
28
- {"source": "Cas9", "target": "DNA Repair", "type": "triggers"},
29
- {"source": "DNA Repair", "target": "Therapeutic Delivery", "type": "enables"}
30
- ]
31
- return generate_pathway_graph(entities, relationships)
32
-
33
- def run_funding_network():
34
- companies = [
35
- {"name": "SynBioCorp", "investors": "Sequoia Capital, Andreessen Horowitz"},
36
- {"name": "BioTheraX", "investors": "SoftBank, ARCH Venture Partners"}
37
- ]
38
- return generate_funding_network(companies)
39
-
40
- with gr.Blocks(theme=gr.themes.Soft(primary_hue="emerald", secondary_hue="lime")) as app:
41
- gr.Markdown("# 🧬 GENESIS-AI β€” Synthetic Biology Command Center")
42
- gr.Markdown("A next-generation **lab instrument** for literature review, pathway mapping, funding analysis, and biosecurity insights.")
43
-
44
- with gr.Row():
45
- query_input = gr.Textbox(label="Enter your research query", placeholder="e.g., CRISPR living therapeutics in clinical trials since 2020", lines=2)
46
- run_button = gr.Button("πŸš€ Run Literature Review", variant="primary")
47
-
48
- gr.Markdown("### πŸ”Ή Or click a demo query:")
49
- with gr.Row():
50
- demo_btns = []
51
- for dq in DEMO_QUERIES:
52
- btn = gr.Button(dq)
53
- btn.click(fn=lambda q=dq: run_literature_review(q),
54
- inputs=[],
55
- outputs=["summary_box", "citations_box", "structures_box", "image_out", "audio_out"])
56
- demo_btns.append(btn)
57
-
58
- with gr.Tab("πŸ“„ Summary"):
59
- summary_box = gr.Textbox(label="AI-Generated Summary", lines=15, interactive=False)
60
-
61
- with gr.Tab("πŸ“š Citations"):
62
- citations_box = gr.JSON(label="Citations")
63
-
64
- with gr.Tab("πŸ§ͺ Structures"):
65
- structures_box = gr.JSON(label="3D Molecular Structures")
66
-
67
- with gr.Tab("πŸ–Ό Diagram"):
68
- image_out = gr.Image(label="Generated Diagram")
69
-
70
- with gr.Tab("πŸ”Š Narration"):
71
- audio_out = gr.Audio(label="Narrated Summary", type="filepath")
72
-
73
- gr.Markdown("## 🧭 Additional Tools")
74
-
75
- with gr.Row():
76
- pathway_btn = gr.Button("🧬 Generate Pathway Graph")
77
- pathway_img = gr.Image(label="Pathway Graph")
78
- pathway_btn.click(fn=run_pathway_graph, inputs=[], outputs=pathway_img)
79
-
80
- funding_btn = gr.Button("πŸ’° Generate Funding Network")
81
- funding_img = gr.Image(label="Funding Network")
82
- funding_btn.click(fn=run_funding_network, inputs=[], outputs=funding_img)
83
-
84
- # Link main run button
85
- run_button.click(
86
- fn=run_literature_review,
87
- inputs=query_input,
88
- outputs=[summary_box, citations_box, structures_box, image_out, audio_out]
89
- )
90
-
91
- app.launch()
 
1
+ :root {
2
+ --green: #00ff9d;
3
+ --orange: #ff9900;
4
+ --bg-dark: #0a0a0a;
5
+ }
6
+
7
+ body, html {
8
+ margin: 0;
9
+ padding: 0;
10
+ overflow: hidden;
11
+ background-color: var(--bg-dark);
12
+ font-family: 'Orbitron', sans-serif;
13
+ }
14
+
15
+ .fullscreen-bg {
16
+ position: relative;
17
+ width: 100vw;
18
+ height: 100vh;
19
+ background: radial-gradient(circle at center, #001a12, #000000);
20
+ }
21
+
22
+ #molecule-canvas {
23
+ position: absolute;
24
+ top: 0; left: 0;
25
+ width: 100%; height: 100%;
26
+ z-index: 0;
27
+ }
28
+
29
+ .centered {
30
+ position: absolute;
31
+ top: 50%; left: 50%;
32
+ transform: translate(-50%, -50%);
33
+ text-align: center;
34
+ z-index: 1;
35
+ }
36
+
37
+ .title {
38
+ font-size: 3em;
39
+ color: var(--green);
40
+ text-shadow: 0 0 20px var(--green);
41
+ }
42
+
43
+ #enter-btn {
44
+ padding: 15px 40px;
45
+ font-size: 1.5em;
46
+ background: var(--green);
47
+ color: black;
48
+ border: none;
49
+ cursor: pointer;
50
+ border-radius: 8px;
51
+ box-shadow: 0 0 20px var(--green);
52
+ animation: pulse 1.5s infinite;
53
+ }
54
+
55
+ #enter-btn:hover {
56
+ background: var(--orange);
57
+ box-shadow: 0 0 20px var(--orange);
58
+ }
59
+
60
+ @keyframes pulse {
61
+ 0% { box-shadow: 0 0 10px var(--green); }
62
+ 50% { box-shadow: 0 0 30px var(--green); }
63
+ 100% { box-shadow: 0 0 10px var(--green); }
64
+ }