zscreen_pilot_data / raw_counts_data /data_shape_visualization.html
Swamy71's picture
Add raw_counts_data
3c31eef verified
Raw
History Blame Contribute Delete
52.4 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Z-Screen Data Shape Explorer</title>
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
:root {
--bg-color: #0b0f19;
--card-bg: rgba(17, 25, 40, 0.75);
--border-color: rgba(255, 255, 255, 0.08);
--text-color: #f3f4f6;
--text-muted: #9ca3af;
--primary: #8b5cf6;
--primary-glow: rgba(139, 92, 246, 0.4);
--secondary: #06b6d4;
--accent: #f43f5e;
--font-main: 'Outfit', sans-serif;
--font-mono: 'JetBrains Mono', monospace;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: var(--bg-color);
color: var(--text-color);
font-family: var(--font-main);
min-height: 100vh;
overflow-x: hidden;
background-image:
radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.1) 0, transparent 50%),
radial-gradient(at 50% 0%, rgba(139, 92, 246, 0.08) 0, transparent 50%),
radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.08) 0, transparent 50%);
background-attachment: fixed;
}
header {
padding: 2.5rem 4rem 1.5rem 4rem;
border-bottom: 1px solid var(--border-color);
background: rgba(11, 15, 25, 0.8);
backdrop-filter: blur(12px);
position: sticky;
top: 0;
z-index: 100;
display: flex;
justify-content: space-between;
align-items: center;
}
.header-title h1 {
font-size: 1.8rem;
font-weight: 700;
background: linear-gradient(135deg, #fff 30%, var(--primary) 70%, var(--secondary) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 0.25rem;
}
.header-title p {
color: var(--text-muted);
font-size: 0.95rem;
}
.nav-tabs {
display: flex;
gap: 0.5rem;
background: rgba(255, 255, 255, 0.03);
padding: 0.35rem;
border-radius: 30px;
border: 1px solid var(--border-color);
}
.tab-btn {
background: transparent;
border: none;
color: var(--text-muted);
padding: 0.6rem 1.4rem;
font-size: 0.9rem;
font-weight: 500;
border-radius: 25px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-btn.active {
background: var(--primary);
color: #fff;
box-shadow: 0 0 15px var(--primary-glow);
}
.tab-btn:hover:not(.active) {
color: #fff;
background: rgba(255, 255, 255, 0.05);
}
.container {
max-width: 1400px;
margin: 2rem auto;
padding: 0 2rem;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: fadeIn 0.4s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
/* Dashboard Overview Grid */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.stat-card {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 1.5rem;
backdrop-filter: blur(16px);
position: relative;
overflow: hidden;
transition: border-color 0.3s;
}
.stat-card:hover {
border-color: rgba(139, 92, 246, 0.3);
}
.stat-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 4px;
height: 100%;
background: var(--primary);
}
.stat-card.cyan::before { background: var(--secondary); }
.stat-card.accent::before { background: var(--accent); }
.stat-label {
color: var(--text-muted);
font-size: 0.85rem;
text-transform: uppercase;
letter-spacing: 0.05em;
margin-bottom: 0.5rem;
}
.stat-value {
font-size: 2.2rem;
font-weight: 700;
margin-bottom: 0.25rem;
font-family: var(--font-mono);
}
.stat-subtext {
color: var(--text-muted);
font-size: 0.85rem;
}
.grid-2col {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 2rem;
margin-bottom: 2rem;
}
@media (max-width: 900px) {
.grid-2col {
grid-template-columns: 1fr;
}
}
.panel {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 20px;
padding: 2rem;
backdrop-filter: blur(16px);
}
.panel-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 1.5rem;
display: flex;
align-items: center;
justify-content: space-between;
}
.panel-subtitle {
color: var(--text-muted);
font-size: 0.9rem;
font-weight: 400;
}
/* Heatmap styling */
.heatmap-container {
display: flex;
flex-direction: column;
overflow-x: auto;
}
.heatmap-grid {
display: grid;
grid-template-columns: 120px repeat(6, 1fr);
gap: 6px;
margin-top: 1rem;
min-width: 700px;
}
.heatmap-header-cell {
font-size: 0.9rem;
font-weight: 600;
text-align: center;
padding: 0.75rem 0.5rem;
color: var(--text-muted);
}
.heatmap-label-cell {
font-size: 0.85rem;
font-weight: 500;
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 1rem;
font-family: var(--font-mono);
}
.heatmap-cell {
border-radius: 6px;
padding: 1.2rem 0.5rem;
text-align: center;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.heatmap-cell:hover {
transform: scale(1.05);
z-index: 10;
box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}
.heatmap-cell-value {
font-family: var(--font-mono);
font-size: 0.85rem;
}
.heatmap-cell-pct {
font-size: 0.7rem;
font-weight: 400;
opacity: 0.8;
margin-top: 2px;
}
.heatmap-legend {
display: flex;
gap: 1.5rem;
margin-top: 2rem;
justify-content: center;
font-size: 0.85rem;
color: var(--text-muted);
}
.legend-item {
display: flex;
align-items: center;
gap: 0.5rem;
}
.legend-color {
width: 16px;
height: 16px;
border-radius: 4px;
}
/* Device Table */
.search-box {
display: flex;
gap: 1rem;
margin-bottom: 1.5rem;
}
.search-input {
flex: 1;
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--border-color);
border-radius: 30px;
padding: 0.75rem 1.5rem;
color: #fff;
font-family: var(--font-main);
font-size: 0.95rem;
outline: none;
transition: border-color 0.3s;
}
.search-input:focus {
border-color: var(--primary);
}
.filter-select {
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--border-color);
border-radius: 30px;
padding: 0.75rem 1.5rem;
color: #fff;
font-family: var(--font-main);
outline: none;
cursor: pointer;
}
.table-wrapper {
overflow-x: auto;
border-radius: 12px;
border: 1px solid var(--border-color);
}
table {
width: 100%;
border-collapse: collapse;
text-align: left;
font-size: 0.9rem;
}
th {
background: rgba(255, 255, 255, 0.02);
font-weight: 600;
color: var(--text-muted);
padding: 1rem;
border-bottom: 1px solid var(--border-color);
text-transform: uppercase;
font-size: 0.8rem;
letter-spacing: 0.05em;
}
td {
padding: 1rem;
border-bottom: 1px solid var(--border-color);
vertical-align: middle;
}
tr:last-child td {
border-bottom: none;
}
tr:hover td {
background: rgba(255, 255, 255, 0.01);
}
.badge {
display: inline-block;
padding: 0.3rem 0.6rem;
border-radius: 20px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
}
.badge-purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-cyan { background: rgba(6, 182, 212, 0.15); color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }
.badge-orange { background: rgba(249, 115, 22, 0.15); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
/* Library details grid */
.lib-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.5rem;
}
.lib-card {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 1.5rem;
backdrop-filter: blur(12px);
display: flex;
flex-direction: column;
justify-content: space-between;
}
.lib-name {
font-size: 1.2rem;
font-weight: 600;
margin-bottom: 0.5rem;
font-family: var(--font-mono);
display: flex;
justify-content: space-between;
align-items: center;
}
.lib-details-row {
display: flex;
justify-content: space-between;
padding: 0.4rem 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.04);
font-size: 0.9rem;
}
.lib-details-row:last-child {
border-bottom: none;
}
.lib-details-label {
color: var(--text-muted);
}
.lib-details-val {
font-family: var(--font-mono);
font-weight: 500;
}
.roles-list {
margin-top: 1rem;
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
}
</style>
</head>
<body>
<header>
<div class="header-title">
<h1>Z-Screen Data Shape Explorer</h1>
<p>Interactive structural visualization of nanowells, devices, cell lines, and libraries</p>
</div>
<div class="nav-tabs">
<button class="tab-btn active" onclick="switchTab('tab-overview')">Overview</button>
<button class="tab-btn" onclick="switchTab('tab-matrix')">Screen Matrix</button>
<button class="tab-btn" onclick="switchTab('tab-devices')">Device Mapping</button>
<button class="tab-btn" onclick="switchTab('tab-libraries')">Libraries</button>
</div>
</header>
<div class="container">
<!-- OVERVIEW TAB -->
<div id="tab-overview" class="tab-content active">
<div class="stats-grid">
<div class="stat-card">
<div class="stat-label">Total Observations (Nanowells)</div>
<div class="stat-value">768,162</div>
<div class="stat-subtext">Mapped across 49 devices</div>
</div>
<div class="stat-card cyan">
<div class="stat-label">Total Features (Genes)</div>
<div class="stat-value">46,944</div>
<div class="stat-subtext">In counts.h5ad matrix</div>
</div>
<div class="stat-card">
<div class="stat-label">Screening Devices</div>
<div class="stat-value">49</div>
<div class="stat-subtext">Numbered 0 to 48</div>
</div>
<div class="stat-card accent">
<div class="stat-label">Unique Compounds</div>
<div class="stat-value">142,227</div>
<div class="stat-subtext">Including 142.1k building blocks</div>
</div>
</div>
<!-- Nanowell Info Alert Box -->
<div class="panel" style="margin-bottom: 2rem; border-left: 4px solid var(--secondary); background: rgba(6, 182, 212, 0.04);">
<h3 style="color: var(--secondary); font-size: 1.1rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem;">
🔬 Nanowell Architecture Specification
</h3>
<p style="color: var(--text-color); font-size: 0.95rem; line-height: 1.5;">
Each observation (row) in the dataset corresponds to a single **nanowell** rather than a single cell. Each nanowell measures **90 microns in diameter by 120 microns tall** and holds approximately **2 to 10 cells**. The transcriptomic profiles represent the pooled expression of the cells inside each nanowell.
</p>
</div>
<div class="grid-2col">
<div class="panel">
<div class="panel-title">
<span>Nanowells per Cell Line</span>
<span class="panel-subtitle">Total profiled nanowells</span>
</div>
<div style="height: 300px; position: relative;">
<canvas id="cellLineChart"></canvas>
</div>
</div>
<div class="panel">
<div class="panel-title">
<span>Dataset Role Split</span>
<span class="panel-subtitle">By screening category (wells)</span>
</div>
<div style="height: 300px; position: relative;">
<canvas id="roleChart"></canvas>
</div>
</div>
</div>
<div class="panel" style="margin-top: 2rem;">
<div class="panel-title">Key Structural Insights</div>
<div style="line-height: 1.6; display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem;">
<div>
<h3 style="margin-bottom: 0.5rem; color: var(--secondary);">🔬 Multiplexed Chip Architecture</h3>
<p style="color: var(--text-muted); margin-bottom: 1.25rem;">
Each physical device runs exactly <strong>one cell line</strong>. This eliminates cell mixing within a single microfluidic chip, enabling clean downstream sorting. However, multiple chemical libraries are pooled on each chip (ranging from 2 to 8 libraries per device).
</p>
</div>
<div>
<h3 style="margin-bottom: 0.5rem; color: var(--accent);">🧪 Named Control Compounds vs. Combinatorial Libraries</h3>
<p style="color: var(--text-muted); margin-bottom: 1.25rem;">
The screen features a split between **One-Bead One-Compound (OBOC) combinatorial libraries** (testing 142.1k chemical precursor fragments across 353.3k wells) and **Named Control Compounds** (testing 78 fully synthesized target compounds across 311.3k wells).
</p>
<h3 style="margin-bottom: 0.5rem; color: var(--primary);">🛡️ No-Compound Control Beads</h3>
<p style="color: var(--text-muted);">
Out of 49 devices, <strong>24 devices</strong> contain no-compound controls (including capture-only control bead library `ZEL026-2` and water/vehicle controls like `ZIC005`). Only <strong>Device 11</strong> lacks control beads entirely, profiling named control compounds exclusively.
</p>
</div>
</div>
</div>
</div>
<!-- MATRIX TAB -->
<div id="tab-matrix" class="tab-content">
<div class="panel">
<div class="panel-title">
<div>
Screening Matrix Map
<div class="panel-subtitle">Nanowell counts mapped per library (rows) and cell line (columns)</div>
</div>
</div>
<div class="heatmap-container">
<div class="heatmap-grid" id="heatmapGrid">
<!-- JS populated -->
</div>
<div class="heatmap-legend">
<div class="legend-item"><div class="legend-color" style="background: rgba(139, 92, 246, 0.05); border: 1px solid var(--border-color);"></div> Not Screened</div>
<div class="legend-item"><div class="legend-color" style="background: rgba(139, 92, 246, 0.25);"></div> low (&lt; 2,000 wells)</div>
<div class="legend-item"><div class="legend-color" style="background: rgba(139, 92, 246, 0.55);"></div> medium (2k - 25k wells)</div>
<div class="legend-item"><div class="legend-color" style="background: rgba(139, 92, 246, 0.85);"></div> high (&gt; 25k wells)</div>
</div>
</div>
</div>
</div>
<!-- DEVICES TAB -->
<div id="tab-devices" class="tab-content">
<div class="panel">
<div class="panel-title">
<div>
Device-Level Screen Map
<div class="panel-subtitle">Search, filter, and inspect cell line labels and pooled libraries per device</div>
</div>
</div>
<div class="search-box">
<input type="text" id="deviceSearch" class="search-input" placeholder="Search devices by ID, cell line, or library..." oninput="filterDevices()">
<select id="cellLineFilter" class="filter-select" onchange="filterDevices()">
<option value="">All Cell Lines</option>
<option value="HEK293">HEK293</option>
<option value="HEK293-clone">HEK293-clone</option>
<option value="A549">A549</option>
<option value="H1650">H1650</option>
<option value="THP1">THP1</option>
<option value="AEC7">AEC7</option>
</select>
</div>
<div class="table-wrapper">
<table id="deviceTable">
<thead>
<tr>
<th>Device ID</th>
<th>Cell Line</th>
<th>Libraries Screened</th>
<th>Nanowell Count</th>
<th>Treatment Split</th>
</tr>
</thead>
<tbody id="deviceTableBody">
<!-- JS populated -->
</tbody>
</table>
</div>
</div>
</div>
<!-- LIBRARIES TAB -->
<div id="tab-libraries" class="tab-content">
<div class="panel">
<div class="panel-title">
<div>
Screened Chemical Libraries & Control Sets
<div class="panel-subtitle">Details of compound counts, SMILES configurations, and nomenclature types</div>
</div>
</div>
<div class="lib-grid" id="libGrid">
<!-- JS populated -->
</div>
</div>
</div>
</div>
<script>
// Embedded JSON structures
const results = {
"compounds_per_library": {
"ZIC008": {
"unique_public_compound_ids": 35,
"unique_smiles": 35,
"unique_names": 35,
"condition_roles": {
"compound_treatment": 256052
}
},
"ZEL026-2": {
"unique_public_compound_ids": 0,
"unique_smiles": 0,
"unique_names": 1,
"condition_roles": {
"capture_only": 95583
}
},
"ZEL031": {
"unique_public_compound_ids": 10265,
"unique_smiles": 10265,
"unique_names": 1,
"condition_roles": {
"building_block_treatment": 43241
}
},
"ZEL028-2": {
"unique_public_compound_ids": 117950,
"unique_smiles": 117950,
"unique_names": 1,
"condition_roles": {
"building_block_treatment": 134821
}
},
"ZIC004": {
"unique_public_compound_ids": 1,
"unique_smiles": 1,
"unique_names": 1,
"condition_roles": {
"compound_treatment": 1913
}
},
"ZIC006": {
"unique_public_compound_ids": 1,
"unique_smiles": 1,
"unique_names": 1,
"condition_roles": {
"compound_treatment": 2099
}
},
"ZIC003": {
"unique_public_compound_ids": 2,
"unique_smiles": 2,
"unique_names": 2,
"condition_roles": {
"compound_treatment": 1880
}
},
"ZIC002": {
"unique_public_compound_ids": 7,
"unique_smiles": 7,
"unique_names": 7,
"condition_roles": {
"compound_treatment": 10999
}
},
"ZIC001": {
"unique_public_compound_ids": 2,
"unique_smiles": 2,
"unique_names": 2,
"condition_roles": {
"compound_treatment": 6569
}
},
"ZEL024": {
"unique_public_compound_ids": 13934,
"unique_smiles": 13934,
"unique_names": 1,
"condition_roles": {
"building_block_treatment": 175285
}
},
"ZIC005": {
"unique_public_compound_ids": 1,
"unique_smiles": 0,
"unique_names": 1,
"condition_roles": {
"compound_treatment": 157
}
},
"ZIC007": {
"unique_public_compound_ids": 4,
"unique_smiles": 4,
"unique_names": 4,
"condition_roles": {
"compound_treatment": 565
}
},
"ZIC009": {
"unique_public_compound_ids": 31,
"unique_smiles": 31,
"unique_names": 31,
"condition_roles": {
"compound_treatment": 31107
}
},
"ZIC005-2": {
"unique_public_compound_ids": 0,
"unique_smiles": 0,
"unique_names": 1,
"condition_roles": {
"capture_only": 7891
}
}
},
"cell_lines": {
"list": [
"HEK293-clone",
"A549",
"H1650",
"HEK293",
"THP1",
"AEC7"
],
"count": 6
},
"libraries_per_cell_line": {
"HEK293-clone": {
"libraries": [
"ZIC008",
"ZEL026-2"
],
"count": 2
},
"A549": {
"libraries": [
"ZIC008",
"ZEL026-2",
"ZEL031",
"ZEL028-2",
"ZIC006",
"ZIC004"
],
"count": 6
},
"H1650": {
"libraries": [
"ZIC008",
"ZEL031",
"ZEL028-2",
"ZEL024",
"ZIC003",
"ZIC005",
"ZIC002",
"ZIC001",
"ZEL026-2",
"ZIC006",
"ZIC004",
"ZIC007"
],
"count": 12
},
"HEK293": {
"libraries": [
"ZIC008",
"ZEL028-2",
"ZEL024",
"ZIC002",
"ZIC001",
"ZIC003"
],
"count": 6
},
"THP1": {
"libraries": [
"ZEL031",
"ZIC004",
"ZIC006",
"ZIC003",
"ZIC002",
"ZIC001",
"ZIC007",
"ZIC005"
],
"count": 8
},
"AEC7": {
"libraries": [
"ZIC008",
"ZEL026-2",
"ZIC009",
"ZIC005-2"
],
"count": 4
}
},
"devices": {
"list": [
0,
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
],
"count": 49
},
"device_cell_lines": {
"0": [
"HEK293"
],
"1": [
"HEK293"
],
"2": [
"HEK293"
],
"3": [
"HEK293"
],
"4": [
"HEK293"
],
"5": [
"HEK293"
],
"6": [
"H1650"
],
"7": [
"H1650"
],
"8": [
"H1650"
],
"9": [
"H1650"
],
"10": [
"THP1"
],
"11": [
"A549"
],
"12": [
"THP1"
],
"13": [
"A549"
],
"14": [
"A549"
],
"15": [
"A549"
],
"16": [
"A549"
],
"17": [
"A549"
],
"18": [
"A549"
],
"19": [
"H1650"
],
"20": [
"H1650"
],
"21": [
"A549"
],
"22": [
"A549"
],
"23": [
"A549"
],
"24": [
"H1650"
],
"25": [
"A549"
],
"26": [
"H1650"
],
"27": [
"HEK293"
],
"28": [
"HEK293"
],
"29": [
"HEK293-clone"
],
"30": [
"HEK293-clone"
],
"31": [
"HEK293"
],
"32": [
"HEK293"
],
"33": [
"AEC7"
],
"34": [
"AEC7"
],
"35": [
"AEC7"
],
"36": [
"AEC7"
],
"37": [
"AEC7"
],
"38": [
"AEC7"
],
"39": [
"AEC7"
],
"40": [
"AEC7"
],
"41": [
"AEC7"
],
"42": [
"AEC7"
],
"43": [
"AEC7"
],
"44": [
"AEC7"
],
"45": [
"AEC7"
],
"46": [
"AEC7"
],
"47": [
"AEC7"
],
"48": [
"AEC7"
]
},
"is_each_device_single_cell_line": true,
"device_libraries": {
"0": [
"ZEL024",
"ZIC002",
"ZIC001"
],
"1": [
"ZEL024",
"ZIC002",
"ZIC001"
],
"2": [
"ZEL024",
"ZIC002",
"ZIC001"
],
"3": [
"ZEL024",
"ZIC002",
"ZIC001"
],
"4": [
"ZEL024",
"ZIC003",
"ZIC002",
"ZIC001"
],
"5": [
"ZEL024",
"ZIC003",
"ZIC002",
"ZIC001"
],
"6": [
"ZEL024",
"ZIC002",
"ZIC005",
"ZIC001",
"ZIC003"
],
"7": [
"ZEL024",
"ZIC003",
"ZIC005",
"ZIC002",
"ZIC001"
],
"8": [
"ZEL026-2",
"ZIC007",
"ZIC004",
"ZIC006",
"ZIC003",
"ZIC002",
"ZIC001"
],
"9": [
"ZEL026-2",
"ZIC006",
"ZIC003",
"ZIC004",
"ZIC002",
"ZIC001",
"ZIC007"
],
"10": [
"ZIC006",
"ZEL031",
"ZIC007",
"ZIC004",
"ZIC005",
"ZIC002",
"ZIC003",
"ZIC001"
],
"11": [
"ZIC006",
"ZIC004"
],
"12": [
"ZEL031",
"ZIC004",
"ZIC006",
"ZIC003",
"ZIC002",
"ZIC001"
],
"13": [
"ZIC008",
"ZEL031"
],
"14": [
"ZIC008",
"ZEL031"
],
"15": [
"ZIC008",
"ZEL031"
],
"16": [
"ZIC008",
"ZEL031"
],
"17": [
"ZIC008",
"ZEL026-2",
"ZIC004"
],
"18": [
"ZIC008",
"ZEL026-2",
"ZIC004"
],
"19": [
"ZIC008",
"ZEL031"
],
"20": [
"ZIC008",
"ZEL031"
],
"21": [
"ZEL026-2",
"ZIC008"
],
"22": [
"ZIC008",
"ZEL026-2"
],
"23": [
"ZIC008",
"ZEL028-2"
],
"24": [
"ZIC008",
"ZEL028-2"
],
"25": [
"ZIC008",
"ZEL028-2"
],
"26": [
"ZIC008",
"ZEL028-2"
],
"27": [
"ZIC008",
"ZEL028-2"
],
"28": [
"ZIC008",
"ZEL028-2"
],
"29": [
"ZIC008",
"ZEL026-2"
],
"30": [
"ZIC008",
"ZEL026-2"
],
"31": [
"ZIC008",
"ZEL028-2"
],
"32": [
"ZIC008",
"ZEL028-2"
],
"33": [
"ZIC008",
"ZEL026-2",
"ZIC009"
],
"34": [
"ZEL026-2",
"ZIC008",
"ZIC009"
],
"35": [
"ZIC008",
"ZEL026-2",
"ZIC009"
],
"36": [
"ZIC008",
"ZEL026-2",
"ZIC009"
],
"37": [
"ZIC008",
"ZEL026-2",
"ZIC009"
],
"38": [
"ZEL026-2",
"ZIC008",
"ZIC009"
],
"39": [
"ZIC008",
"ZEL026-2",
"ZIC009"
],
"40": [
"ZIC008",
"ZEL026-2",
"ZIC009"
],
"41": [
"ZIC008",
"ZIC005-2",
"ZIC009"
],
"42": [
"ZIC008",
"ZIC009",
"ZIC005-2"
],
"43": [
"ZIC008",
"ZIC005-2",
"ZIC009"
],
"44": [
"ZIC008",
"ZIC005-2",
"ZIC009"
],
"45": [
"ZIC008",
"ZIC005-2",
"ZIC009"
],
"46": [
"ZIC008",
"ZIC005-2",
"ZIC009"
],
"47": [
"ZIC008",
"ZIC009",
"ZIC005-2"
],
"48": [
"ZIC008",
"ZIC005-2",
"ZIC009"
]
},
"is_each_device_single_library": false,
"device_condition_roles": {
"0": {
"building_block_treatment": 25310,
"compound_treatment": 2051
},
"1": {
"building_block_treatment": 20398,
"compound_treatment": 1613
},
"2": {
"building_block_treatment": 30307,
"compound_treatment": 2599
},
"3": {
"building_block_treatment": 28064,
"compound_treatment": 2454
},
"4": {
"building_block_treatment": 26973,
"compound_treatment": 3040
},
"5": {
"building_block_treatment": 22688,
"compound_treatment": 2578
},
"6": {
"building_block_treatment": 19253,
"compound_treatment": 846
},
"7": {
"building_block_treatment": 2292,
"compound_treatment": 263
},
"8": {
"capture_only": 10369,
"compound_treatment": 2053
},
"9": {
"capture_only": 6717,
"compound_treatment": 854
},
"10": {
"building_block_treatment": 2837,
"compound_treatment": 911
},
"11": {
"compound_treatment": 257
},
"12": {
"building_block_treatment": 19105,
"compound_treatment": 4591
},
"13": {
"compound_treatment": 7771,
"building_block_treatment": 5831
},
"14": {
"compound_treatment": 5583,
"building_block_treatment": 4295
},
"15": {
"compound_treatment": 11376,
"building_block_treatment": 5522
},
"16": {
"compound_treatment": 7041,
"building_block_treatment": 5220
},
"17": {
"compound_treatment": 9757,
"capture_only": 3918
},
"18": {
"compound_treatment": 8428,
"capture_only": 2904
},
"19": {
"compound_treatment": 6283,
"building_block_treatment": 107
},
"20": {
"compound_treatment": 13903,
"building_block_treatment": 324
},
"21": {
"compound_treatment": 15125,
"capture_only": 12714
},
"22": {
"compound_treatment": 11058,
"capture_only": 7182
},
"23": {
"building_block_treatment": 20152,
"compound_treatment": 3456
},
"24": {
"building_block_treatment": 12056,
"compound_treatment": 2122
},
"25": {
"building_block_treatment": 22283,
"compound_treatment": 5429
},
"26": {
"building_block_treatment": 14638,
"compound_treatment": 4074
},
"27": {
"building_block_treatment": 14494,
"compound_treatment": 3505
},
"28": {
"building_block_treatment": 12865,
"compound_treatment": 2943
},
"29": {
"compound_treatment": 19951,
"capture_only": 7878
},
"30": {
"compound_treatment": 14309,
"capture_only": 7074
},
"31": {
"building_block_treatment": 20770,
"compound_treatment": 6751
},
"32": {
"building_block_treatment": 17563,
"compound_treatment": 5811
},
"33": {
"compound_treatment": 7910,
"capture_only": 3588
},
"34": {
"compound_treatment": 7340,
"capture_only": 3910
},
"35": {
"compound_treatment": 6075,
"capture_only": 3090
},
"36": {
"compound_treatment": 8004,
"capture_only": 4107
},
"37": {
"compound_treatment": 9358,
"capture_only": 4032
},
"38": {
"compound_treatment": 12360,
"capture_only": 5144
},
"39": {
"compound_treatment": 13801,
"capture_only": 7391
},
"40": {
"compound_treatment": 10753,
"capture_only": 5565
},
"41": {
"compound_treatment": 2587,
"capture_only": 342
},
"42": {
"compound_treatment": 3990,
"capture_only": 670
},
"43": {
"compound_treatment": 9698,
"capture_only": 1839
},
"44": {
"compound_treatment": 8618,
"capture_only": 1854
},
"45": {
"compound_treatment": 6209,
"capture_only": 1014
},
"46": {
"compound_treatment": 7242,
"capture_only": 1016
},
"47": {
"compound_treatment": 5136,
"capture_only": 847
},
"48": {
"compound_treatment": 3474,
"capture_only": 309
}
},
"no_compound_control_summary": {
"devices_with_capture_only": {
"list": [
8,
9,
17,
18,
21,
22,
29,
30,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48
],
"count": 24
},
"devices_with_building_block_treatment": {
"list": [
0,
1,
2,
3,
4,
5,
6,
7,
10,
12,
13,
14,
15,
16,
19,
20,
23,
24,
25,
26,
27,
28,
31,
32
],
"count": 24
}
}
};
const crosstab = {
"ZEL024": {
"A549": 0,
"AEC7": 0,
"H1650": 21545,
"HEK293": 153740,
"HEK293-clone": 0,
"THP1": 0
},
"ZEL026-2": {
"A549": 26718,
"AEC7": 36827,
"H1650": 17086,
"HEK293": 0,
"HEK293-clone": 14952,
"THP1": 0
},
"ZEL028-2": {
"A549": 42435,
"AEC7": 0,
"H1650": 26694,
"HEK293": 65692,
"HEK293-clone": 0,
"THP1": 0
},
"ZEL031": {
"A549": 20868,
"AEC7": 0,
"H1650": 431,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 21942
},
"ZIC001": {
"A549": 0,
"AEC7": 0,
"H1650": 1229,
"HEK293": 3858,
"HEK293-clone": 0,
"THP1": 1482
},
"ZIC002": {
"A549": 0,
"AEC7": 0,
"H1650": 806,
"HEK293": 9558,
"HEK293-clone": 0,
"THP1": 635
},
"ZIC003": {
"A549": 0,
"AEC7": 0,
"H1650": 378,
"HEK293": 919,
"HEK293-clone": 0,
"THP1": 583
},
"ZIC004": {
"A549": 122,
"AEC7": 0,
"H1650": 411,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 1380
},
"ZIC005": {
"A549": 0,
"AEC7": 0,
"H1650": 109,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 48
},
"ZIC005-2": {
"A549": 0,
"AEC7": 7891,
"H1650": 0,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 0
},
"ZIC006": {
"A549": 207,
"AEC7": 0,
"H1650": 631,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 1261
},
"ZIC007": {
"A549": 0,
"AEC7": 0,
"H1650": 452,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 113
},
"ZIC008": {
"A549": 84952,
"AEC7": 91448,
"H1650": 26382,
"HEK293": 19010,
"HEK293-clone": 34260,
"THP1": 0
},
"ZIC009": {
"A549": 0,
"AEC7": 31107,
"H1650": 0,
"HEK293": 0,
"HEK293-clone": 0,
"THP1": 0
}
};
function switchTab(tabId) {
document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active'));
document.querySelectorAll('.tab-btn').forEach(el => el.classList.remove('active'));
document.getElementById(tabId).classList.add('active');
// Find corresponding button
const btnText = tabId.replace('tab-', '').toLowerCase();
document.querySelectorAll('.tab-btn').forEach(btn => {
if (btn.innerText.toLowerCase() === btnText || (btnText === 'matrix' && btn.innerText.toLowerCase() === 'screen matrix')) {
btn.classList.add('active');
}
});
}
// Initialize charts
window.onload = function() {
// Cell Line chart
const ctxCell = document.getElementById('cellLineChart').getContext('2d');
new Chart(ctxCell, {
type: 'bar',
data: {
labels: ['HEK293', 'A549', 'AEC7', 'H1650', 'HEK293-clone', 'THP1'],
datasets: [{
label: 'Nanowells Profiled',
data: [252777, 175302, 167273, 96154, 49212, 27444],
backgroundColor: ['#8b5cf6', '#06b6d4', '#ec4899', '#f97316', '#e5e7eb', '#10b981'],
borderColor: 'rgba(255, 255, 255, 0.1)',
borderWidth: 1,
borderRadius: 8
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: { display: false }
},
scales: {
y: {
grid: { color: 'rgba(255, 255, 255, 0.05)' },
ticks: { color: '#9ca3af', font: { family: 'Outfit' } }
},
x: {
grid: { display: false },
ticks: { color: '#9ca3af', font: { family: 'Outfit', weight: 'bold' } }
}
}
}
});
// Role split chart
const ctxRole = document.getElementById('roleChart').getContext('2d');
new Chart(ctxRole, {
type: 'doughnut',
data: {
labels: ['OBOC Combinatorial Libraries', 'Named Control Compounds', 'No-Compound Controls'],
datasets: [{
data: [353347, 311341, 103474],
backgroundColor: ['#8b5cf6', '#06b6d4', '#f43f5e'],
borderWidth: 0,
hoverOffset: 10
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
labels: {
color: '#e5e7eb',
font: { family: 'Outfit', size: 12 },
padding: 15
}
}
},
cutout: '65%'
}
});
buildHeatmap();
buildDeviceTable();
buildLibraryCards();
};
// Build the matrix heatmap
function buildHeatmap() {
const grid = document.getElementById('heatmapGrid');
const cellLines = ['A549', 'AEC7', 'H1650', 'HEK293', 'HEK293-clone', 'THP1'];
// Header
grid.appendChild(createDiv('heatmap-header-cell', ''));
cellLines.forEach(cell => {
grid.appendChild(createDiv('heatmap-header-cell', cell));
});
// Grid rows
Object.keys(crosstab).sort().forEach(lib => {
// Label
grid.appendChild(createDiv('heatmap-label-cell', lib));
// Values
cellLines.forEach(cell => {
const val = crosstab[lib][cell] || 0;
const cellEl = document.createElement('div');
cellEl.className = 'heatmap-cell';
// Color scale
let bg = 'rgba(139, 92, 246, 0.03)';
let color = 'rgba(255, 255, 255, 0.15)';
let border = '1px solid var(--border-color)';
if (val > 0) {
border = 'none';
if (val < 2000) {
bg = 'rgba(139, 92, 246, 0.25)';
color = '#d8b4fe';
} else if (val < 25000) {
bg = 'rgba(139, 92, 246, 0.55)';
color = '#e9d5ff';
} else {
bg = 'rgba(139, 92, 246, 0.85)';
color = '#ffffff';
}
}
cellEl.style.background = bg;
cellEl.style.color = color;
cellEl.style.border = border;
const valSpan = document.createElement('span');
valSpan.className = 'heatmap-cell-value';
valSpan.innerText = val > 0 ? val.toLocaleString() : '-';
cellEl.appendChild(valSpan);
if (val > 0) {
const pctSpan = document.createElement('span');
pctSpan.className = 'heatmap-cell-pct';
pctSpan.innerText = ((val / 768162) * 100).toFixed(1) + '%';
cellEl.appendChild(pctSpan);
}
grid.appendChild(cellEl);
});
});
}
function createDiv(className, text) {
const el = document.createElement('div');
el.className = className;
el.innerText = text;
return el;
}
// Build the Device details table
function buildDeviceTable() {
const tbody = document.getElementById('deviceTableBody');
tbody.innerHTML = '';
const devices = results.devices.list;
devices.forEach(dev => {
const devStr = dev.toString();
const master_c = results.device_cell_lines[devStr][0];
const libs = results.device_libraries[devStr];
const libsBadges = libs.map(lib => {
let badgeClass = 'badge-purple';
if (lib === 'ZEL026-2') badgeClass = 'badge-rose';
else if (lib === 'ZIC005' || lib === 'ZIC005-2') badgeClass = 'badge-blue';
else if (lib.startsWith('ZEL')) badgeClass = 'badge-cyan';
return `<span class="badge ${badgeClass}" style="margin: 2px;">${lib}</span>`;
}).join(' ');
const roles = results.device_condition_roles[devStr];
const cellCount = Object.values(roles).reduce((a, b) => a + b, 0);
const rolesSplit = Object.keys(roles).map(role => {
let colorClass = 'text-muted';
let displayName = role;
if (role === 'building_block_treatment') {
displayName = 'OBOC Library';
colorClass = 'color: #a78bfa;';
} else if (role === 'compound_treatment') {
// Check if device contains ZIC005 (water control)
if (libs.includes('ZIC005')) {
displayName = 'Named Controls (+Water)';
} else {
displayName = 'Named Controls';
}
colorClass = 'color: #22d3ee;';
} else if (role === 'capture_only') {
displayName = 'No-Compound Control';
colorClass = 'color: #f43f5e;';
}
return `<span style="font-size: 0.8rem; font-family: var(--font-mono); ${colorClass} font-weight:500;">${displayName}: ${roles[role].toLocaleString()}</span>`;
}).join('<br>');
const tr = document.createElement('tr');
tr.setAttribute('data-device-id', devStr);
tr.setAttribute('data-cell-line-master', master_c);
tr.setAttribute('data-libraries', libs.join(','));
tr.innerHTML = `
<td style="font-family: var(--font-mono); font-weight:bold; padding-left: 1.5rem;">#${dev}</td>
<td>${master_c}</td>
<td>${libsBadges}</td>
<td style="font-family: var(--font-mono); font-weight: 500;">${cellCount.toLocaleString()}</td>
<td>${rolesSplit}</td>
`;
tbody.appendChild(tr);
});
}
// Filter devices in table
function filterDevices() {
const q = document.getElementById('deviceSearch').value.toLowerCase();
const cellFilter = document.getElementById('cellLineFilter').value;
const rows = document.querySelectorAll('#deviceTableBody tr');
rows.forEach(row => {
const devId = row.getAttribute('data-device-id');
const masterCell = row.getAttribute('data-cell-line-master');
const libs = row.getAttribute('data-libraries').toLowerCase();
const matchQuery = devId.includes(q) || masterCell.toLowerCase().includes(q) || libs.includes(q);
const matchCell = !cellFilter || masterCell === cellFilter;
if (matchQuery && matchCell) {
row.style.display = '';
} else {
row.style.display = 'none';
}
});
}
// Build the chemical libraries cards
function buildLibraryCards() {
const grid = document.getElementById('libGrid');
grid.innerHTML = '';
Object.keys(results.compounds_per_library).sort().forEach(lib => {
const details = results.compounds_per_library[lib];
const card = document.createElement('div');
card.className = 'lib-card';
// Sum of cells
const sumCells = Object.values(details.condition_roles).reduce((a,b)=>a+b, 0);
// Category label
let categoryLabel = '';
let badgeClass = 'badge-purple';
if (lib === 'ZEL026-2') {
categoryLabel = 'No-Compound Control Beads';
badgeClass = 'badge-rose';
} else if (lib === 'ZIC005' || lib === 'ZIC005-2') {
categoryLabel = lib === 'ZIC005' ? 'No-Compound Control (Water)' : 'No-Compound Control';
badgeClass = 'badge-blue';
} else if (lib.startsWith('ZEL')) {
categoryLabel = 'OBOC Combinatorial Library';
badgeClass = 'badge-cyan';
} else if (lib.startsWith('ZIC')) {
categoryLabel = 'Named Control Compounds';
badgeClass = 'badge-purple';
}
let roleBadge = `<span class="badge ${badgeClass}">${categoryLabel}</span>`;
card.innerHTML = `
<div>
<div class="lib-name">
<span>${lib}</span>
${roleBadge}
</div>
<div style="margin-top: 1rem;">
<div class="lib-details-row">
<span class="lib-details-label">Unique Compound IDs</span>
<span class="lib-details-val">${details.unique_public_compound_ids.toLocaleString()}</span>
</div>
<div class="lib-details-row">
<span class="lib-details-label">Unique SMILES Structure Maps</span>
<span class="lib-details-val">${details.unique_smiles.toLocaleString()}</span>
</div>
<div class="lib-details-row">
<span class="lib-details-label">Unique Names</span>
<span class="lib-details-val">${details.unique_names.toLocaleString()}</span>
</div>
<div class="lib-details-row">
<span class="lib-details-label">Total Profiled Nanowells</span>
<span class="lib-details-val" style="color: #fff;">${sumCells.toLocaleString()}</span>
</div>
</div>
</div>
`;
grid.appendChild(card);
});
}
</script>
</body>
</html>