Spaces:
Running on Zero

cellgemma / static /index.html
MaartenGr's picture
Preparing for release :)
328fef0
Raw History Blame Contribute Delete
10.2 kB
<!DOCTYPE html>
<html lang="en" class="theme-dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>CellGemma · Single-Cell Perturbation Studio</title>
<meta
name="description"
content="Interactive visual studio showing how CellGemma (Gemma 4 E4B) predicts single-cell gene expression shifts in response to a small-molecule drug or CRISPR gene knockdown."
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Google+Sans+Mono:wght@500;600;700&family=Google+Sans+Text:wght@400;500;600&family=Google+Sans:wght@500;600;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="/studio_static/styles.css" />
</head>
<body class="theme-dark">
<div class="app-frame">
<!-- 1. Precision Single-Row Top Bar -->
<header class="top-bar">
<div class="brand-lockup">
<h1 class="sr-only">CellGemma Single-Cell Perturbation Studio</h1>
<img
id="brand-logo-dark"
class="brand-wordmark wordmark-for-dark"
src="/studio_static/cellgemma_logo_dark.png"
alt="CellGemma"
width="138"
height="20"
/>
<img
id="brand-logo-light"
class="brand-wordmark wordmark-for-light"
src="/studio_static/cellgemma_logo_light.png"
alt="CellGemma"
width="138"
height="20"
/>
<span class="brand-variant-tag" title="Built on Gemma 4 (E4B)">E4B</span>
</div>
<nav class="preset-strip" aria-label="Perturbation presets">
<span class="preset-group-label">Drugs</span>
<div id="drug-preset-pills"></div>
<span class="preset-divider" aria-hidden="true"></span>
<span class="preset-group-label">CRISPR</span>
<div id="crispr-preset-pills"></div>
</nav>
<div class="run-controls">
<button
type="button"
class="theme-toggle-btn"
id="theme-toggle-btn"
aria-label="Toggle dark and light visual theme"
title="Switch between Bioluminescent Dark and Optical Quartz Light"
>
<svg class="theme-icon icon-sun" viewBox="0 0 20 20" fill="none" aria-hidden="true">
<circle cx="10" cy="10" r="3.8" stroke="currentColor" stroke-width="1.7" />
<path
d="M10 2.2v2.1M10 15.7v2.1M2.2 10h2.1M15.7 10h2.1M4.48 4.48l1.48 1.48M14.04 14.04l1.48 1.48M15.52 4.48l-1.48 1.48M5.96 14.04l-1.48 1.48"
stroke="currentColor"
stroke-width="1.7"
stroke-linecap="round"
/>
</svg>
<svg class="theme-icon icon-moon" viewBox="0 0 20 20" fill="none" aria-hidden="true">
<path
d="M15.6 12.4A6.4 6.4 0 0 1 7.6 4.4a6.4 6.4 0 1 0 8 8Z"
stroke="currentColor"
stroke-width="1.7"
stroke-linejoin="round"
/>
</svg>
<span id="theme-toggle-label">Light</span>
</button>
<button type="button" class="customize-toggle-btn" id="customize-btn" aria-expanded="false">
Customize ▾
</button>
<button
type="button"
class="reset-btn"
id="reset-btn"
title="Reset simulation to clean empty starting state"
>
<svg class="reset-icon" viewBox="0 0 20 20" fill="none" aria-hidden="true">
<path
d="M4.2 7.2A6.5 6.5 0 1 1 5.1 14.3M4.0 3.6v3.9h3.9"
stroke="currentColor"
stroke-width="1.75"
stroke-linecap="round"
stroke-linejoin="round"
/>
</svg>
<span>Reset</span>
</button>
<button type="button" class="run-cta-btn" id="run-btn">
▶ Run CellGemma
</button>
</div>
<!-- Optional Floating Customize Popover (Closed by Default) -->
<section class="customize-popover hidden" id="customize-popover" aria-label="Customize perturbation input">
<div class="popover-top">
<div class="popover-tabs">
<button type="button" class="pop-tab-btn active" id="pop-tab-drug">Small-Molecule Drug (A549)</button>
<button type="button" class="pop-tab-btn" id="pop-tab-crispr">CRISPR Knockdown (K562)</button>
</div>
<button type="button" class="popover-close-btn" id="popover-close-btn">Done</button>
</div>
<div class="popover-grid">
<div class="mini-mol-box" id="mini-mol-box" title="Drag to spin 3D structure">
<canvas class="mini-mol-canvas" id="mini-mol-canvas"></canvas>
</div>
<div class="popover-fields">
<div id="pop-drug-fields">
<div class="pop-row">
<label for="smiles-input">SMILES Structure</label>
<span class="pop-mono" id="mol-meta-readout">RDKit 3D</span>
</div>
<input type="text" class="pop-input" id="smiles-input" spellcheck="false" autocomplete="off" />
<div class="pop-row">
<label for="dose-slider">Concentration</label>
<span class="pop-mono" id="dose-readout">0.50 µM</span>
</div>
<input type="range" class="pop-slider" id="dose-slider" min="0.05" max="5.0" step="0.05" value="0.50" />
</div>
<div class="hidden" id="pop-crispr-fields">
<div class="pop-row">
<label for="gene-input">Target Human Gene</label>
<span class="pop-mono" id="kg-edge-readout">STRING Network</span>
</div>
<input type="text" class="pop-input" id="gene-input" maxlength="20" spellcheck="false" autocomplete="off" />
<div class="pop-gene-chips" id="featured-gene-chips"></div>
</div>
<div class="pop-row">
<label for="cell-idx-slider">Single Control Cell</label>
<span class="pop-mono" id="cell-idx-readout">Cell #0</span>
</div>
<input type="range" class="pop-slider" id="cell-idx-slider" min="0" max="99" step="1" value="0" />
<div class="pop-row">
<label for="temp-slider">Sampling Temperature</label>
<span class="pop-mono" id="temp-readout">0.0 (Deterministic)</span>
</div>
<input type="range" class="pop-slider" id="temp-slider" min="0" max="1.0" step="0.1" value="0" />
</div>
</div>
</section>
</header>
<!-- 2. Hero Visual Stage -->
<main class="hero-stage-card">
<div class="hero-canvas-wrap" id="hero-canvas-wrap">
<canvas class="hero-canvas" id="hero-canvas"></canvas>
</div>
</main>
<!-- 3. Precision Bottom Equalizer Strip (Fixed Height — Zero Layout Shift) -->
<section class="bottom-strip" aria-label="Predicted gene expression shifts">
<div class="error-inline hidden" id="error-banner" role="alert"></div>
<div class="outcome-strip" id="outcome-strip">
<div class="outcome-header-block">
<h2 class="outcome-headline" id="verdict-headline">Awaiting Simulation — Click ▶ Run CellGemma</h2>
<div class="outcome-meta-line">
<span class="outcome-sub" id="verdict-sub">A549 Lung Carcinoma · Single Cell #0</span>
<div class="outcome-badges">
<button
type="button"
class="outcome-action-btn hidden"
id="view-prompt-btn"
title="Inspect exact Stage 1 text prompt and raw model tokens"
>
Prompt
</button>
<button
type="button"
class="outcome-action-btn hidden"
id="download-csv-btn"
title="Download all predicted single-cell gene shifts as CSV"
>
↓ CSV
</button>
<span class="pill-stat-up pill-stat-muted" id="count-up-pill">↑ — UP</span>
<span class="pill-stat-down pill-stat-muted" id="count-down-pill">↓ — DOWN</span>
</div>
</div>
</div>
<div class="bars-two-col">
<div class="bars-column">
<div class="bars-col-label up">↑ Top Genes Turned UP (% Shift vs Baseline)</div>
<div id="bars-up-list"></div>
</div>
<div class="bars-column">
<div class="bars-col-label down">↓ Top Genes Turned DOWN (% Shift vs Baseline)</div>
<div id="bars-down-list"></div>
</div>
</div>
</div>
</section>
<!-- Raw Stage 1 Prompt & Model Output Inspector Modal -->
<div
class="prompt-modal-backdrop hidden"
id="prompt-modal-backdrop"
role="dialog"
aria-modal="true"
aria-labelledby="prompt-modal-title"
>
<div class="prompt-modal-card">
<div class="prompt-modal-header">
<div>
<h3 class="prompt-modal-title" id="prompt-modal-title">Stage 1 Prompt &amp; Emitted Gene Tokens</h3>
<p class="prompt-modal-sub" id="prompt-modal-meta">CellGemma E4B Single-Cell Transcriptional Input</p>
</div>
<div class="prompt-modal-actions">
<button type="button" class="pop-btn-secondary" id="copy-prompt-btn">Copy Prompt</button>
<button type="button" class="popover-close-btn" id="close-prompt-modal-btn">Close</button>
</div>
</div>
<div class="prompt-modal-body">
<div class="prompt-section-label">Stage 1 Input Prompt (Control Cell + Perturbation + Global Mean)</div>
<pre class="prompt-code-box" id="prompt-modal-input"></pre>
<div class="prompt-section-label">Stage 1 Raw Model Output (Ordered Residual Gene Tokens)</div>
<pre class="prompt-code-box prompt-code-box-compact" id="prompt-modal-output"></pre>
</div>
</div>
</div>
</div>
<script src="/studio_static/app.js"></script>
</body>
</html>