-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathannotation.html
More file actions
581 lines (532 loc) · 33.3 KB
/
annotation.html
File metadata and controls
581 lines (532 loc) · 33.3 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<!DOCTYPE html>
<html lang="zh-TW">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>scRNA-seq 細胞類型註解互動指南</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Tailwind Config for Custom Palette -->
<script>
tailwind.config = {
theme: {
extend: {
colors: {
stone: {
50: '#fafaf9',
100: '#f5f5f4',
200: '#e7e5e4',
800: '#292524',
900: '#1c1917',
},
teal: {
600: '#0d9488',
700: '#0f766e',
},
indigo: {
600: '#4f46e5',
}
},
fontFamily: {
sans: ['Inter', 'system-ui', 'sans-serif'],
}
}
}
}
</script>
<style>
/* Embedded CSS for strict chart container constraints & custom scrollbar */
.chart-container {
position: relative;
width: 100%;
max-width: 600px;
margin-left: auto;
margin-right: auto;
height: 350px;
max-height: 400px;
}
@media (max-width: 640px) {
.chart-container {
height: 280px;
}
}
.tab-active {
border-bottom: 2px solid #0d9488;
color: #0d9488;
font-weight: 600;
}
.glass-panel {
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(10px);
border: 1px solid rgba(231, 229, 228, 0.5);
}
.fade-in {
animation: fadeIn 0.4s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
</style>
</head>
<body class="bg-stone-50 text-stone-800 antialiased min-h-screen">
<!-- Chosen Palette: Warm Neutrals (Stone) with Teal and Indigo accents -->
<!-- Application Structure Plan: The SPA uses a tabbed dashboard architecture to break down the dense technical guide into explorable modules. 1. '核心概念' (Core Concepts) establishes the 'Why' and 'How' with an interactive workflow. 2. '方法論解析' (Methodology) compares the three main annotation strategies using an interactive Radar chart to highlight trade-offs. 3. '生態系與趨勢' (Ecosystem & Trends) organizes tools and AI advancements in a clear grid. 4. '實戰挑戰' (Challenges) uses an accordion layout for problem-solution mapping. This non-linear structure allows users to jump directly to their area of interest (e.g., tools vs. theory) while maintaining context. -->
<!-- Visualization & Content Choices: 1. Goal: Inform about the 'Why' -> Viz: Doughnut Chart (Chart.js) -> Interaction: Hover tooltips -> Justification: Shows the proportional importance of biological, functional, and QC reasons. 2. Goal: Explain Workflow -> Viz: Interactive HTML/Tailwind step boxes -> Interaction: Click to reveal details -> Justification: Breaks down linear processes better than static text. 3. Goal: Compare Methods -> Viz: Radar Chart (Chart.js) -> Interaction: Hover to see exact scores across 5 dimensions -> Justification: Perfect for multivariate comparison of pros/cons (Speed, Accuracy, etc.). 4. Goal: Organize Challenges -> Viz: Interactive Accordion list -> Interaction: Click to expand -> Justification: Keeps the UI clean while hiding dense troubleshooting text until needed. Library: Chart.js for canvas charts, Vanilla JS for interactivity. -->
<!-- CONFIRMATION: NO SVG graphics used. NO Mermaid JS used. -->
<!-- Header Section -->
<header class="bg-white shadow-sm sticky top-0 z-50">
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex flex-col md:flex-row justify-between items-center py-4">
<div class="flex items-center space-x-3 mb-4 md:mb-0">
<span class="text-3xl">🧬</span>
<h1 class="text-2xl font-bold text-stone-900 tracking-tight">scRNA-seq 細胞註解互動指南</h1>
</div>
<p class="text-sm text-stone-500 max-w-md text-center md:text-right">將運算數據轉化為生物學意義的核心步驟。探索 2025 最新分析流程與 AI 趨勢。</p>
</div>
<!-- Navigation Tabs -->
<nav class="flex overflow-x-auto space-x-6 border-b border-stone-200" id="main-nav">
<button onclick="switchTab('tab-core')" class="tab-btn tab-active pb-3 text-sm font-medium transition-colors hover:text-teal-600 whitespace-nowrap" data-target="tab-core">
🧠 核心概念與流程
</button>
<button onclick="switchTab('tab-methods')" class="tab-btn pb-3 text-sm font-medium text-stone-500 transition-colors hover:text-teal-600 whitespace-nowrap" data-target="tab-methods">
📊 主流方法比較
</button>
<button onclick="switchTab('tab-tools')" class="tab-btn pb-3 text-sm font-medium text-stone-500 transition-colors hover:text-teal-600 whitespace-nowrap" data-target="tab-tools">
💻 資源與 AI 趨勢
</button>
<button onclick="switchTab('tab-challenges')" class="tab-btn pb-3 text-sm font-medium text-stone-500 transition-colors hover:text-teal-600 whitespace-nowrap" data-target="tab-challenges">
⚠️ 實戰挑戰與解法
</button>
</nav>
</div>
</header>
<!-- Main Content Area -->
<main class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- TAB 1: Core Concepts & Workflow -->
<section id="tab-core" class="tab-content fade-in block">
<div class="mb-8">
<h2 class="text-xl font-bold text-stone-900 mb-2">為什麼需要細胞類型註解?</h2>
<p class="text-stone-600 leading-relaxed">
在單細胞轉錄組分析中,電腦僅能依據基因表達相似度將細胞分群(Clusters),但無法得知其生物學身份。本區塊將幫助您理解註解的三大核心目的,並透過互動式流程圖掌握標準的分析步驟。
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8 items-start">
<!-- Doughnut Chart for 'Why' -->
<div class="glass-panel p-6 rounded-2xl shadow-sm">
<h3 class="text-lg font-semibold text-stone-800 mb-4 text-center">註解的核心驅動力</h3>
<div class="chart-container">
<canvas id="whyChart"></canvas>
</div>
<div class="mt-6 space-y-3">
<div class="flex items-start">
<span class="text-teal-600 mr-2 mt-0.5">🔹</span>
<p class="text-sm text-stone-700"><strong>生物學解釋:</strong> 確定樣本細胞組成比例,還原組織真實面貌。</p>
</div>
<div class="flex items-start">
<span class="text-indigo-600 mr-2 mt-0.5">🔹</span>
<p class="text-sm text-stone-700"><strong>功能挖掘:</strong> 尋找疾病或特定處理下,發生變化的特定細胞群。</p>
</div>
<div class="flex items-start">
<span class="text-stone-400 mr-2 mt-0.5">🔹</span>
<p class="text-sm text-stone-700"><strong>質量控制:</strong> 剔除雙細胞 (Doublets) 或低質量污染數據。</p>
</div>
</div>
</div>
<!-- Interactive Workflow -->
<div class="glass-panel p-6 rounded-2xl shadow-sm">
<h3 class="text-lg font-semibold text-stone-800 mb-4">標準註解四步曲 (點擊展開)</h3>
<div class="space-y-4 relative before:absolute before:inset-0 before:ml-5 before:-translate-x-px md:before:mx-auto md:before:translate-x-0 before:h-full before:w-0.5 before:bg-gradient-to-b before:from-transparent before:via-stone-300 before:to-transparent">
<!-- Step 1 -->
<div class="relative flex items-center justify-between md:justify-normal md:odd:flex-row-reverse group cursor-pointer" onclick="toggleStep('step1')">
<div class="flex items-center justify-center w-10 h-10 rounded-full border-4 border-white bg-teal-100 text-teal-600 font-bold shadow shrink-0 md:order-1 md:group-odd:-translate-x-1/2 md:group-even:translate-x-1/2 z-10 transition-transform group-hover:scale-110">1</div>
<div class="w-[calc(100%-4rem)] md:w-[calc(50%-2.5rem)] bg-white p-4 rounded-xl border border-stone-200 shadow-sm transition-all hover:shadow-md">
<h4 class="font-bold text-stone-800">降維與聚類</h4>
<p id="step1-desc" class="text-sm text-stone-500 mt-2 hidden fade-in">使用 PCA、UMAP 或 t-SNE 降低數據維度,並透過 Louvain 或 Leiden 算法將相似細胞分群。</p>
</div>
</div>
<!-- Step 2 -->
<div class="relative flex items-center justify-between md:justify-normal md:odd:flex-row-reverse group cursor-pointer" onclick="toggleStep('step2')">
<div class="flex items-center justify-center w-10 h-10 rounded-full border-4 border-white bg-teal-100 text-teal-600 font-bold shadow shrink-0 md:order-1 md:group-odd:-translate-x-1/2 md:group-even:translate-x-1/2 z-10 transition-transform group-hover:scale-110">2</div>
<div class="w-[calc(100%-4rem)] md:w-[calc(50%-2.5rem)] bg-white p-4 rounded-xl border border-stone-200 shadow-sm transition-all hover:shadow-md">
<h4 class="font-bold text-stone-800">尋找標誌基因 (DEGs)</h4>
<p id="step2-desc" class="text-sm text-stone-500 mt-2 hidden fade-in">對每個 Cluster 進行差異分析,找出表達量顯著升高的 Marker Genes。</p>
</div>
</div>
<!-- Step 3 -->
<div class="relative flex items-center justify-between md:justify-normal md:odd:flex-row-reverse group cursor-pointer" onclick="toggleStep('step3')">
<div class="flex items-center justify-center w-10 h-10 rounded-full border-4 border-white bg-teal-100 text-teal-600 font-bold shadow shrink-0 md:order-1 md:group-odd:-translate-x-1/2 md:group-even:translate-x-1/2 z-10 transition-transform group-hover:scale-110">3</div>
<div class="w-[calc(100%-4rem)] md:w-[calc(50%-2.5rem)] bg-white p-4 rounded-xl border border-stone-200 shadow-sm transition-all hover:shadow-md">
<h4 class="font-bold text-stone-800">身份分配</h4>
<p id="step3-desc" class="text-sm text-stone-500 mt-2 hidden fade-in">根據標誌基因,對照文獻或權威數據庫,為每個 Cluster 命名(如:T 細胞)。</p>
</div>
</div>
<!-- Step 4 -->
<div class="relative flex items-center justify-between md:justify-normal md:odd:flex-row-reverse group cursor-pointer" onclick="toggleStep('step4')">
<div class="flex items-center justify-center w-10 h-10 rounded-full border-4 border-white bg-teal-100 text-teal-600 font-bold shadow shrink-0 md:order-1 md:group-odd:-translate-x-1/2 md:group-even:translate-x-1/2 z-10 transition-transform group-hover:scale-110">4</div>
<div class="w-[calc(100%-4rem)] md:w-[calc(50%-2.5rem)] bg-white p-4 rounded-xl border border-stone-200 shadow-sm transition-all hover:shadow-md">
<h4 class="font-bold text-stone-800">可視化驗證</h4>
<p id="step4-desc" class="text-sm text-stone-500 mt-2 hidden fade-in">透過小提琴圖 (Violin Plot)、點圖 (Dot Plot) 等檢查 Marker 基因在群體間的特異性。</p>
</div>
</div>
</div>
<div class="mt-6 bg-teal-50 border-l-4 border-teal-500 p-4 rounded text-sm text-teal-900">
💡 <strong>專家建議:</strong> 大多數研究最穩健的策略是「自動預測 + 人工校對」。
</div>
</div>
</div>
</section>
<!-- TAB 2: Methodology Comparison -->
<section id="tab-methods" class="tab-content hidden">
<div class="mb-8">
<h2 class="text-xl font-bold text-stone-900 mb-2">三大主流註解方法解析</h2>
<p class="text-stone-600 leading-relaxed">
選擇正確的註解方法取決於您的數據特點與研究目的。此區塊透過多維度雷達圖,直觀比較「人工註解」、「基於參考數據」與「基於標誌基因」三種策略的優劣勢。
</p>
</div>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8 items-center">
<!-- Radar Chart -->
<div class="glass-panel p-6 rounded-2xl shadow-sm flex flex-col items-center">
<h3 class="text-lg font-semibold text-stone-800 mb-4 w-full text-center">方法優勢多維度比較</h3>
<div class="chart-container w-full">
<canvas id="methodsRadarChart"></canvas>
</div>
<p class="text-xs text-stone-400 mt-4 text-center">分數越高代表在該維度表現越佳(例如:自動化程度越高,分數越高)。</p>
</div>
<!-- Method Details -->
<div class="space-y-4">
<!-- Method A -->
<div class="bg-white p-5 rounded-xl border border-stone-200 shadow-sm hover:border-teal-300 transition-colors">
<div class="flex items-center justify-between mb-2">
<h4 class="text-lg font-bold text-teal-700">A. 人工註解 (Manual)</h4>
<span class="px-2 py-1 bg-yellow-100 text-yellow-800 text-xs font-bold rounded">黃金標準</span>
</div>
<p class="text-sm text-stone-600 mb-3">分析者手動查看高表達基因 (P值與 logFC),並與文獻比對。</p>
<ul class="text-sm text-stone-500 list-disc pl-5 space-y-1">
<li><strong>優點:</strong> 準確度極高,能發現稀有亞型 (Subtypes) 或全新細胞。</li>
<li><strong>缺點:</strong> 極度耗時,易受主觀經驗影響。</li>
</ul>
</div>
<!-- Method B -->
<div class="bg-white p-5 rounded-xl border border-stone-200 shadow-sm hover:border-indigo-300 transition-colors">
<div class="flex items-center justify-between mb-2">
<h4 class="text-lg font-bold text-indigo-700">B. 基於參考數據 (Reference-based)</h4>
<span class="px-2 py-1 bg-indigo-50 text-indigo-800 text-xs font-bold rounded">快速映射</span>
</div>
<p class="text-sm text-stone-600 mb-3">將數據與已標註圖譜 (如 Human Cell Atlas) 計算相關性。</p>
<ul class="text-sm text-stone-500 list-disc pl-5 space-y-1">
<li><strong>優點:</strong> 快速、可重複性強。</li>
<li><strong>缺點:</strong> 依賴參考集質量,無法識別參考集中不存在的新細胞。</li>
<li><strong>代表工具:</strong> SingleR, Azimuth, Scmap</li>
</ul>
</div>
<!-- Method C -->
<div class="bg-white p-5 rounded-xl border border-stone-200 shadow-sm hover:border-stone-400 transition-colors">
<div class="flex items-center justify-between mb-2">
<h4 class="text-lg font-bold text-stone-700">C. 基於標誌基因組 (Marker-based)</h4>
<span class="px-2 py-1 bg-stone-100 text-stone-800 text-xs font-bold rounded">富集評分</span>
</div>
<p class="text-sm text-stone-600 mb-3">提供預定義細胞標誌清單,算法評估 Cluster 富集程度。</p>
<ul class="text-sm text-stone-500 list-disc pl-5 space-y-1">
<li><strong>優點:</strong> 不需完整轉錄組參考,只需精確的 Marker 列表。</li>
<li><strong>代表工具:</strong> SCINA, CellAssign, AUCell</li>
</ul>
</div>
</div>
</div>
</section>
<!-- TAB 3: Tools & Trends -->
<section id="tab-tools" class="tab-content hidden">
<div class="mb-8">
<h2 class="text-xl font-bold text-stone-900 mb-2">資源庫與 2025 AI 新趨勢</h2>
<p class="text-stone-600 leading-relaxed">
強大的數據庫是準確註解的基石,而人工智慧模型正徹底改變我們處理單細胞數據的方式。探索必備辭典與前沿技術。
</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<!-- Databases -->
<div>
<h3 class="text-lg font-bold text-stone-800 mb-4 flex items-center">
<span class="text-2xl mr-2">📚</span> 必備資料庫辭典
</h3>
<div class="space-y-4">
<div class="bg-white p-4 rounded-lg border-l-4 border-teal-500 shadow-sm">
<h4 class="font-bold text-stone-800">CellMarker 2.0</h4>
<p class="text-sm text-stone-600 mt-1">目前最全面的細胞標誌基因數據庫,涵蓋大量組織與疾病狀態,是人工註解的首選查詢工具。</p>
</div>
<div class="bg-white p-4 rounded-lg border-l-4 border-teal-400 shadow-sm">
<h4 class="font-bold text-stone-800">PanglaoDB</h4>
<p class="text-sm text-stone-600 mt-1">深度整合了人類與小鼠單細胞數據的標誌基因,特別適合跨物種對比分析。</p>
</div>
<div class="bg-white p-4 rounded-lg border-l-4 border-teal-300 shadow-sm">
<h4 class="font-bold text-stone-800">CZ CELLxGENE</h4>
<p class="text-sm text-stone-600 mt-1">2025 年主流的圖譜瀏覽器,擁有海量標準化數據,非常適合用於結果的交叉驗證。</p>
</div>
</div>
</div>
<!-- AI Trends -->
<div>
<h3 class="text-lg font-bold text-stone-800 mb-4 flex items-center">
<span class="text-2xl mr-2">🤖</span> LLM 與基礎模型發展
</h3>
<div class="bg-gradient-to-br from-indigo-900 to-indigo-700 p-6 rounded-2xl text-white shadow-lg h-full">
<p class="text-indigo-100 mb-6 text-sm">
大型語言模型 (LLM) 與預訓練基礎模型正在取代傳統的純統計學分析,提供更具生物學直覺的註解結果。
</p>
<div class="space-y-5">
<div class="bg-white/10 p-4 rounded-xl backdrop-blur-sm border border-white/20">
<h4 class="font-bold text-teal-300 flex items-center">
<span class="mr-2">💬</span> GPT-based Annotation
</h4>
<p class="text-sm text-indigo-50 mt-2">
工具如 <code>mLLMCelltype</code> 透過精心設計的 Prompt,將 Top DEGs 餵給 GPT-4 等模型,讓 AI 總結並推理細胞身份,極大化減少文獻檢索時間。
</p>
</div>
<div class="bg-white/10 p-4 rounded-xl backdrop-blur-sm border border-white/20">
<h4 class="font-bold text-teal-300 flex items-center">
<span class="mr-2">🧠</span> Foundation Models (基礎模型)
</h4>
<p class="text-sm text-indigo-50 mt-2">
如 <strong>scGPT</strong> 或 <strong>Geneformer</strong>。這些模型在千萬級單細胞數據上進行預訓練,理解基因間的語境關係,能「直接預測」細胞類別及狀態。
</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- TAB 4: Challenges -->
<section id="tab-challenges" class="tab-content hidden">
<div class="mb-8">
<h2 class="text-xl font-bold text-stone-900 mb-2">實戰挑戰與解決策略</h2>
<p class="text-stone-600 leading-relaxed">
真實世界的數據充滿雜訊。以下收錄了 scRNA-seq 註解過程中最常見的四大難題,點擊即可查看對應的排雷策略。
</p>
</div>
<div class="max-w-3xl mx-auto space-y-3">
<!-- Challenge 1 -->
<div class="bg-white border border-stone-200 rounded-lg overflow-hidden transition-shadow hover:shadow-md">
<button class="w-full text-left px-6 py-4 flex items-center justify-between focus:outline-none" onclick="toggleAccordion('acc1')">
<div class="flex items-center">
<span class="text-red-500 font-bold mr-3 text-lg">⚠️</span>
<span class="font-bold text-stone-800">批次效應 (Batch Effect)</span>
</div>
<span id="acc1-icon" class="text-stone-400 transition-transform duration-300">➕</span>
</button>
<div id="acc1-content" class="px-6 pb-4 hidden fade-in border-t border-stone-100 bg-stone-50">
<p class="text-sm text-stone-600 mt-3 mb-2"><strong>情境:</strong> 不同實驗室、不同天做的實驗數據混合時,相同細胞因技術誤差被分到不同 Cluster。</p>
<p class="text-sm text-teal-700 bg-teal-50 p-2 rounded"><strong>✅ 解決建議:</strong> 在聚類前,使用 <code>Harmony</code> 或 <code>Seurat v5</code> 的整合功能 (Integration) 消除技術誤差。</p>
</div>
</div>
<!-- Challenge 2 -->
<div class="bg-white border border-stone-200 rounded-lg overflow-hidden transition-shadow hover:shadow-md">
<button class="w-full text-left px-6 py-4 flex items-center justify-between focus:outline-none" onclick="toggleAccordion('acc2')">
<div class="flex items-center">
<span class="text-red-500 font-bold mr-3 text-lg">⚠️</span>
<span class="font-bold text-stone-800">細胞狀態 vs 類型界限模糊</span>
</div>
<span id="acc2-icon" class="text-stone-400 transition-transform duration-300">➕</span>
</button>
<div id="acc2-content" class="px-6 pb-4 hidden fade-in border-t border-stone-100 bg-stone-50">
<p class="text-sm text-stone-600 mt-3 mb-2"><strong>情境:</strong> 難以區分「活化 T 細胞」與「記憶 T 細胞」,因為它們表達大量相似的基因。</p>
<p class="text-sm text-teal-700 bg-teal-50 p-2 rounded"><strong>✅ 解決建議:</strong> 單純看 Marker 不夠,應結合基因集富集分析 (GSEA) 或路徑分析來區分功能狀態。</p>
</div>
</div>
<!-- Challenge 3 -->
<div class="bg-white border border-stone-200 rounded-lg overflow-hidden transition-shadow hover:shadow-md">
<button class="w-full text-left px-6 py-4 flex items-center justify-between focus:outline-none" onclick="toggleAccordion('acc3')">
<div class="flex items-center">
<span class="text-red-500 font-bold mr-3 text-lg">⚠️</span>
<span class="font-bold text-stone-800">雙細胞 (Doublets) 污染</span>
</div>
<span id="acc3-icon" class="text-stone-400 transition-transform duration-300">➕</span>
</button>
<div id="acc3-content" class="px-6 pb-4 hidden fade-in border-t border-stone-100 bg-stone-50">
<p class="text-sm text-stone-600 mt-3 mb-2"><strong>情境:</strong> 機器將兩個黏在一起的不同細胞(如 B細胞與 T細胞)當成一個,導致該 Cluster 同時表達兩類 Marker。</p>
<p class="text-sm text-teal-700 bg-teal-50 p-2 rounded"><strong>✅ 解決建議:</strong> 在分析極早期階段,使用 <code>Scrublet</code> 或 <code>DoubletFinder</code> 工具進行預先過濾剔除。</p>
</div>
</div>
<!-- Challenge 4 -->
<div class="bg-white border border-stone-200 rounded-lg overflow-hidden transition-shadow hover:shadow-md">
<button class="w-full text-left px-6 py-4 flex items-center justify-between focus:outline-none" onclick="toggleAccordion('acc4')">
<div class="flex items-center">
<span class="text-red-500 font-bold mr-3 text-lg">⚠️</span>
<span class="font-bold text-stone-800">解析度 (Resolution) 難以抉擇</span>
</div>
<span id="acc4-icon" class="text-stone-400 transition-transform duration-300">➕</span>
</button>
<div id="acc4-content" class="px-6 pb-4 hidden fade-in border-t border-stone-100 bg-stone-50">
<p class="text-sm text-stone-600 mt-3 mb-2"><strong>情境:</strong> 聚類參數太粗看不到亞型,太細又會導致細胞群體過度碎片化。</p>
<p class="text-sm text-teal-700 bg-teal-50 p-2 rounded"><strong>✅ 解決建議:</strong> 使用 clustree 工具繪製不同 Resolution 下的聚類樹,觀察分群的穩定性;結合生物學背景知識選擇最合理的層級。</p>
</div>
</div>
</div>
</section>
</main>
<footer class="text-center py-6 mt-10 border-t border-stone-200 text-stone-400 text-sm">
<p>scRNA-seq Cell Type Annotation Interactive Guide © 2025</p>
</footer>
<!-- JavaScript Logic -->
<script>
// --- 1. Tab Navigation Logic ---
function switchTab(tabId) {
// Hide all tabs
document.querySelectorAll('.tab-content').forEach(el => {
el.classList.add('hidden');
el.classList.remove('block');
});
// Show target tab
const target = document.getElementById(tabId);
target.classList.remove('hidden');
target.classList.add('block');
// Update button styles
document.querySelectorAll('.tab-btn').forEach(btn => {
if(btn.dataset.target === tabId) {
btn.classList.add('tab-active');
btn.classList.remove('text-stone-500');
} else {
btn.classList.remove('tab-active');
btn.classList.add('text-stone-500');
}
});
// Trigger chart animations if tab is active
if(tabId === 'tab-methods' && !window.radarRendered) {
renderRadarChart();
window.radarRendered = true;
}
}
// --- 2. Interactive Workflow (Step details toggle) ---
function toggleStep(stepId) {
const descEl = document.getElementById(`${stepId}-desc`);
if(descEl.classList.contains('hidden')) {
descEl.classList.remove('hidden');
} else {
descEl.classList.add('hidden');
}
}
// --- 3. Accordion Logic (Challenges) ---
function toggleAccordion(accId) {
const content = document.getElementById(`${accId}-content`);
const icon = document.getElementById(`${accId}-icon`);
if(content.classList.contains('hidden')) {
content.classList.remove('hidden');
icon.style.transform = "rotate(45deg)"; // Turns + into x
} else {
content.classList.add('hidden');
icon.style.transform = "rotate(0deg)";
}
}
// --- 4. Chart.js Renderers ---
// Chart defaults for clean UI
Chart.defaults.font.family = "'Inter', 'system-ui', 'sans-serif'";
Chart.defaults.color = '#78716c'; // stone-500
// A. Doughnut Chart (Why annotate?)
const ctxWhy = document.getElementById('whyChart').getContext('2d');
new Chart(ctxWhy, {
type: 'doughnut',
data: {
labels: ['生物學解釋', '功能狀態挖掘', '數據質量控制'],
datasets: [{
data: [45, 40, 15],
backgroundColor: [
'#0d9488', // teal-600
'#4f46e5', // indigo-600
'#d6d3d1' // stone-300
],
borderWidth: 0,
hoverOffset: 4
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'bottom',
labels: { padding: 20, usePointStyle: true }
},
tooltip: {
callbacks: {
label: function(context) {
return ` ${context.label}: 權重約 ${context.raw}%`;
}
}
}
},
cutout: '65%'
}
});
// B. Radar Chart (Method Comparison) - Lazy loaded when tab clicked
window.radarRendered = false;
function renderRadarChart() {
const ctxRadar = document.getElementById('methodsRadarChart').getContext('2d');
new Chart(ctxRadar, {
type: 'radar',
data: {
labels: ['準確度與發現性', '自動化程度', '分析速度', '可重複性', '低門檻 (不需參考)'],
datasets: [
{
label: '人工註解',
data: [5, 1, 1, 2, 5],
backgroundColor: 'rgba(13, 148, 136, 0.2)', // Teal
borderColor: '#0d9488',
pointBackgroundColor: '#0d9488',
borderWidth: 2
},
{
label: '基於參考數據',
data: [3, 5, 5, 5, 1],
backgroundColor: 'rgba(79, 70, 229, 0.2)', // Indigo
borderColor: '#4f46e5',
pointBackgroundColor: '#4f46e5',
borderWidth: 2
},
{
label: '基於標誌基因',
data: [3, 4, 4, 4, 4],
backgroundColor: 'rgba(120, 113, 108, 0.2)', // Stone
borderColor: '#78716c',
pointBackgroundColor: '#78716c',
borderWidth: 2,
borderDash: [5, 5]
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
scales: {
r: {
min: 0,
max: 5,
ticks: { display: false },
grid: { color: '#e7e5e4' }, // stone-200
angleLines: { color: '#e7e5e4' },
pointLabels: {
font: { size: 12, weight: 'bold' },
color: '#44403c' // stone-700
}
}
},
plugins: {
legend: {
position: 'bottom',
labels: { padding: 15, usePointStyle: true }
},
tooltip: {
callbacks: {
label: function(context) {
const labels = ["極低", "低", "中等", "高", "極高", "滿分"];
return ` ${context.dataset.label}: ${labels[context.raw]}`;
}
}
}
}
}
});
}
</script>
</body>
</html>