diff --git a/.gitattributes b/.gitattributes index f1ab19da92a1cafaa274c9d01b47c49c4eabf57f..a34011ce4e6af2ffb460d2778d89d0cd1f9ca92f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -136,3 +136,16 @@ GRN/result/scalar/scalar_bs48/eval_only/pred.h5ad filter=lfs diff=lfs merge=lfs GRN/result/scalar/scalar_bs48/eval_only/real.h5ad filter=lfs diff=lfs merge=lfs -text GRN/result/topk30_emb/grn-norman-f1-topk30-negTrue-d512-lr5e-05-lw1.0-lp0.4-ema0.9999-ln-wu2000-rk4-cached_sparse-sparse_tk30_L11/iteration_0/pred.h5ad filter=lfs diff=lfs merge=lfs -text GRN/result/topk30_emb/grn-norman-f1-topk30-negTrue-d512-lr5e-05-lw1.0-lp0.4-ema0.9999-ln-wu2000-rk4-cached_sparse-sparse_tk30_L11/iteration_0/real.h5ad filter=lfs diff=lfs merge=lfs -text +Report/GRN_CCFM_group_meeting.pptx filter=lfs diff=lfs merge=lfs -text +Report/Nano/Nanomotor_Presentation.pptx filter=lfs diff=lfs merge=lfs -text +Report/Nano/glucose-fueled-gated-nanomotors-enhancing-in-vivo-anticancer-efficacy-via-deep-drug-penetration-into-tumors.pdf filter=lfs diff=lfs merge=lfs -text +Report/PPT/GRN_CCFM_presentation.pdf filter=lfs diff=lfs merge=lfs -text +Report/PPT/GRN_CCFM_presentation.pptx filter=lfs diff=lfs merge=lfs -text +Report/PPT2/GRN_CCFM_presentation.pdf filter=lfs diff=lfs merge=lfs -text +Report/PPT2/GRN_CCFM_presentation.pptx filter=lfs diff=lfs merge=lfs -text +Report/week10/GRN_Progress_Report.pdf filter=lfs diff=lfs merge=lfs -text +Report/week10/GRN_Progress_Report.pptx filter=lfs diff=lfs merge=lfs -text +data/Causal[[:space:]]Schrödinger[[:space:]]Bridges.pdf filter=lfs diff=lfs merge=lfs -text +data/bridge.pdf filter=lfs diff=lfs merge=lfs -text +local_bin/soffice filter=lfs diff=lfs merge=lfs -text +poster/poster/scprompt_poster.pptx filter=lfs diff=lfs merge=lfs -text diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000000000000000000000000000000000000..5852eb26ab62ae9a257cd50531fea1aacbfeb7dd --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,191 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Repository Overview + +Multi-project AI research repository for single-cell biology and video understanding. All project code lives under `transfer/code/`, data under `transfer/data/`, and the shared Python 3.13 venv in `stack_env/`. + +### Primary Projects + +1. **Stack** (`transfer/code/stack/`) — Large-scale encoder-decoder foundation model for single-cell biology (in-context learning on 150M cells). Package: `arc-stack`. +2. **cell-eval** (`transfer/code/cell-eval/`) — Evaluation metrics suite for single-cell perturbation prediction models. Package: `cell-eval`. +3. **FOCUS** (`transfer/code/FOCUS/`) — Training-free keyframe selection for long video understanding using multi-armed bandits (ICLR 2026). + +### Secondary Projects + +4. **scGPT** (`transfer/code/scGPT/`) — Foundation model for single-cell multi-omics. Uses Poetry. +5. **scDFM** (`transfer/code/scDFM/`) — Distributional flow matching for single-cell perturbation prediction (ICLR 2026). Uses Conda. +6. **ori_scDFM** (`transfer/code/ori_scDFM/`) — Original upstream scDFM (cloned from AI4Science-WestlakeU/scDFM). Uses dedicated venv `ori_scDFM_env/` (Python 3.11). +8. **LatentForcing** (`transfer/code/LatentForcing/`) — Image generation with reordered diffusion trajectories (arXiv 2602.11401). +9. **CCFM** (`transfer/code/CCFM/`) — Cascaded Conditioned Flow Matching: hybrid of scDFM + LatentForcing + scGPT for guided perturbation prediction. In development. +10. **adaptive_prompt_selection** (`transfer/code/adaptive_prompt_selection/`) — Bandit-based prompt selection for Stack in-context learning. +11. **prompt_selection** (`transfer/code/prompt_selection/`) — Evaluation framework and baselines for prompt selection experiments. + +## HPC Computing Rules (GENKAI Supercomputer) + +- **NEVER run ML/DL/LLM model inference or training on the login node.** Always submit to compute nodes via `pjsub`. +- Login node (genkai0002) is only for: editing code, lightweight file operations, `pip install`, job submission, checking results. +- Lightweight evaluation scripts (e.g., cell-eval metrics, statistical analysis) are acceptable on the login node. + +### Job Submission (PJM) + +```bash +pjsub script.sh # Batch job +pjsub --interact -L rscgrp=b-inter -L gpu=1 -L elapse=1:00:00 # Interactive GPU (1 GPU, 1h) +pjstat # Check status +pjdel # Cancel job +``` + +See `transfer/gpu_batch.sh` and `transfer/gpu_interactive.sh` for job script templates. + +## Environment & Installation + +Most projects share `stack_env/` (Python 3.13). Always activate before work: + +```bash +source /home/hp250092/ku50001222/qian/aivc/lfj/stack_env/bin/activate +``` + +**ori_scDFM** uses its own dedicated venv `ori_scDFM_env/` (Python 3.11): + +```bash +source /home/hp250092/ku50001222/qian/aivc/lfj/ori_scDFM_env/bin/activate +``` + +### Installing Projects + +```bash +cd transfer/code/stack && pip install -e . # Entry points: stack-train, stack-finetune, stack-embedding, stack-generation +cd transfer/code/cell-eval && pip install -e . # Entry point: cell-eval (subcommands: prep, run, baseline, score) +cd transfer/code/FOCUS && pip install -r requirements.txt +cd transfer/code/scGPT && poetry install +cd transfer/code/LatentForcing && pip install -r requirements.txt +# scDFM uses its own conda env: conda env create -f transfer/code/scDFM/environment.yml +# ori_scDFM uses ori_scDFM_env/ (already installed from environment.yml pip deps) +# CCFM bootstraps from scDFM: cd transfer/code/CCFM && python _bootstrap_scdfm.py +``` + +Note: `uv` is available for fast dependency management (used by cell-eval CI). + +## Common Commands + +### Stack + +```bash +stack-train --config configs/training/bc_large.yaml +stack-finetune --config configs/finetuning/ft_parsecg.yaml +stack-embedding --checkpoint --adata --genelist --output +stack-generation --checkpoint --base-adata --test-adata --genelist --output-dir +``` + +### cell-eval + +```bash +cell-eval run -ap pred.h5ad -ar real.h5ad --num-threads 64 --profile full +cell-eval score --user-input agg_results.csv --base-input base_agg_results.csv +``` + +### FOCUS + +```bash +cd transfer/code/FOCUS +python select_keyframe.py --dataset_name longvideobench --dataset_path --output_dir --num_keyframes 64 +``` + +### scDFM + +```bash +# Uses its own conda env +cd transfer/code/scDFM +python src/script/run.py --data norman --batch_size 48 --model_type origin --d_model 128 +``` + +### LatentForcing + +```bash +cd transfer/code/LatentForcing +torchrun --nproc_per_node=8 main_jit.py # Multi-GPU training +``` + +### Testing & Linting + +```bash +# Stack (from transfer/code/stack/) +pytest tests/ +pytest tests/test_model_core.py -k "test_name" # Single test + +# cell-eval (from transfer/code/cell-eval/) +pytest tests/ +ruff check . # Linting (rules: E, F, ERA; max-line-length=120) +ruff format --check . # Format check (used in CI) +``` + +## Architecture + +### Stack (`transfer/code/stack/src/stack/`) + +Core model uses **Tabular Attention** — alternating cell-wise and gene-wise attention on cell-by-gene matrix chunks: + +- `models/core/base.py` — `StateICLModelBase`: gene reduction -> positional embedding -> N x `TabularAttentionLayer` -> output MLP. Losses: reconstruction + Sliced Wasserstein distance. +- `models/core/` — `StateICLModel` (alias: `scShiftAttentionModel`) wraps the base with masking and loss computation. +- `models/finetune/` — `ICL_FinetunedModel` with frozen-teacher distillation via `LightningFinetunedModel`. +- `modules/attention.py` — `MultiHeadAttention`, `TabularAttentionLayer` (cell-attn + gene-attn per layer). +- `modules/regularizers.py` — `SlicedWassersteinDistance`. +- `training/` — `LightningGeneModel` (PyTorch Lightning wrapper), `DataModule`, scheduler utils. +- `finetune/` — `LightningFinetunedModel` (student-teacher EMA), finetuning `DataModule`. +- `data/` — Dataset configs, HVG computation, H5 data management, sparse matrix loading. +- `cli/` — Entry points: `launch_training`, `launch_finetuning`, `embedding`, `generation`. +- Config: YAML files in `configs/training/` and `configs/finetuning/`. CLI args override config values. + +### cell-eval (`transfer/code/cell-eval/src/cell_eval/`) + +Uses the **registry pattern** for metrics: + +- `_evaluator.py` — `MetricsEvaluator`: takes predicted/real AnnData, runs DE (via `pdex`), computes metrics. +- `metrics/_registry.py` — `MetricRegistry` with `register()` / `compute()`. Metrics are AnnData-based or DE-based. +- `metrics/_impl.py`, `_de.py`, `_anndata.py` — Metric implementations. +- `_pipeline/` — `MetricPipeline` with named profiles (e.g., `full`). +- `_score.py` — Baseline-normalized scoring. +- `_cli/` — Subcommands: `prep`, `run`, `baseline`, `score`. +- `_types/` — Typed containers: `PerturbationAnndataPair`, `DEComparison`. + +### FOCUS (`transfer/code/FOCUS/`) + +Two-file architecture: +- `focus.py` — `FOCUS` class: pure CPE bandit algorithm (no I/O). Coarse exploration -> fine exploitation using Bernstein confidence bounds. +- `select_keyframe.py` — Data pipeline: video loading (decord), BLIP similarity scoring (LAVIS), result output. + +### scDFM (`transfer/code/scDFM/src/`) + +Flow matching for perturbation prediction: `flow_matching/` (algorithm), `models/` (networks), `tokenizer/` (cell/gene tokens), `loss/` (custom losses), `data_process/` (loading). + +### LatentForcing (`transfer/code/LatentForcing/`) + +Diffusion with reordered trajectories. Model variants: `model_jit.py`, `model_cot.py`, `model_repa.py`. Training engine: `engine_jit.py`. Entry: `main_jit.py`. + +### CCFM (`transfer/code/CCFM/`) + +Cascaded flow matching combining scDFM + LatentForcing denoiser + scGPT embeddings. Entry: `scripts/run_cascaded.py`. Config: `config/config_cascaded.py`. Imports scDFM modules via `_scdfm_imports.py` bridge. + +### adaptive_prompt_selection (`transfer/code/adaptive_prompt_selection/`) + +Bandit-based selection of in-context examples for Stack. `adaptive_prompt.py` (orchestrator), `cell_bandit.py` (bandit algorithm). Run via `run_experiment.py`. + +## Dataset Details + +Main dataset (`transfer/data/stack_train/20260203_Parse_10M_PBMC_cytokines.h5ad`): 9.7M cells x 40K genes, 12 donors, 91 cytokines, 18 cell types. Key obs columns: `donor`, `cytokine`, `treatment`, `cell_type`, `sample`. Stack dataset config format: `"human:parse_bio:sample:cell_type:false"`. + +All single-cell projects use **AnnData** (`.h5ad`) as the standard data format. + +## CI/CD + +- **cell-eval**: GitHub Actions CI (`uv sync`, `ruff format --check`, `pytest -v`, CLI smoke test) on push/PR. Python 3.12. +- **Stack**: GitHub Actions publishes to PyPI on release (trusted publishing via setuptools build). +- **scGPT**: Claude Code integration workflow for PR review. + +## GPU Job Notes + +- Stack batch jobs set `PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:256` to avoid CUDA OOM fragmentation. +- Job templates: `transfer/gpu_batch.sh` (batch, 1 GPU, 3h), `transfer/gpu_interactive.sh` (interactive, configurable hours/GPUs). +- Login node and compute nodes share the same filesystem path: `/home/hp250092/ku50001222/qian/aivc/lfj/`. diff --git a/Report/GRN_CCFM_group_meeting.md b/Report/GRN_CCFM_group_meeting.md new file mode 100644 index 0000000000000000000000000000000000000000..a3dfefed98025524c02d5b85771eb4ce76f3ed7e --- /dev/null +++ b/Report/GRN_CCFM_group_meeting.md @@ -0,0 +1,416 @@ +# GRN-Guided Cascaded Flow Matching for Single-Cell Perturbation Prediction + +## 组会汇报 + +--- + +## 1. Task:单细胞扰动预测 + +### 虚拟细胞(Virtual Cell) + +**虚拟细胞**是当前计算生物学的核心愿景:构建一个能在计算机中模拟真实细胞行为的AI模型——给定任意输入条件(基因型、环境、扰动),预测细胞的分子状态变化。单细胞扰动预测是实现虚拟细胞最关键的子任务之一。 + +### 什么是扰动? + +扰动(Perturbation)是指人为改变细胞的某些条件,观察细胞如何响应。常见的扰动类型包括: + +- **药物扰动(Drug perturbation)**:施加小分子化合物或药物,观察细胞的转录组变化(如 L1000/LINCS 数据) +- **细胞因子扰动(Cytokine perturbation)**:用细胞因子(如 IL-6、TNF-α、IFN-γ 等)刺激细胞,研究免疫信号通路响应 +- **基因扰动(Genetic perturbation)**:直接改变基因的功能状态,包括: + - **基因敲除(Knock-out, KO)**:用 CRISPR-Cas9 完全删除目标基因的功能 + - **基因过表达(Overexpression, OE)**:人为提高目标基因的表达量(如 CRISPRa 激活) + - **基因敲低(Knock-down, KD)**:用 RNAi/shRNA 部分降低目标基因的表达(不完全删除) + +本工作聚焦**基因扰动**,使用 Perturb-seq 技术:对细胞施加 CRISPR 基因扰动,然后用单细胞 RNA-seq 测量每个细胞所有基因的表达变化。 + +### 任务形式化 + +``` +已知: x_ctrl ∈ R^G (control 细胞的基因表达谱, G ≈ 5000 高变基因) + p ∈ {gene₁, gene₂} (被扰动的基因) + +预测: x_pert ∈ R^G (扰动后细胞的基因表达谱) +``` + +### 为什么重要? + +- **药物筛选加速**:wet-lab 做一次 Perturb-seq 实验成本极高($$$);如果能计算预测,可以大幅缩小候选范围 +- **组合扰动爆炸**:N 个基因的两两组合 = N(N-1)/2 种实验,不可能穷举,必须靠预测 +- **理解疾病机制**:预测哪些基因被扰动后会产生某种疾病表型 + +### 数据特点 + +- Norman et al. 数据集:~9K 细胞 × 5000 HVG,105 种单/双基因 CRISPR 扰动(KO + OE) +- **细胞配对不可得**:我们无法得到 (x_ctrl_i, x_pert_i) 的逐细胞配对——扰动是破坏性的,一个细胞只能测一次 +- 评估:DE 基因 overlap、方向一致性、MSE、Pearson 相关等 + +--- + +## 2. 现有方法综述与批判 + +### 2.1 简单基线 + +**Additive shift(均值偏移)** + +``` +x̂_pert = x_ctrl + mean(x_pert_train - x_ctrl_train) +``` + +- 假设:扰动效应对所有细胞是**常数平移** +- 问题:完全忽略细胞异质性;同一扰动对不同细胞类型的效应可能截然不同 +- 但**出奇地难以超越**——很多复杂模型在 top DE 基因上并不比它好 + +### 2.2 基于预训练大模型的方法 + +**scGPT** (Nature Methods 2024) + +- 自回归 transformer,在大规模单细胞数据上预训练 +- 扰动预测方式:fine-tune,将扰动基因 token mask 掉,让模型"补全" +- **问题**: + - 本质是**自回归补全**,不是为扰动预测设计的目标函数 + - 编码的是细胞的**绝对状态**,不直接建模状态变化 + - Fine-tuning 过拟合风险高(训练样本少) + +**Geneformer** (Nature 2024) + +- 基于 rank-value encoding 的 transformer 预训练 +- 用 in-silico perturbation:直接删除目标基因 token,看 embedding 变化 +- **问题**: + - in-silico perturbation 是**启发式**的,没有学习扰动的动力学 + - rank encoding 丢失表达量信息 + - 不能处理组合扰动 + +### 2.3 专用扰动预测模型 + +**CPA** (Molecular Systems Biology 2023) + +- Compositional Perturbation Autoencoder:将细胞状态分解为 basal state + perturbation effect + covariate effect +- 用加法假设在 latent space 组合 +- **问题**: + - **线性可加假设**过强:基因调控是非线性的 + - Autoencoder 重建质量限制上限 + - 不建模基因间的调控关系 + +**GEARS** (Nature Biotechnology 2023) + +- 用 Gene Ontology (GO) 图上的 GNN 编码基因关系 +- Cross-attention 融合扰动信息和细胞状态 +- **问题**: + - GO 图是**静态先验知识**,不随细胞状态变化 + - 图结构的选择对结果影响很大(GO vs PPI vs GRN) + - 仍然是确定性预测,不能给出分布 + +**STATE** (ICLR 2025) + +- Stacked Attention for Expression Transformation +- **问题**: + - 确定性预测 + - 仍然没有从 GRN 变化角度建模 + +**CellFlow** (preprint 2025) + +- 也是 flow matching 框架 +- 用预训练 embedding 作为条件 +- **问题**: + - 预训练 embedding 仍然编码绝对状态 + - 没有显式建模扰动对调控网络的改变 + +**scDFM** (ICLR 2026) + +- 将 **Conditional Flow Matching** 引入扰动预测 +- 学习从噪声到 target 表达的速度场,条件为 control 表达 + 扰动 ID +- DiffPerceiverBlock:差分注意力 + cross-attention +- **优点**:生成式模型,能给出分布;flow matching 训练稳定 +- **问题**: + - **信息来源单一**:只有 control 的数值表达 + 扰动基因的 embedding + - **不理解基因调控关系**:模型需要从数据中隐式学习 GRN,而训练数据极少 + - d_model=128,表达能力有限 + +### 2.4 共性问题总结 + +``` +所有现有方法的共同盲区: + + 扰动 → [黑箱模型] → 表达变化 + +没有任何一个方法显式地建模: + + 扰动 → 基因调控网络变化 → 表达变化 + ↑ + 这一步被跳过了 +``` + +--- + +## 3. 我们的 Motivation + +### 3.1 Motivation 1:流匹配解决细胞配对问题 + +单细胞扰动预测的根本困难:**没有 paired data**。 + +我们无法得到 (x_ctrl_i, x_pert_i) 这样的配对——一个细胞扰动后就变了,不能回到扰动前状态。 + +传统方法的处理:群体均值匹配(丢失异质性)或 autoencoder(受限于重建质量)。 + +**Flow Matching 的优势**:它学习的是从 source 分布到 target 分布的**概率传输映射**,天然适合 unpaired 数据: + +``` +p(x_ctrl) ──(学习 ODE 路径)──→ p(x_pert | perturbation) +``` + +- 不需要逐细胞配对,只需要两组细胞的**群体分布** +- 通过 Conditional Optimal Transport 构造训练对,比随机配对效率高 +- 生成式输出:每个 control 细胞可以采样多个 prediction,给出**不确定性估计** + +### 3.2 Motivation 2:从 GRN 变化角度理解扰动 + +**关键生物学事实**:基因扰动不是简单地改变一个基因的值。 + +``` +CRISPR knock-out 基因 A + ↓ +基因 A 的表达降为 0 + ↓ +A 直接调控的基因 B, C, D 表达改变(一级效应) + ↓ +B 调控的 E, F,C 调控的 G, H ... 依次改变(级联效应) + ↓ +最终数千个基因的表达都发生变化 +``` + +这个级联传播的路径,就是 **基因调控网络 (GRN)**。 + +**核心洞察**:如果我们能先理解扰动如何改变了 GRN,再基于改变后的 GRN 预测表达,预测会更准确。 + +``` +现有方法: 扰动 ───────────────────────→ 表达变化 + (端到端黑箱) + +我们: 扰动 → GRN 变化 (Δ_attn) → 表达变化 + ↑ 显式建模 ↑ 有据可依 +``` + +### 3.3 Motivation 3:scGPT 的 Attention ≈ 数据驱动的 GRN + +预训练的 scGPT 模型在大规模单细胞数据上学到了基因间的调控关系,这些关系被编码在 transformer 的 **attention matrix** 中: + +``` +attn[i][j] 高 → 基因 j 的状态对基因 i 的表达有强影响 +``` + +这等价于一个**数据驱动的、上下文相关的 GRN**——它随细胞状态而变化,比静态 GO 图更灵活。 + +我们可以用**同一模型**,分别输入 control 和 perturbation 的表达,得到两个 attention matrix,它们的差直接反映**扰动引起的 GRN 变化**。 + +--- + +## 4. 我们的方法 + +### 4.1 总体思路 + +在 scDFM 的 flow matching 框架上,引入 **GRN-aware latent flow**: + +``` +Cascaded Flow Matching: + ┌─────────────────────────────────┐ ┌──────────────────────────────┐ + │ GRN Latent Flow │ │ Expression Flow │ + │ │ │ │ + │ noise → GRN 变化特征 │ │ noise → 基因表达 │ + │ (理解调控网络如何改变) │ │ (基于 GRN 变化预测表达) │ + │ │ │ │ + │ 推理: 先完成 │ → │ 推理: 后完成 │ + └─────────────────────────────────┘ └──────────────────────────────┘ + Stage 1 Stage 2 +``` + +**直觉**:模型先"想清楚"扰动改变了哪些基因调控关系,再基于这些理解去预测表达变化。 + +### 4.2 GRN 特征:Attention-Delta + +``` +Δ_attn = Attention(perturbed cell) - Attention(control cell) + +GRN features = Δ_attn @ gene_embeddings +``` + +- `Δ_attn` 捕捉扰动引起的调控关系变化 +- `@ gene_embeddings` 将稀疏的调控变化信号聚合到每个基因的连续特征空间 +- 输出:每个基因一个 512 维向量,编码"这个基因上游的调控关系发生了怎样的变化" + +### 4.3 模型架构 + +``` + 条件信息 (推理时可用) 辅助生成目标 (推理时从噪声生成) +┌──────────────────────────┐ ┌───────────────────────────────┐ +│ control 表达 x_ctrl │ │ GRN 变化特征 z (512-d/gene) │ +│ 扰动基因 ID pert_id │ │ = Δ_attn @ gene_emb │ +│ 时间步 t₁, t₂ │ │ 来自 frozen scGPT │ +└──────────────────────────┘ └───────────────────────────────┘ + ↓ ↓ + ┌─── Expression Stream ───┐ ┌─── Latent Stream ───┐ + │ GeneEncoder + ValueEnc │ │ LatentEmbedder │ + │ → expr_tokens (B,G,d) │ │ → lat_tokens(B,G,d)│ + └─────────────┬───────────┘ └──────────┬──────────┘ + └───────── (+) ─────────────┘ + ↓ + x = expr + latent (加法融合) + ↓ + ┌─── Conditioning ───┐ + │ c = t₁ + t₂ + pert │ + └────────┬──────────┘ + ↓ + ┌─── Shared Backbone ──┐ + │ DiffPerceiverBlock │ × 4 layers + │ (with GeneadaLN) │ + └────────┬────────────┘ + ┌────┴────┐ + ┌────┴───┐ ┌──┴────────┐ + │ExprHead │ │LatentHead │ + │→ v_expr │ │→ v_latent │ + │ (B,G) │ │(B,G,512) │ + └─────────┘ └───────────┘ +``` + +### 4.4 Cascaded 训练 + +训练时不同时优化两个 flow,而是**概率切换**: + +``` +随机 coin flip: + 40% → 训练 Latent Flow: t₂ 随机, t₁ = 0, 只算 loss_latent + 60% → 训练 Expression Flow: t₁ 随机, t₂ ≈ 1, 只算 loss_expr +``` + +### 4.5 Cascaded 推理(核心) + +``` +Stage 1: z_noise ═══(ODE)═══> z_clean (GRN latent: 0→1) + 此时 expression 静止 (t₁=0) + +Stage 2: x_noise ═══(ODE)═══> x_pred (Expression: 0→1) + 此时 GRN latent 已完成 (t₂=1) +``` + +**生物学直觉**:先理解调控网络如何变化,再基于变化后的调控网络预测表达。 + +### 4.6 架构图绘制 Prompt (Nano Banana) + +> **Prompt for architecture diagram:** +> +> Create a clean, professional scientific figure illustrating the "GRN-Guided Cascaded Flow Matching" architecture for single-cell perturbation prediction. Use a horizontal layout, left-to-right flow, with a soft blue-white color scheme. +> +> **Left panel — "GRN Feature Extraction" (frozen, no gradient):** +> Show a frozen scGPT transformer icon (with a snowflake symbol). Two inputs feed into it: "control expression x_ctrl" (blue arrow) and "perturbed expression x_pert" (red arrow). Each produces an attention matrix (shown as a small heatmap grid). Between the two heatmaps, show a minus sign, producing "Δ_attn" (a difference heatmap). Then show Δ_attn multiplied by "Gene Embeddings" (a matrix icon), producing "GRN change features z" as a (G × 512) colored matrix strip. Label this output with dimension annotations (B, G, 512). Add a dashed box around the entire left panel labeled "Frozen scGPT — GRN Change Extraction". +> +> **Center panel — "Cascaded Flow Model" (trainable):** +> Show two parallel input streams at the top: +> (1) "Expression Stream": x_t (noised target expression) + x_ctrl (control) → two small encoder blocks → fusion → "expr_tokens" +> (2) "Latent Stream": z_t (noised GRN features) → LatentEmbedder → "latent_tokens" +> Show these two streams merging with a "+" symbol into combined tokens. +> Below, show a conditioning vector "c = t_expr + t_latent + pert_emb" feeding into a vertical stack of 4 shared backbone blocks (labeled "DiffPerceiverBlock × 4"). +> At the bottom, the backbone splits into two decoder heads: "Expression Head → v_expr (B, G)" on the left, and "Latent Head → v_latent (B, G, 512)" on the right. +> +> **Right panel — "Cascaded Inference":** +> Show a two-stage timeline diagram: +> Stage 1 (top): "GRN Latent Flow" — an ODE trajectory from z_noise (random dots) to z_clean (structured pattern), with t_latent going from 0 to 1. Label: "First: understand how GRN changes". +> Stage 2 (bottom): "Expression Flow" — an ODE trajectory from x_noise to x_pred (a gene expression barplot), with t_expr going from 0 to 1. Label: "Then: predict expression changes". Show a downward arrow from Stage 1 to Stage 2 indicating "z_clean conditions Stage 2". +> +> **Bottom banner:** A biological intuition strip showing: "Perturbation → GRN rewiring (Δ attention) → Gene expression change", with small icons (a gene network graph changing, then expression bars changing). +> +> Style: Nature/Cell journal style, vector graphics, minimal clutter, no 3D effects, consistent font sizes, use color coding (blue for expression path, orange/gold for latent/GRN path, gray for frozen components). + +--- + +## 5. 当前问题与解决方向 + +### 5.1 问题:GRN 信号提取困难——噪声淹没真信号 + +scGPT 的 attention matrix 是一个 (G × G) 的**稠密矩阵**——每对基因之间都有非零 attention 值。 + +但真实的基因调控网络是**极度稀疏的**:一个基因通常只直接调控几十个下游基因,而不是几千个。 + +``` +Attention matrix: 5000 × 5000 = 25,000,000 个非零值 +真实 GRN: 每个基因平均 ~20-50 个调控靶标 + +→ 99%+ 的 attention 值是噪声,不是真正的调控关系 +``` + +这意味着 `Δ_attn @ gene_emb` 里绝大部分信号是噪声的变化,真正的 GRN 变化信号被淹没。 + +**当前观察佐证**:latent loss ≈ 1.12,远高于 expression loss ≈ 0.019,说明模型难以预测 latent 速度场——因为目标本身就充满噪声。 + +**解决方向——稀疏化 top-K**: + +``` +原始: Δ_attn (G × G) 全部 25M 值 → 噪声多,信号弱 + ↓ 稀疏化 +Top-K: 每个基因只保留 |Δ| 最大的 K=30 个 → 过滤 99.4% 噪声 + ↓ +features = sparse_Δ_topk @ gene_emb +``` + +已实现并在实验中(`sparse_topk_emb` 模式)。 + +### 5.2 问题:512 维 latent 预测难度过大 + +每个基因的 GRN 特征是 512 维向量,整个 latent target 是 (G, 512) = 250 万维的速度场——模型需要在每个时间步预测这么大的向量。 + +**消融实验证实**:将 latent 维度从 512 降到 1,latent loss 从 ~1.1 降到 ~0.5-0.7——维度是难度的重要来源。 + +**解决方向——PCA 降维**: + +``` +512-d gene_emb → PCA 投影到 64 维 +features = sparse_Δ_topk @ pca_basis → (B, G, 64) +``` + +用 PCA 找到 attention delta 信号的主要变化方向,将 512 维压缩到 64 维,去掉冗余维度。scgpt_dim=64,bottleneck_dim=64。 + +已实现并在实验中(`sparse_pca` 模式)。 + +--- + +## 6. 总结与展望 + +### 6.1 核心贡献 + +我们的工作**不是在模型架构上做改进**,而是**从生物学机制出发**重新建模扰动预测任务: + +``` +现有方法: perturbation → [model] → expression change + ↑ + 纯数据驱动黑箱 + +我们: perturbation → GRN rewiring → expression change + ↑ + 显式建模生物学机制 +``` + +用 Cascaded Flow Matching 的两阶段结构来实现"先理解调控变化,再预测表达变化"。 + +### 6.2 后续关键实验:验证因果假设 + +目前的 cascaded 推理是**固定顺序**的:先 latent(GRN),后 expression。 + +这是否真的重要?我们计划做一个关键实验来验证: + +**实验设计**:训练时 t₁ 和 t₂ 完全随机采样(不再 cascade),模型支持**任意顺序推理**。然后对比: + +| 推理方式 | 含义 | 预期 | +|---------|------|------| +| 先 GRN latent → 后 expression | 先理解调控变化,再预测表达 | **最优** | +| 先 expression → 后 GRN latent | 先预测表达,再理解调控 | 次优 | +| 同时 random | 无显式顺序 | 最差 | + +如果"先 GRN 后 expression"显著优于其他顺序,就验证了: + +> **理解基因调控网络的变化,是预测扰动表达变化的前提条件,而不是副产物。** + +这就是我们这个工作要回答的核心科学问题。 + +--- + +### 一句话总结 + +> 我们用 scGPT 的 attention delta 显式提取扰动引起的基因调控网络变化,通过 cascaded flow matching 强制模型"先理解 GRN 如何改变,再预测表达如何变化",从而将生物学先验——扰动通过 GRN 级联传播——融入生成式模型的推理过程。 \ No newline at end of file diff --git a/Report/GRN_CCFM_group_meeting.pptx b/Report/GRN_CCFM_group_meeting.pptx new file mode 100644 index 0000000000000000000000000000000000000000..a7a2da173d3f878128b5dce729d6325828222ad0 --- /dev/null +++ b/Report/GRN_CCFM_group_meeting.pptx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96c5298cbc5a080fcd9619a795f851bc908988d0af0b4de7130ad0aa2f71c80c +size 304227 diff --git a/Report/Nano/.claude/settings.local.json b/Report/Nano/.claude/settings.local.json new file mode 100644 index 0000000000000000000000000000000000000000..d6237ba47b8f57462f96e44ec5c77d9246f52692 --- /dev/null +++ b/Report/Nano/.claude/settings.local.json @@ -0,0 +1,7 @@ +{ + "permissions": { + "allow": [ + "Bash(npm list:*)" + ] + } +} diff --git a/Report/Nano/Nanomotor_Presentation.pptx b/Report/Nano/Nanomotor_Presentation.pptx new file mode 100644 index 0000000000000000000000000000000000000000..23aba5b01516d9dad6d83ac7d546d1e01503569a --- /dev/null +++ b/Report/Nano/Nanomotor_Presentation.pptx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0076d5bf4be0040027beb2b575e8ce2a137387a4cd75200b46df65ad8be79b86 +size 260965 diff --git a/Report/Nano/glucose-fueled-gated-nanomotors-enhancing-in-vivo-anticancer-efficacy-via-deep-drug-penetration-into-tumors.pdf b/Report/Nano/glucose-fueled-gated-nanomotors-enhancing-in-vivo-anticancer-efficacy-via-deep-drug-penetration-into-tumors.pdf new file mode 100644 index 0000000000000000000000000000000000000000..40f60d8a16641635bb95f95b2952243541ecf377 --- /dev/null +++ b/Report/Nano/glucose-fueled-gated-nanomotors-enhancing-in-vivo-anticancer-efficacy-via-deep-drug-penetration-into-tumors.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5dd6f6dd36fb853ba8f62accf2c08e1d1a3dbb9f6c69d01919c262e3c06f563f +size 5089152 diff --git a/Report/PPT/GRN_CCFM_presentation.pdf b/Report/PPT/GRN_CCFM_presentation.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5f20c83d703bd8b9928736b8bfef6c57207b236c --- /dev/null +++ b/Report/PPT/GRN_CCFM_presentation.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:853c91d2b5685cc60ae9b2ae249a66b6ce789bfece3fe7d6bc4df1cf3fd6fc62 +size 469947 diff --git a/Report/PPT/GRN_CCFM_presentation.pptx b/Report/PPT/GRN_CCFM_presentation.pptx new file mode 100644 index 0000000000000000000000000000000000000000..1149e12579557cb362df7b4c721ab734f56b02d1 --- /dev/null +++ b/Report/PPT/GRN_CCFM_presentation.pptx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbbf29a0bf16d5a014e4f58bc7ce9f6609af8fd608b43bdd4b939633ed407cba +size 317866 diff --git a/Report/PPT/create_ppt.js b/Report/PPT/create_ppt.js new file mode 100644 index 0000000000000000000000000000000000000000..3850ab97bc089b9bd1940da558fa131dc1f5c11f --- /dev/null +++ b/Report/PPT/create_ppt.js @@ -0,0 +1,854 @@ +const pptxgen = require("pptxgenjs"); + +const pres = new pptxgen(); +pres.layout = "LAYOUT_16x9"; +pres.author = "Qian"; +pres.title = "GRN-Guided Cascaded Flow Matching for Single-Cell Perturbation Prediction"; + +// === COLOR PALETTE: Deep Teal + Amber (biology meets computation) === +const C = { + dark: "0F172A", + light: "F8FAFC", + teal: "0891B2", + tealDk: "164E63", + tealLt: "ECFEFF", + white: "FFFFFF", + text: "1E293B", + textS: "475569", + textM: "94A3B8", + red: "EF4444", + green: "10B981", + amber: "F59E0B", + purple: "8B5CF6", + blue: "3B82F6", + border: "E2E8F0", +}; + +const shadow = () => ({ type: "outer", color: "000000", blur: 6, offset: 2, angle: 135, opacity: 0.1 }); + +// Slide number helper (bottom-right) +let slideNum = 0; +function addSlideNum(sl, dark) { + slideNum++; + sl.addText(String(slideNum), { + x: 9.2, y: 5.15, w: 0.5, h: 0.3, + fontSize: 10, fontFace: "Calibri", color: dark ? C.textM : C.textS, align: "right", margin: 0, + }); +} + +function card(sl, x, y, w, h, opts = {}) { + sl.addShape(pres.shapes.RECTANGLE, { + x, y, w, h, fill: { color: opts.fill || C.white }, shadow: shadow(), + }); + if (opts.accent) { + sl.addShape(pres.shapes.RECTANGLE, { x, y, w: 0.06, h, fill: { color: opts.accent } }); + } +} + +function titleBar(sl, title) { + sl.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.9, fill: { color: C.tealDk } }); + sl.addText(title, { + x: 0.6, y: 0.15, w: 8.8, h: 0.6, + fontSize: 24, fontFace: "Georgia", color: C.white, bold: true, margin: 0, + }); +} + +// ============================ +// SLIDE 1: TITLE +// ============================ +let s = pres.addSlide(); +s.background = { color: C.dark }; +// Left teal block as visual motif +s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.15, h: 5.625, fill: { color: C.teal } }); + +s.addText("GRN-Guided Cascaded\nFlow Matching", { + x: 0.8, y: 1.1, w: 8.4, h: 1.8, + fontSize: 42, fontFace: "Georgia", color: C.white, bold: true, lineSpacingMultiple: 1.15, +}); +s.addText("for Single-Cell Perturbation Prediction", { + x: 0.8, y: 2.95, w: 8.4, h: 0.5, + fontSize: 20, fontFace: "Calibri", color: "22D3EE", +}); +s.addText("组会汇报", { + x: 0.8, y: 4.2, w: 3, h: 0.4, + fontSize: 14, fontFace: "Calibri", color: C.textM, +}); +addSlideNum(s, true); + +// ============================ +// SLIDE 2: TASK +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "Task:单细胞扰动预测"); + +// Virtual Cell card +card(s, 0.5, 1.15, 4.3, 2.1, { accent: C.teal }); +s.addText("虚拟细胞 (Virtual Cell)", { + x: 0.75, y: 1.25, w: 3.8, h: 0.4, + fontSize: 16, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText("构建能模拟真实细胞行为的 AI 模型:给定任意输入条件(基因型、环境、扰动),预测细胞的分子状态变化。单细胞扰动预测是实现虚拟细胞最关键的子任务。", { + x: 0.75, y: 1.7, w: 3.85, h: 1.4, + fontSize: 12.5, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.35, +}); + +// Perturbation types card +card(s, 5.2, 1.15, 4.3, 2.1, { accent: C.amber }); +s.addText("扰动类型", { + x: 5.45, y: 1.25, w: 3.8, h: 0.4, + fontSize: 16, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText([ + { text: "药物扰动", options: { bold: true, breakLine: true, fontSize: 12 } }, + { text: " 小分子化合物 → 转录组变化", options: { breakLine: true, fontSize: 11, color: C.textS } }, + { text: "细胞因子扰动", options: { bold: true, breakLine: true, fontSize: 12 } }, + { text: " IL-6, TNF-α 等 → 信号通路响应", options: { breakLine: true, fontSize: 11, color: C.textS } }, + { text: "基因扰动(本工作聚焦)", options: { bold: true, breakLine: true, fontSize: 12, color: C.teal } }, + { text: " CRISPR KO / OE / KD → 全基因组变化", options: { fontSize: 11, color: C.textS } }, +], { x: 5.45, y: 1.7, w: 3.85, h: 1.5, margin: 0, lineSpacingMultiple: 1.2 }); + +// Task formalization +card(s, 0.5, 3.5, 9.0, 1.6, { accent: C.purple }); +s.addText("任务形式化", { + x: 0.75, y: 3.6, w: 2, h: 0.35, + fontSize: 14, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText([ + { text: "已知: ", options: { bold: true, fontSize: 13 } }, + { text: "x_ctrl (control 基因表达, G ~ 5000 HVG) + p (扰动基因)", options: { fontSize: 13, breakLine: true } }, + { text: "预测: ", options: { bold: true, fontSize: 13 } }, + { text: "x_pert (扰动后基因表达谱)", options: { fontSize: 13 } }, +], { x: 0.75, y: 4.0, w: 8.5, h: 0.9, fontFace: "Consolas", color: C.text, margin: 0, lineSpacingMultiple: 1.5 }); +addSlideNum(s); + +// ============================ +// SLIDE 3: WHY IMPORTANT + DATA +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "为什么重要 & 数据特点"); + +// Three importance cards +const imp = [ + { icon: "$$$", title: "药物筛选加速", desc: "Perturb-seq 成本极高\n计算预测大幅缩小候选范围", c: C.teal }, + { icon: "N\u00B2", title: "组合扰动爆炸", desc: "N 基因两两组合 = N(N-1)/2\n不可能穷举,必须靠预测", c: C.amber }, + { icon: "\u2697", title: "理解疾病机制", desc: "预测哪些基因扰动\n产生特定疾病表型", c: C.purple }, +]; +imp.forEach((it, i) => { + const x = 0.5 + i * 3.1; + card(s, x, 1.15, 2.8, 2.0, { accent: it.c }); + s.addText(it.icon, { + x: x + 0.2, y: 1.25, w: 2.4, h: 0.55, + fontSize: 28, fontFace: "Georgia", color: it.c, bold: true, margin: 0, + }); + s.addText(it.title, { + x: x + 0.2, y: 1.8, w: 2.4, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, + }); + s.addText(it.desc, { + x: x + 0.2, y: 2.15, w: 2.4, h: 0.85, + fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, lineSpacingMultiple: 1.3, + }); +}); + +// Data card +card(s, 0.5, 3.5, 9.0, 1.65, { accent: C.tealDk }); +s.addText("Norman 数据集", { + x: 0.75, y: 3.6, w: 3, h: 0.35, + fontSize: 16, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +const stats = [ + { val: "~9K", label: "细胞数" }, + { val: "5000", label: "高变基因" }, + { val: "105", label: "扰动条件" }, + { val: "KO+OE", label: "扰动类型" }, +]; +stats.forEach((st, i) => { + const x = 0.75 + i * 2.15; + s.addText(st.val, { + x, y: 4.05, w: 1.9, h: 0.5, + fontSize: 26, fontFace: "Georgia", color: C.teal, bold: true, margin: 0, + }); + s.addText(st.label, { + x, y: 4.5, w: 1.9, h: 0.25, + fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, + }); +}); +s.addText("关键挑战:细胞配对不可得 — 扰动是破坏性的,一个细胞只能测一次", { + x: 0.75, y: 4.85, w: 8.5, h: 0.2, + fontSize: 11, fontFace: "Calibri", color: C.red, italic: true, margin: 0, +}); + +// ============================ +addSlideNum(s); +// SLIDE 4: EXISTING METHODS (1) +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "现有方法:简单基线与预训练大模型"); + +// Additive Shift +card(s, 0.5, 1.15, 4.3, 1.85, { accent: C.textM }); +s.addText("Additive Shift(均值偏移)", { + x: 0.75, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText("x\u0302_pert = x_ctrl + mean(x_pert - x_ctrl)", { + x: 0.75, y: 1.6, w: 3.8, h: 0.25, + fontSize: 11, fontFace: "Consolas", color: C.tealDk, margin: 0, +}); +s.addText([ + { text: "假设扰动效应对所有细胞是常数平移", options: { breakLine: true } }, + { text: "忽略细胞异质性", options: { breakLine: true } }, + { text: "但出奇地难以超越", options: { color: C.red, bold: true } }, +], { x: 0.75, y: 1.95, w: 3.8, h: 0.85, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// scGPT +card(s, 5.2, 1.15, 4.3, 1.85, { accent: C.blue }); +s.addText("scGPT (Nature Methods 2024)", { + x: 5.45, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "自回归 Transformer 大规模预训练", options: { breakLine: true } }, + { text: "扰动基因 mask → 模型补全", options: { breakLine: true } }, + { text: "本质是自回归补全,非扰动预测目标", options: { breakLine: true, color: C.red } }, + { text: "编码绝对状态,不建模状态变化", options: { color: C.red } }, +], { x: 5.45, y: 1.7, w: 3.8, h: 1.1, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// Geneformer +card(s, 0.5, 3.25, 4.3, 1.85, { accent: C.green }); +s.addText("Geneformer (Nature 2024)", { + x: 0.75, y: 3.35, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "Rank-value encoding + Transformer", options: { breakLine: true } }, + { text: "In-silico perturbation: 删除基因 token", options: { breakLine: true } }, + { text: "启发式方法,没学习扰动动力学", options: { breakLine: true, color: C.red } }, + { text: "Rank encoding 丢失表达量信息", options: { color: C.red } }, +], { x: 0.75, y: 3.7, w: 3.8, h: 1.1, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// CPA +card(s, 5.2, 3.25, 4.3, 1.85, { accent: C.amber }); +s.addText("CPA (Mol Sys Bio 2023)", { + x: 5.45, y: 3.35, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "Basal + perturbation + covariate 可加分解", options: { breakLine: true } }, + { text: "Latent space 线性组合", options: { breakLine: true } }, + { text: "线性可加假设过强", options: { breakLine: true, color: C.red } }, + { text: "不建模基因间调控关系", options: { color: C.red } }, +], { x: 5.45, y: 3.7, w: 3.8, h: 1.1, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// ============================ +addSlideNum(s); +// SLIDE 5: EXISTING METHODS (2) +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "现有方法:专用扰动预测模型"); + +// GEARS +card(s, 0.5, 1.15, 4.3, 1.7, { accent: C.purple }); +s.addText("GEARS (Nat Biotech 2023)", { + x: 0.75, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "GO 图 + GNN 编码基因关系", options: { breakLine: true } }, + { text: "GO 是静态先验,不随细胞状态变", options: { breakLine: true, color: C.red } }, + { text: "确定性预测,不能给出分布", options: { color: C.red } }, +], { x: 0.75, y: 1.65, w: 3.8, h: 0.95, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// STATE +card(s, 5.2, 1.15, 4.3, 1.7, { accent: C.teal }); +s.addText("STATE (ICLR 2025)", { + x: 5.45, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "Stacked Attention for Expression Transform", options: { breakLine: true } }, + { text: "确定性预测", options: { breakLine: true, color: C.red } }, + { text: "没有从 GRN 变化角度建模", options: { color: C.red } }, +], { x: 5.45, y: 1.65, w: 3.8, h: 0.95, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// CellFlow +card(s, 0.5, 3.1, 4.3, 1.7, { accent: C.blue }); +s.addText("CellFlow (preprint 2025)", { + x: 0.75, y: 3.2, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "Flow matching + 预训练 embedding 条件", options: { breakLine: true } }, + { text: "预训练 embedding 编码绝对状态", options: { breakLine: true, color: C.red } }, + { text: "没有显式建模调控网络改变", options: { color: C.red } }, +], { x: 0.75, y: 3.6, w: 3.8, h: 0.95, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// scDFM +card(s, 5.2, 3.1, 4.3, 1.7, { accent: C.teal }); +s.addText("scDFM (ICLR 2026)", { + x: 5.45, y: 3.2, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "Conditional FM + DiffPerceiverBlock", options: { breakLine: true } }, + { text: "生成式模型,训练稳定", options: { breakLine: true, color: C.green } }, + { text: "信息来源单一,不理解 GRN", options: { breakLine: true, color: C.red } }, + { text: "d_model=128,表达能力有限", options: { color: C.red } }, +], { x: 5.45, y: 3.6, w: 3.8, h: 1.0, fontSize: 11, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// ============================ +addSlideNum(s); +// SLIDE 6: BLIND SPOT (section divider) +// ============================ +s = pres.addSlide(); +s.background = { color: C.tealDk }; + +s.addText("所有现有方法的共同盲区", { + x: 0.8, y: 0.6, w: 8.4, h: 0.7, + fontSize: 30, fontFace: "Georgia", color: C.white, bold: true, margin: 0, +}); + +// Current: black box +card(s, 0.8, 1.6, 8.4, 1.4, { fill: "1B4A5A" }); +s.addText("现有方法", { + x: 1.0, y: 1.65, w: 2, h: 0.3, + fontSize: 12, fontFace: "Calibri", color: "CBD5E1", margin: 0, +}); +s.addText([ + { text: "扰动", options: { bold: true, fontSize: 20 } }, + { text: " \u2192 ", options: { fontSize: 20, color: C.textM } }, + { text: "[ \u9ED1\u7BB1\u6A21\u578B ]", options: { bold: true, fontSize: 20, color: C.red } }, + { text: " \u2192 ", options: { fontSize: 20, color: C.textM } }, + { text: "表达变化", options: { bold: true, fontSize: 20 } }, +], { x: 1.0, y: 2.05, w: 8.0, h: 0.7, fontFace: "Calibri", color: C.white, align: "center", margin: 0 }); + +// Ours: explicit GRN +card(s, 0.8, 3.3, 8.4, 1.6, { fill: "0C3547" }); +s.addText("我们的方法", { + x: 1.0, y: 3.35, w: 2, h: 0.3, + fontSize: 12, fontFace: "Calibri", color: "22D3EE", margin: 0, +}); +s.addText([ + { text: "扰动", options: { bold: true, fontSize: 20 } }, + { text: " \u2192 ", options: { fontSize: 20, color: C.textM } }, + { text: "GRN 变化", options: { bold: true, fontSize: 20, color: C.teal } }, + { text: " \u2192 ", options: { fontSize: 20, color: C.textM } }, + { text: "表达变化", options: { bold: true, fontSize: 20 } }, +], { x: 1.0, y: 3.75, w: 8.0, h: 0.7, fontFace: "Calibri", color: C.white, align: "center", margin: 0 }); +s.addText("\u2191 显式建模生物学机制", { + x: 3.0, y: 4.4, w: 4, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: "22D3EE", align: "center", margin: 0, +}); + +// ============================ +addSlideNum(s, true); +// SLIDE 7: MOTIVATION 1 - FLOW MATCHING +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "Motivation 1:Flow Matching 解决配对问题"); + +// Problem +card(s, 0.5, 1.15, 4.3, 2.0, { accent: C.red }); +s.addText("核心困难:无 Paired Data", { + x: 0.75, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "一个细胞扰动后就变了,无法回到扰动前", options: { breakLine: true } }, + { text: "无法得到 (x_ctrl_i, x_pert_i) 逐细胞配对", options: { breakLine: true } }, + { text: "传统方法:群体均值匹配(丢失异质性)", options: { breakLine: true } }, + { text: "或 Autoencoder(受限于重建质量)", options: {} }, +], { x: 0.75, y: 1.65, w: 3.8, h: 1.3, fontSize: 12, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// Solution +card(s, 5.2, 1.15, 4.3, 2.0, { accent: C.green }); +s.addText("Flow Matching 的优势", { + x: 5.45, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "学习分布间的概率传输映射", options: { breakLine: true } }, + { text: "不需逐细胞配对,只需群体分布", options: { breakLine: true } }, + { text: "Conditional OT 构造高效训练对", options: { breakLine: true } }, + { text: "生成式输出 \u2192 不确定性估计", options: {} }, +], { x: 5.45, y: 1.65, w: 3.8, h: 1.3, fontSize: 12, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// Flow diagram +card(s, 0.5, 3.5, 9.0, 1.6); +s.addText("p(x_ctrl)", { + x: 0.8, y: 3.8, w: 2.2, h: 0.6, + fontSize: 18, fontFace: "Consolas", color: C.tealDk, bold: true, align: "center", margin: 0, +}); +s.addShape(pres.shapes.RECTANGLE, { + x: 3.2, y: 4.0, w: 3.6, h: 0.28, fill: { color: C.teal, transparency: 30 }, +}); +s.addText("\u2500\u2500 \u5B66\u4E60 ODE \u8DEF\u5F84 \u2500\u2500\u25B6", { + x: 3.2, y: 3.95, w: 3.6, h: 0.35, + fontSize: 13, fontFace: "Calibri", color: C.white, align: "center", margin: 0, +}); +s.addText("p(x_pert | pert)", { + x: 7.0, y: 3.8, w: 2.5, h: 0.6, + fontSize: 18, fontFace: "Consolas", color: C.tealDk, bold: true, align: "center", margin: 0, +}); +s.addText("天然适合 unpaired data \u2014 只需两组细胞的群体分布即可训练", { + x: 0.8, y: 4.55, w: 8.4, h: 0.35, + fontSize: 12, fontFace: "Calibri", color: C.teal, italic: true, margin: 0, align: "center", +}); + +// ============================ +addSlideNum(s); +// SLIDE 8: MOTIVATION 2&3 - GRN + ATTENTION +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "Motivation 2 & 3:GRN + scGPT Attention"); + +// Left: GRN cascade +card(s, 0.5, 1.15, 4.3, 4.0, { accent: C.amber }); +s.addText("扰动通过 GRN 级联传播", { + x: 0.75, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "CRISPR KO 基因 A", options: { bold: true, breakLine: true, fontSize: 12, color: C.tealDk } }, + { text: " \u2193", options: { breakLine: true, fontSize: 11, color: C.textM } }, + { text: "A 的表达降为 0", options: { breakLine: true, fontSize: 12 } }, + { text: " \u2193", options: { breakLine: true, fontSize: 11, color: C.textM } }, + { text: "一级效应:A \u2192 B, C, D 改变", options: { bold: true, breakLine: true, fontSize: 12 } }, + { text: " \u2193", options: { breakLine: true, fontSize: 11, color: C.textM } }, + { text: "级联效应:B\u2192E,F C\u2192G,H ...", options: { bold: true, breakLine: true, fontSize: 12 } }, + { text: " \u2193", options: { breakLine: true, fontSize: 11, color: C.textM } }, + { text: "最终数千个基因表达变化", options: { bold: true, fontSize: 12, color: C.red } }, +], { x: 0.75, y: 1.7, w: 3.8, h: 2.8, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.15 }); +s.addText("核心:先理解 GRN 变化 \u2192 再预测表达", { + x: 0.75, y: 4.55, w: 3.8, h: 0.35, + fontSize: 12, fontFace: "Calibri", color: C.teal, bold: true, italic: true, margin: 0, +}); + +// Right: scGPT Attention +card(s, 5.2, 1.15, 4.3, 4.0, { accent: C.teal }); +s.addText("scGPT Attention \u2248 数据驱动 GRN", { + x: 5.45, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText("attn[i][j] 高 \u2192 基因 j 对基因 i 有强调控", { + x: 5.45, y: 1.7, w: 3.8, h: 0.3, + fontSize: 11, fontFace: "Consolas", color: C.tealDk, margin: 0, +}); +s.addText([ + { text: "上下文相关的 GRN", options: { bold: true, breakLine: true, fontSize: 12 } }, + { text: "随细胞状态变化,比静态 GO 图更灵活", options: { breakLine: true, fontSize: 11, color: C.textS } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "提取扰动引起的 GRN 变化", options: { bold: true, breakLine: true, fontSize: 12 } }, + { text: "分别输入 ctrl / pert 表达", options: { breakLine: true, fontSize: 11, color: C.textS } }, + { text: "得到两个 attention matrix", options: { breakLine: true, fontSize: 11, color: C.textS } }, + { text: "差值 = 扰动引起的 GRN 变化", options: { breakLine: true, fontSize: 11, color: C.textS } }, +], { x: 5.45, y: 2.1, w: 3.8, h: 2.1, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.25 }); +// Formula highlight +s.addShape(pres.shapes.RECTANGLE, { + x: 5.45, y: 4.3, w: 3.8, h: 0.45, fill: { color: C.tealLt }, +}); +s.addText("\u0394_attn = Attn(pert) - Attn(ctrl)", { + x: 5.45, y: 4.32, w: 3.8, h: 0.4, + fontSize: 14, fontFace: "Consolas", color: C.tealDk, bold: true, align: "center", margin: 0, +}); + +// ============================ +addSlideNum(s); +// SLIDE 9: METHOD OVERVIEW +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "方法总览:Cascaded Flow Matching"); + +s.addText("在 scDFM 的 flow matching 框架上,引入 GRN-aware latent flow", { + x: 0.6, y: 1.05, w: 8.8, h: 0.3, + fontSize: 13, fontFace: "Calibri", color: C.textS, italic: true, margin: 0, +}); + +// Stage 1 +s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 1.55, w: 4.3, h: 2.3, + fill: { color: C.amber, transparency: 92 }, line: { color: C.amber, width: 2 }, +}); +s.addText("Stage 1: GRN Latent Flow", { + x: 0.7, y: 1.65, w: 3.9, h: 0.4, + fontSize: 17, fontFace: "Georgia", color: C.amber, bold: true, margin: 0, +}); +s.addText([ + { text: "noise \u2192 GRN 变化特征", options: { bold: true, breakLine: true, fontSize: 14 } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "理解调控网络如何改变", options: { breakLine: true, fontSize: 13, color: C.textS } }, + { text: "推理时先完成", options: { fontSize: 13, color: C.amber, bold: true } }, +], { x: 0.7, y: 2.15, w: 3.9, h: 1.5, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.2 }); + +// Arrow +s.addText("\u2192", { + x: 4.5, y: 2.2, w: 1, h: 0.8, + fontSize: 40, fontFace: "Calibri", color: C.tealDk, align: "center", valign: "middle", margin: 0, +}); + +// Stage 2 +s.addShape(pres.shapes.RECTANGLE, { + x: 5.2, y: 1.55, w: 4.3, h: 2.3, + fill: { color: C.teal, transparency: 92 }, line: { color: C.teal, width: 2 }, +}); +s.addText("Stage 2: Expression Flow", { + x: 5.4, y: 1.65, w: 3.9, h: 0.4, + fontSize: 17, fontFace: "Georgia", color: C.teal, bold: true, margin: 0, +}); +s.addText([ + { text: "noise \u2192 基因表达预测", options: { bold: true, breakLine: true, fontSize: 14 } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "基于 GRN 变化预测表达", options: { breakLine: true, fontSize: 13, color: C.textS } }, + { text: "推理时后完成", options: { fontSize: 13, color: C.teal, bold: true } }, +], { x: 5.4, y: 2.15, w: 3.9, h: 1.5, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.2 }); + +// Intuition banner +card(s, 0.5, 4.2, 9.0, 1.05, { accent: C.tealDk }); +s.addText("生物学直觉", { + x: 0.75, y: 4.3, w: 2, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText("模型先\u201C想清楚\u201D扰动改变了哪些基因调控关系,再基于这些理解去预测表达变化", { + x: 0.75, y: 4.6, w: 8.5, h: 0.4, + fontSize: 13, fontFace: "Calibri", color: C.text, margin: 0, +}); + +// ============================ +addSlideNum(s); +// SLIDE 10: ARCHITECTURE +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "模型架构"); + +// Left architecture diagram +// Condition inputs +card(s, 0.3, 1.15, 3.0, 1.35); +s.addText("条件信息(推理时可用)", { + x: 0.45, y: 1.2, w: 2.7, h: 0.25, + fontSize: 11, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText([ + { text: "x_ctrl (control 表达)", options: { breakLine: true } }, + { text: "pert_id (扰动基因)", options: { breakLine: true } }, + { text: "t\u2081, t\u2082 (时间步)", options: {} }, +], { x: 0.45, y: 1.5, w: 2.7, h: 0.85, fontSize: 10.5, fontFace: "Consolas", color: C.text, margin: 0, bullet: true, paraSpaceAfter: 3 }); + +// GRN target +card(s, 3.6, 1.15, 3.1, 1.35, { fill: "FFF7ED" }); +s.addText("辅助目标(从噪声生成)", { + x: 3.75, y: 1.2, w: 2.8, h: 0.25, + fontSize: 11, fontFace: "Calibri", color: C.amber, bold: true, margin: 0, +}); +s.addText([ + { text: "z = \u0394_attn @ gene_emb", options: { breakLine: true, fontFace: "Consolas" } }, + { text: "GRN 变化特征 (512d/gene)", options: { breakLine: true } }, + { text: "来自 frozen scGPT", options: {} }, +], { x: 3.75, y: 1.5, w: 2.8, h: 0.85, fontSize: 10.5, fontFace: "Calibri", color: C.text, margin: 0, bullet: true, paraSpaceAfter: 3 }); + +// Expression stream +s.addShape(pres.shapes.RECTANGLE, { + x: 0.3, y: 2.75, w: 3.0, h: 0.5, fill: { color: C.teal, transparency: 85 }, line: { color: C.teal, width: 1 }, +}); +s.addText("Expression Stream \u2192 expr_tokens", { + x: 0.4, y: 2.78, w: 2.8, h: 0.45, + fontSize: 11, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, valign: "middle", +}); + +// Latent stream +s.addShape(pres.shapes.RECTANGLE, { + x: 3.6, y: 2.75, w: 3.1, h: 0.5, fill: { color: C.amber, transparency: 85 }, line: { color: C.amber, width: 1 }, +}); +s.addText("Latent Stream \u2192 lat_tokens", { + x: 3.7, y: 2.78, w: 2.9, h: 0.45, + fontSize: 11, fontFace: "Calibri", color: C.amber, bold: true, margin: 0, valign: "middle", +}); + +// Merge +s.addText("\u2295 加法融合", { + x: 1.5, y: 3.32, w: 3.5, h: 0.3, + fontSize: 12, fontFace: "Calibri", color: C.text, align: "center", margin: 0, +}); + +// Shared backbone +s.addShape(pres.shapes.RECTANGLE, { + x: 0.3, y: 3.7, w: 6.4, h: 0.6, fill: { color: C.tealDk }, +}); +s.addText("Shared Backbone: DiffPerceiverBlock \u00D7 4 + GeneadaLN", { + x: 0.5, y: 3.73, w: 6.0, h: 0.55, + fontSize: 12.5, fontFace: "Calibri", color: C.white, bold: true, margin: 0, valign: "middle", +}); + +// Two heads +s.addShape(pres.shapes.RECTANGLE, { x: 0.3, y: 4.5, w: 3.0, h: 0.45, fill: { color: C.teal } }); +s.addText("ExprHead \u2192 v_expr (B,G)", { + x: 0.4, y: 4.52, w: 2.8, h: 0.4, + fontSize: 11, fontFace: "Calibri", color: C.white, bold: true, margin: 0, valign: "middle", +}); +s.addShape(pres.shapes.RECTANGLE, { x: 3.6, y: 4.5, w: 3.1, h: 0.45, fill: { color: C.amber } }); +s.addText("LatentHead \u2192 v_latent (B,G,512)", { + x: 3.7, y: 4.52, w: 2.9, h: 0.4, + fontSize: 11, fontFace: "Calibri", color: C.white, bold: true, margin: 0, valign: "middle", +}); + +// Right: key design points +card(s, 7.0, 1.15, 2.7, 3.8); +s.addText("设计要点", { + x: 7.15, y: 1.25, w: 2.4, h: 0.3, + fontSize: 13, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText([ + { text: "双流输入", options: { bold: true, breakLine: true, fontSize: 11 } }, + { text: "表达 + GRN latent 各自编码后加法融合", options: { breakLine: true, fontSize: 10, color: C.textS } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "共享骨干", options: { bold: true, breakLine: true, fontSize: 11 } }, + { text: "4 层 DiffPerceiverBlock 联合处理", options: { breakLine: true, fontSize: 10, color: C.textS } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "双头输出", options: { bold: true, breakLine: true, fontSize: 11 } }, + { text: "分别预测表达和 latent 速度场", options: { breakLine: true, fontSize: 10, color: C.textS } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "条件注入", options: { bold: true, breakLine: true, fontSize: 11 } }, + { text: "c = t\u2081 + t\u2082 + pert_emb", options: { breakLine: true, fontSize: 10, color: C.textS } }, + { text: "通过 adaLN 注入", options: { fontSize: 10, color: C.textS } }, +], { x: 7.15, y: 1.6, w: 2.4, h: 3.2, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.15 }); + +// ============================ +addSlideNum(s); +// SLIDE 11: TRAINING & INFERENCE +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "Cascaded 训练与推理"); + +// Training (left) +card(s, 0.5, 1.15, 4.3, 4.0, { accent: C.purple }); +s.addText("训练:概率切换", { + x: 0.75, y: 1.25, w: 3.8, h: 0.35, + fontSize: 16, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText("不同时优化两个 flow,随机 coin flip:", { + x: 0.75, y: 1.65, w: 3.8, h: 0.25, + fontSize: 12, fontFace: "Calibri", color: C.textS, margin: 0, +}); + +// 40% latent +s.addShape(pres.shapes.RECTANGLE, { + x: 0.75, y: 2.1, w: 3.8, h: 0.9, + fill: { color: C.amber, transparency: 90 }, line: { color: C.amber, width: 1 }, +}); +s.addText("40%", { + x: 0.85, y: 2.15, w: 0.8, h: 0.35, + fontSize: 22, fontFace: "Georgia", color: C.amber, bold: true, margin: 0, +}); +s.addText([ + { text: "训练 Latent Flow", options: { bold: true, breakLine: true } }, + { text: "t\u2082 随机, t\u2081=0, 只算 loss_latent", options: {} }, +], { x: 1.7, y: 2.15, w: 2.7, h: 0.75, fontSize: 11, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.5 }); + +// 60% expression +s.addShape(pres.shapes.RECTANGLE, { + x: 0.75, y: 3.2, w: 3.8, h: 0.9, + fill: { color: C.teal, transparency: 90 }, line: { color: C.teal, width: 1 }, +}); +s.addText("60%", { + x: 0.85, y: 3.25, w: 0.8, h: 0.35, + fontSize: 22, fontFace: "Georgia", color: C.teal, bold: true, margin: 0, +}); +s.addText([ + { text: "训练 Expression Flow", options: { bold: true, breakLine: true } }, + { text: "t\u2081 随机, t\u2082\u22481, 只算 loss_expr", options: {} }, +], { x: 1.7, y: 3.25, w: 2.7, h: 0.75, fontSize: 11, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.5 }); + +// Inference (right) +card(s, 5.2, 1.15, 4.3, 4.0, { accent: C.teal }); +s.addText("推理:两阶段串行", { + x: 5.45, y: 1.25, w: 3.8, h: 0.35, + fontSize: 16, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); + +// Stage 1 +s.addShape(pres.shapes.RECTANGLE, { + x: 5.45, y: 1.8, w: 3.8, h: 1.2, + fill: { color: C.amber, transparency: 90 }, line: { color: C.amber, width: 1 }, +}); +s.addText("Stage 1: GRN Latent", { + x: 5.55, y: 1.85, w: 3.6, h: 0.3, + fontSize: 13, fontFace: "Calibri", color: C.amber, bold: true, margin: 0, +}); +s.addText([ + { text: "z_noise ==(ODE)==> z_clean", options: { breakLine: true, fontFace: "Consolas", fontSize: 11 } }, + { text: "先理解 GRN 如何变化 (t\u2082: 0\u21921)", options: { fontSize: 11 } }, +], { x: 5.55, y: 2.2, w: 3.6, h: 0.65, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.4 }); + +// Arrow +s.addText("\u2193", { + x: 5.45, y: 3.05, w: 3.8, h: 0.35, + fontSize: 22, fontFace: "Calibri", color: C.tealDk, align: "center", margin: 0, +}); + +// Stage 2 +s.addShape(pres.shapes.RECTANGLE, { + x: 5.45, y: 3.45, w: 3.8, h: 1.2, + fill: { color: C.teal, transparency: 90 }, line: { color: C.teal, width: 1 }, +}); +s.addText("Stage 2: Expression", { + x: 5.55, y: 3.5, w: 3.6, h: 0.3, + fontSize: 13, fontFace: "Calibri", color: C.teal, bold: true, margin: 0, +}); +s.addText([ + { text: "x_noise ==(ODE)==> x_pred", options: { breakLine: true, fontFace: "Consolas", fontSize: 11 } }, + { text: "基于 z_clean 预测表达 (t\u2081: 0\u21921)", options: { fontSize: 11 } }, +], { x: 5.55, y: 3.85, w: 3.6, h: 0.65, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.4 }); + +// ============================ +addSlideNum(s); +// SLIDE 12: CHALLENGES +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "当前挑战与解决方向"); + +// Challenge 1 +card(s, 0.5, 1.15, 4.3, 4.0, { accent: C.red }); +s.addText("挑战 1:GRN 信号噪声大", { + x: 0.75, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "Attention: 5000\u00D75000 = 25M 非零值", options: { breakLine: true } }, + { text: "真实 GRN: 每基因仅 ~20-50 靶标", options: { breakLine: true } }, + { text: "99%+ attention 值是噪声", options: { breakLine: true, color: C.red, bold: true } }, + { text: "latent loss \u2248 1.12 >> expr loss \u2248 0.019", options: { color: C.red } }, +], { x: 0.75, y: 1.65, w: 3.8, h: 1.15, fontSize: 12, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// Solution 1 +s.addShape(pres.shapes.RECTANGLE, { + x: 0.75, y: 3.05, w: 3.8, h: 1.8, + fill: { color: C.green, transparency: 90 }, line: { color: C.green, width: 1 }, +}); +s.addText("解决:稀疏化 Top-K", { + x: 0.85, y: 3.1, w: 3.6, h: 0.3, + fontSize: 13, fontFace: "Calibri", color: C.green, bold: true, margin: 0, +}); +s.addText([ + { text: "每个基因只保留 |\u0394| 最大的 K=30 个", options: { breakLine: true } }, + { text: "过滤 99.4% 噪声", options: { breakLine: true, bold: true } }, + { text: "sparse_topk_emb 模式", options: { fontFace: "Consolas" } }, +], { x: 0.85, y: 3.45, w: 3.6, h: 1.0, fontSize: 11.5, fontFace: "Calibri", color: C.text, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// Challenge 2 +card(s, 5.2, 1.15, 4.3, 4.0, { accent: C.red }); +s.addText("挑战 2:512 维 Latent 太难预测", { + x: 5.45, y: 1.25, w: 3.8, h: 0.3, + fontSize: 14, fontFace: "Calibri", color: C.text, bold: true, margin: 0, +}); +s.addText([ + { text: "每基因 512 维 = 250 万维速度场", options: { breakLine: true } }, + { text: "模型每步需预测如此大的向量", options: { breakLine: true } }, + { text: "消融: 512\u21921 维, loss 从 ~1.1 降到 ~0.5", options: { breakLine: true, color: C.red, bold: true } }, + { text: "维度是难度的重要来源", options: { color: C.red } }, +], { x: 5.45, y: 1.65, w: 3.8, h: 1.15, fontSize: 12, fontFace: "Calibri", color: C.textS, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// Solution 2 +s.addShape(pres.shapes.RECTANGLE, { + x: 5.45, y: 3.05, w: 3.8, h: 1.8, + fill: { color: C.green, transparency: 90 }, line: { color: C.green, width: 1 }, +}); +s.addText("解决:PCA 降维", { + x: 5.55, y: 3.1, w: 3.6, h: 0.3, + fontSize: 13, fontFace: "Calibri", color: C.green, bold: true, margin: 0, +}); +s.addText([ + { text: "512-d gene_emb \u2192 PCA 投影到 64 维", options: { breakLine: true } }, + { text: "去掉冗余维度,保留主变化方向", options: { breakLine: true, bold: true } }, + { text: "sparse_pca 模式", options: { fontFace: "Consolas" } }, +], { x: 5.55, y: 3.45, w: 3.6, h: 1.0, fontSize: 11.5, fontFace: "Calibri", color: C.text, margin: 0, bullet: true, paraSpaceAfter: 4 }); + +// ============================ +addSlideNum(s); +// SLIDE 13: SUMMARY & FUTURE +// ============================ +s = pres.addSlide(); +s.background = { color: C.light }; +titleBar(s, "总结与展望"); + +// Core contribution +card(s, 0.5, 1.15, 9.0, 1.4, { accent: C.teal }); +s.addText("核心贡献", { + x: 0.75, y: 1.25, w: 2, h: 0.3, + fontSize: 16, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); +s.addText("不是架构改进,而是从生物学机制出发重新建模:用 Cascaded Flow Matching 实现\u201C先理解调控变化,再预测表达变化\u201D", { + x: 0.75, y: 1.6, w: 8.5, h: 0.75, + fontSize: 14, fontFace: "Calibri", color: C.text, margin: 0, lineSpacingMultiple: 1.35, +}); + +// Future experiment +s.addText("后续关键实验:验证因果假设", { + x: 0.5, y: 2.8, w: 5, h: 0.35, + fontSize: 16, fontFace: "Calibri", color: C.tealDk, bold: true, margin: 0, +}); + +const tbl = [ + [ + { text: "推理方式", options: { bold: true, color: "FFFFFF", fill: { color: C.tealDk } } }, + { text: "含义", options: { bold: true, color: "FFFFFF", fill: { color: C.tealDk } } }, + { text: "预期", options: { bold: true, color: "FFFFFF", fill: { color: C.tealDk } } }, + ], + [ + { text: "先 GRN \u2192 后 Expression", options: { bold: true, fill: { color: C.tealLt } } }, + { text: "先理解调控变化,再预测表达", options: { fill: { color: C.tealLt } } }, + { text: "最优", options: { bold: true, color: C.teal, fill: { color: C.tealLt } } }, + ], + ["先 Expression \u2192 后 GRN", "先预测表达,再理解调控", "次优"], + ["同时 random", "无显式顺序", "最差"], +]; +s.addTable(tbl, { + x: 0.5, y: 3.25, w: 9.0, + fontSize: 12, fontFace: "Calibri", + border: { pt: 0.5, color: C.border }, + colW: [3.0, 3.5, 2.5], + rowH: [0.38, 0.38, 0.38, 0.38], + autoPage: false, +}); + +s.addText("如果\u201C先 GRN 后 Expression\u201D显著优于其他 \u2192 验证 GRN 理解是预测表达变化的前提", { + x: 0.5, y: 4.85, w: 9.0, h: 0.35, + fontSize: 12, fontFace: "Calibri", color: C.teal, italic: true, bold: true, margin: 0, +}); + +// ============================ +addSlideNum(s); +// SLIDE 14: CONCLUSION +// ============================ +s = pres.addSlide(); +s.background = { color: C.dark }; +s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 0.15, h: 5.625, fill: { color: C.teal } }); + +s.addText("核心结论", { + x: 0.8, y: 1.2, w: 3, h: 0.4, + fontSize: 16, fontFace: "Calibri", color: "CBD5E1", margin: 0, +}); +s.addText("用 scGPT 的 attention delta 显式提取扰动引起的基因调控网络变化,通过 cascaded flow matching 强制模型\u201C先理解 GRN 如何改变,再预测表达如何变化\u201D,从而将生物学先验融入生成式模型的推理过程。", { + x: 0.8, y: 1.8, w: 8.4, h: 2.2, + fontSize: 22, fontFace: "Georgia", color: C.white, lineSpacingMultiple: 1.45, margin: 0, +}); +s.addText("GRN-Guided Cascaded Flow Matching", { + x: 0.8, y: 4.6, w: 5, h: 0.35, + fontSize: 14, fontFace: "Calibri", color: "22D3EE", margin: 0, +}); + +addSlideNum(s, true); + +// === SAVE === +const outPath = "/home/hp250092/ku50001222/qian/aivc/lfj/Report/PPT/GRN_CCFM_presentation.pptx"; +pres.writeFile({ fileName: outPath }) + .then(() => console.log("Saved: " + outPath)) + .catch(err => console.error("Error:", err)); diff --git a/Report/PPT/fixed-01.jpg b/Report/PPT/fixed-01.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1d47789786b6e3e0b636206802eb0f7b3c0b99d6 --- /dev/null +++ b/Report/PPT/fixed-01.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c631e126985c1ff914cee0cd1595e3204dad15b01af0f1db7f41a5945bf97636 +size 59111 diff --git a/Report/PPT/fixed14-14.jpg b/Report/PPT/fixed14-14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9eeb8efa782764eac2d7a3674e1a0894ff13bc8d --- /dev/null +++ b/Report/PPT/fixed14-14.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:418131775627829fd21436f61d741503f3423c471ffaa4b0aa69cefabd6794c7 +size 92629 diff --git a/Report/PPT/fixed6-06.jpg b/Report/PPT/fixed6-06.jpg new file mode 100644 index 0000000000000000000000000000000000000000..151279931cb5e9c1f32e3ab080f675bd9ea93e3b --- /dev/null +++ b/Report/PPT/fixed6-06.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9ff0271562848760442ceecb1db322cb1f4c1b191096f69238c679fab8c3671 +size 57734 diff --git a/Report/PPT/fixed8-08.jpg b/Report/PPT/fixed8-08.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8762c28b7ed99a122d6684b029a189ab4bde5d00 --- /dev/null +++ b/Report/PPT/fixed8-08.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f9ed17be84795684e751704508f27b2a4580876d6306079f891fedeaf6a3ea6c +size 101067 diff --git a/Report/PPT/slide-01.jpg b/Report/PPT/slide-01.jpg new file mode 100644 index 0000000000000000000000000000000000000000..088904f9bd0be899087d916af456c7c4ff9c96ae --- /dev/null +++ b/Report/PPT/slide-01.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b152a0aba53d948de49b79a4cdb4b4ecaead3996e1ee5cb936b1f1e08a4842e +size 57556 diff --git a/Report/PPT/slide-02.jpg b/Report/PPT/slide-02.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c6cd2b1394d2a6881a024a57124d3d3d189fe5fa --- /dev/null +++ b/Report/PPT/slide-02.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83ce6d8368e8dc12ad18826464122fa26dc994617a8c831ea59a049ad12fab76 +size 101481 diff --git a/Report/PPT/slide-03.jpg b/Report/PPT/slide-03.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8b263f5ef0b7cee7aa2af0d33ec076217891a9ba --- /dev/null +++ b/Report/PPT/slide-03.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07c41eb5c57b2f177be03875aad56a84018917384426848fbe35157c0420e7a2 +size 92638 diff --git a/Report/PPT/slide-04.jpg b/Report/PPT/slide-04.jpg new file mode 100644 index 0000000000000000000000000000000000000000..94d5bf9745d19e2d9dbfe07a7bb5a951f12d36f1 --- /dev/null +++ b/Report/PPT/slide-04.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2287e11118720c608c12bd727e3034b8d0b47dfba63fa5b84fca2df2064bfe4 +size 109583 diff --git a/Report/PPT/slide-05.jpg b/Report/PPT/slide-05.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b1e7840ca274655e9a9f6bd3fc384d0930e24bf7 --- /dev/null +++ b/Report/PPT/slide-05.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:558138b09e0c889201620e18fb3c95c88caf92b6424f9db0e251f9ff2513944e +size 95045 diff --git a/Report/PPT/slide-06.jpg b/Report/PPT/slide-06.jpg new file mode 100644 index 0000000000000000000000000000000000000000..30c9ca70b5bb99ede29a0a99cd419123a14be259 --- /dev/null +++ b/Report/PPT/slide-06.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:996cd046952b85460b44e766962c7866ef7f8db128cab23ff58b477719e3b59e +size 56198 diff --git a/Report/PPT/slide-07.jpg b/Report/PPT/slide-07.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e79fb527604c27581ef4bb2a0081846fd9d3dfc0 --- /dev/null +++ b/Report/PPT/slide-07.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36e5fa8dd236235138e4ad27f5228d7833d3967b3b9884085275079438821ea3 +size 100434 diff --git a/Report/PPT/slide-08.jpg b/Report/PPT/slide-08.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6b60bb7e281a278ebcc07c96685f986cc5648af7 --- /dev/null +++ b/Report/PPT/slide-08.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfa205e78b69cee5f1975749f396e2976b91a8595519128ee3eda187743b5cfc +size 104209 diff --git a/Report/PPT/slide-09.jpg b/Report/PPT/slide-09.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0f9bd7f2b1248a340ce3112a83cc3d65383718f3 --- /dev/null +++ b/Report/PPT/slide-09.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:676b23cfb611210d86132250ced284d69b25b35b138c49b51dca9d1e0fd47b1a +size 104593 diff --git a/Report/PPT/slide-10.jpg b/Report/PPT/slide-10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..407b972e4234467e3445c7eaba530c64c15adeda --- /dev/null +++ b/Report/PPT/slide-10.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd3992d33935045309ad7f373c5e62618ba82fa3acb5f6e89e80069bed5415e9 +size 99917 diff --git a/Report/PPT/slide-11.jpg b/Report/PPT/slide-11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..7e59bbc9fd5d68604178e9fbb03a55910a683fc7 --- /dev/null +++ b/Report/PPT/slide-11.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b39316d1347d44092875cb66f852fb176992aa92111082871efd779479e3568 +size 95572 diff --git a/Report/PPT/slide-12.jpg b/Report/PPT/slide-12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d8fecb5c0b68f20c66900458581a9e34551571f9 --- /dev/null +++ b/Report/PPT/slide-12.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8ffbaa916367ec425df46533e73790c9bde609200dbf3ec8c58e929148c248e +size 107450 diff --git a/Report/PPT/slide-13.jpg b/Report/PPT/slide-13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0cf46a35a28b77ea1d052e66de54a0f14deedf32 --- /dev/null +++ b/Report/PPT/slide-13.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10d324d8635dfe78283520d1b844cf7ae7963e6a3a2e88a5ce29e1aa1899d1b1 +size 100001 diff --git a/Report/PPT/slide-14.jpg b/Report/PPT/slide-14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..687c7aee6c478b1d8aa6311a537f6a49d5527540 --- /dev/null +++ b/Report/PPT/slide-14.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53383136661abb01efb21bc0b9e3fb6a9c110e9ee7ae84063d4daa043b9450ea +size 91236 diff --git "a/Report/PPT/\350\256\262\350\247\243\347\250\277.md" "b/Report/PPT/\350\256\262\350\247\243\347\250\277.md" new file mode 100644 index 0000000000000000000000000000000000000000..5ddf10495c53070fb4fe4e63bf65745069580092 --- /dev/null +++ "b/Report/PPT/\350\256\262\350\247\243\347\250\277.md" @@ -0,0 +1,183 @@ +# GRN-Guided Cascaded Flow Matching 讲解稿 + +--- + +## Slide 1:封面 + +大家好,今天我汇报的题目是 **GRN-Guided Cascaded Flow Matching for Single-Cell Perturbation Prediction**——用基因调控网络引导的级联流匹配方法来做单细胞扰动预测。 + +--- + +## Slide 2:Task——单细胞扰动预测 + +首先介绍一下我们要解决的任务。 + +**虚拟细胞**是当前计算生物学的核心愿景:我们希望构建一个 AI 模型,能够在计算机中模拟真实细胞的行为——给定任意输入条件,预测细胞的分子状态变化。单细胞扰动预测是实现虚拟细胞最关键的子任务之一。 + +扰动有很多种类型:药物扰动、细胞因子扰动、基因扰动等。我们这个工作聚焦的是**基因扰动**,具体来说就是用 CRISPR 技术对细胞进行基因敲除或过表达,然后用单细胞 RNA-seq 测量所有基因的表达变化。 + +任务的形式化很简单:已知 control 细胞的基因表达谱和被扰动的基因,预测扰动后的基因表达谱。基因数量大约是 5000 个高变基因。 + +--- + +## Slide 3:为什么重要 & 数据特点 + +这个任务为什么重要?三个原因: + +第一,**药物筛选加速**。做一次 Perturb-seq 实验成本非常高,如果能用计算预测,可以大幅缩小候选范围。 + +第二,**组合扰动爆炸**。N 个基因的两两组合就是 N(N-1)/2 种实验,不可能穷举,必须靠预测。 + +第三,**理解疾病机制**。预测哪些基因被扰动后会产生某种疾病表型。 + +我们使用的是 Norman 数据集,大约 9000 个细胞,5000 个高变基因,105 种单基因和双基因的 CRISPR 扰动。 + +这里有一个关键挑战:**细胞配对不可得**。扰动是破坏性的,一个细胞只能测一次,我们无法得到同一个细胞扰动前后的配对数据。 + +--- + +## Slide 4:现有方法——简单基线与预训练大模型 + +接下来看看现有的方法。 + +最简单的基线是 **Additive Shift**,也就是均值偏移:直接用训练集里扰动前后的平均差来预测。它假设扰动效应对所有细胞是一个常数平移,完全忽略了细胞异质性。但有意思的是,这个简单基线出奇地难以超越——很多复杂模型在 top DE 基因上并不比它好。 + +**scGPT** 是 2024 年发表在 Nature Methods 上的工作,用自回归 Transformer 在大规模单细胞数据上预训练。它做扰动预测的方式是把扰动基因 mask 掉让模型补全。但本质上它是自回归补全,不是为扰动预测专门设计的。 + +**Geneformer** 也是 2024 年发在 Nature 上,用 rank-value encoding 做预训练。它做扰动预测是直接删掉目标基因的 token,看 embedding 变化。这是一个启发式方法,没有真正学习扰动的动力学。 + +**CPA** 把细胞状态分解为 basal state 加 perturbation effect,在 latent space 里做线性组合。问题是线性可加假设太强了,基因调控本质上是非线性的。 + +--- + +## Slide 5:现有方法——专用扰动预测模型 + +再看看专门为扰动预测设计的模型。 + +**GEARS** 用 Gene Ontology 图上的 GNN 来编码基因关系,但 GO 图是静态的先验知识,不随细胞状态变化,而且它是确定性预测,不能给出分布。 + +**STATE** 是 ICLR 2025 的工作,用 Stacked Attention 做表达变换,同样是确定性预测,没有从 GRN 变化的角度建模。 + +**CellFlow** 也用了 flow matching 框架,但它用预训练 embedding 作为条件,这些 embedding 编码的是绝对状态,没有显式建模扰动对调控网络的改变。 + +**scDFM** 是我们的基线方法,今年发表在 ICLR 2026。它把 Conditional Flow Matching 引入扰动预测,学习从噪声到目标表达的速度场。优点是生成式模型,能给出分布,训练也稳定。但问题在于信息来源单一——只有 control 的数值表达加扰动基因的 embedding,模型不理解基因间的调控关系。 + +--- + +## Slide 6:所有现有方法的共同盲区 + +总结一下,所有现有方法都有一个共同的盲区: + +它们都是 **扰动 → 黑箱模型 → 表达变化** 这样的端到端模式。 + +没有任何一个方法显式地建模中间这一步:**扰动是如何通过基因调控网络的变化来导致表达变化的**。 + +我们的方法要做的,就是把这一步补上:**扰动 → GRN 变化 → 表达变化**,显式建模生物学机制。 + +--- + +## Slide 7:Motivation 1——Flow Matching 解决配对问题 + +我们的工作有三个 motivation。 + +第一个是用 Flow Matching 来解决细胞配对问题。刚才提到,单细胞扰动数据天然没有 paired data,一个细胞扰动后就变了,无法回到扰动前状态。 + +传统方法要么用群体均值匹配丢失异质性,要么用 Autoencoder 受限于重建质量。 + +**Flow Matching 的优势**在于:它学习的是从 source 分布到 target 分布的概率传输映射,天然适合 unpaired 数据。不需要逐细胞配对,只需要两组细胞的群体分布。通过 Conditional Optimal Transport 构造训练对,效率更高。而且它是生成式输出,每个 control 细胞可以采样多个预测,给出不确定性估计。 + +--- + +## Slide 8:Motivation 2 & 3——GRN 视角 + scGPT Attention + +第二个 motivation 是从 GRN 变化的角度来理解扰动。 + +生物学上,基因扰动不是简单地改变一个基因的值。比如 CRISPR 敲除基因 A,首先 A 的表达降为 0,然后 A 直接调控的基因 B、C、D 发生变化,再往下 B 调控的 E、F,C 调控的 G、H 依次改变——这是一个通过基因调控网络的级联传播过程。如果我们能先理解 GRN 如何变化,再预测表达,预测会更准确。 + +第三个 motivation 是 scGPT 的 attention matrix 可以作为数据驱动的 GRN。预训练的 scGPT 在 attention matrix 里编码了基因间的调控关系:attn[i][j] 高表示基因 j 对基因 i 有强调控。而且这个 GRN 是上下文相关的,随细胞状态变化,比静态的 GO 图灵活得多。 + +我们可以分别输入 control 和 perturbed 的表达,得到两个 attention matrix,它们的差值 Δ_attn 就直接反映了扰动引起的 GRN 变化。 + +--- + +## Slide 9:方法总览——Cascaded Flow Matching + +基于这三个 motivation,我们提出了 Cascaded Flow Matching。 + +核心思路是在 scDFM 的 flow matching 框架上,引入一个 **GRN-aware latent flow**,形成两阶段的级联结构: + +**Stage 1 是 GRN Latent Flow**:从噪声生成 GRN 变化特征,理解调控网络如何改变。推理时先完成。 + +**Stage 2 是 Expression Flow**:从噪声生成基因表达预测,基于 GRN 变化来预测表达。推理时后完成。 + +生物学直觉很简单:模型先"想清楚"扰动改变了哪些基因调控关系,再基于这些理解去预测表达变化。 + +--- + +## Slide 10:模型架构 + +具体的模型架构是这样的。 + +输入分为两部分:一是条件信息,包括 control 表达、扰动基因 ID 和两个时间步;二是辅助生成目标,就是 GRN 变化特征 z,通过 frozen scGPT 的 Δ_attn 乘以 gene embedding 得到。 + +模型有**双流输入**:Expression Stream 编码表达信息,Latent Stream 编码 GRN latent 信息,两者加法融合。 + +融合后进入**共享骨干**:4 层 DiffPerceiverBlock,配合 GeneadaLN 注入条件信息。条件向量 c 由两个时间步加扰动 embedding 组成。 + +最后是**双头输出**:ExprHead 预测表达速度场,LatentHead 预测 latent 速度场。 + +--- + +## Slide 11:Cascaded 训练与推理 + +训练的时候我们不同时优化两个 flow,而是概率切换: + +40% 的概率训练 Latent Flow——t₂ 随机采样,t₁ 固定为 0,只算 latent loss。 + +60% 的概率训练 Expression Flow——t₁ 随机采样,t₂ 接近 1,只算 expression loss。 + +推理的时候是两阶段串行: + +**Stage 1** 先跑 GRN Latent,从 z_noise 通过 ODE 生成 z_clean,理解 GRN 如何变化。 + +**Stage 2** 再跑 Expression,利用已完成的 z_clean 作为条件,从 x_noise 通过 ODE 生成 x_pred。 + +这种先后顺序的设计,就是我们这个工作的核心:先理解调控变化,再预测表达变化。 + +--- + +## Slide 12:当前挑战与解决方向 + +目前有两个主要挑战。 + +**第一个挑战:GRN 信号噪声太大。** scGPT 的 attention matrix 是 5000×5000 的稠密矩阵,有 2500 万个非零值。但真实的 GRN 是极度稀疏的,一个基因通常只直接调控几十个靶标。所以 99% 以上的 attention 值都是噪声。实验也验证了这一点:latent loss 约 1.12,远高于 expression loss 的 0.019。 + +我们的解决方案是**稀疏化 Top-K**:每个基因只保留 Δ 值最大的 K=30 个连接,过滤掉 99.4% 的噪声。 + +**第二个挑战:512 维的 latent 太难预测。** 每个基因的 GRN 特征是 512 维,整个速度场是 250 万维,模型难以在每个时间步预测这么大的向量。消融实验证实,把维度从 512 降到 1,loss 从约 1.1 降到约 0.5。 + +解决方案是 **PCA 降维**:把 512 维的 gene embedding 通过 PCA 投影到 64 维,去掉冗余维度,只保留主要的变化方向。 + +--- + +## Slide 13:总结与展望 + +总结一下,我们这个工作的核心贡献不是在模型架构上做改进,而是**从生物学机制出发**重新建模扰动预测任务:用 Cascaded Flow Matching 实现"先理解调控变化,再预测表达变化"。 + +后续最关键的实验是验证因果假设。我们计划训练一个支持任意推理顺序的模型,然后对比三种推理方式: + +- 先 GRN 后 Expression——我们预期这是最优的; +- 先 Expression 后 GRN——预期次优; +- 同时 random——预期最差。 + +如果"先 GRN 后 Expression"显著优于其他顺序,就验证了我们的核心假设:**理解基因调控网络的变化,是预测扰动表达变化的前提条件,而不是副产物。** + +--- + +## Slide 14:核心结论 + +最后一句话总结: + +我们用 scGPT 的 attention delta 显式提取扰动引起的基因调控网络变化,通过 cascaded flow matching 强制模型"先理解 GRN 如何改变,再预测表达如何变化",从而将生物学先验——扰动通过 GRN 级联传播——融入生成式模型的推理过程。 + +谢谢大家,欢迎提问。 diff --git a/Report/PPT2/GRN_CCFM_presentation.pdf b/Report/PPT2/GRN_CCFM_presentation.pdf new file mode 100644 index 0000000000000000000000000000000000000000..de6fc887f0b63d448b3d3d13addc4cc4845bd990 --- /dev/null +++ b/Report/PPT2/GRN_CCFM_presentation.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2a364adbc69c18b72d658c56eab80dc2f46a3a7ee8e04d82a5f4524ec453efe3 +size 199553 diff --git a/Report/PPT2/GRN_CCFM_presentation.pptx b/Report/PPT2/GRN_CCFM_presentation.pptx new file mode 100644 index 0000000000000000000000000000000000000000..0d148fe955ed00db7e8ee131a80f0b661c997669 --- /dev/null +++ b/Report/PPT2/GRN_CCFM_presentation.pptx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a1aad9d0018851617a8642f4a3afc393bfc330232ea929f581683af8b53ce08 +size 317483 diff --git a/Report/PPT2/generate.js b/Report/PPT2/generate.js new file mode 100644 index 0000000000000000000000000000000000000000..fef30a909f72e6b9a50ea6cff95ddace79487e06 --- /dev/null +++ b/Report/PPT2/generate.js @@ -0,0 +1,781 @@ +const pptxgen = require("pptxgenjs"); +const pres = new pptxgen(); +pres.layout = "LAYOUT_16x9"; // 10" x 5.625" +pres.author = "Qian"; +pres.title = "GRN-Guided Cascaded Flow Matching for Single-Cell Perturbation Prediction"; + +// ─── COLOR PALETTE ─── +const NAVY = "1B2A4A"; +const BLUE = "2E6B9E"; +const LT_BLUE = "B8D4E8"; +const BG_GRAY = "F0F2F5"; +const CARD_BG = "F7F8FA"; +const TXT = "2C3E50"; +const TXT_MID = "4A5568"; +const TXT_LT = "6B7B8D"; +const WHITE = "FFFFFF"; +const RED = "C0392B"; +const GREEN = "27AE60"; +const ORANGE = "D35400"; + +const HF = "Cambria"; +const BF = "Calibri"; +const CF = "Consolas"; + +// ─── HELPERS ─── +function slideNum(slide, n) { + slide.addText(String(n), { + x: 9.2, y: 5.2, w: 0.5, h: 0.3, + fontSize: 10, color: TXT_LT, fontFace: BF, align: "right" + }); +} + +function headerBar(slide, title) { + slide.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 10, h: 0.85, + fill: { color: NAVY } + }); + slide.addText(title, { + x: 0.6, y: 0.12, w: 8.8, h: 0.6, + fontSize: 24, fontFace: HF, color: WHITE, bold: true, margin: 0 + }); +} + +function sectionLabel(slide, text, x, y, w) { + slide.addText(text, { + x: x || 0.6, y: y || 1.1, w: w || 8.8, h: 0.4, + fontSize: 17, fontFace: HF, color: NAVY, bold: true, margin: 0 + }); +} + +function card(slide, x, y, w, h, accentColor) { + slide.addShape(pres.shapes.RECTANGLE, { + x, y, w, h, fill: { color: CARD_BG } + }); + if (accentColor) { + slide.addShape(pres.shapes.RECTANGLE, { + x, y, w: 0.06, h, fill: { color: accentColor } + }); + } +} + +// ════════════════════════════════════════════════════════════ +// SLIDE 1: TITLE +// ════════════════════════════════════════════════════════════ +let s1 = pres.addSlide(); +s1.background = { color: NAVY }; +s1.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 10, h: 0.06, fill: { color: BLUE } +}); +s1.addText([ + { text: "GRN-Guided Cascaded Flow Matching", options: { breakLine: true, fontSize: 34 } }, + { text: "for Single-Cell Perturbation Prediction", options: { fontSize: 28 } } +], { + x: 0.8, y: 1.0, w: 8.4, h: 2.2, + fontFace: HF, color: WHITE, bold: true, + align: "center", valign: "middle", paraSpaceAfter: 8 +}); +s1.addShape(pres.shapes.RECTANGLE, { + x: 3.8, y: 3.4, w: 2.4, h: 0.035, fill: { color: BLUE } +}); +s1.addText("Group Meeting Report", { + x: 1, y: 3.65, w: 8, h: 0.45, + fontSize: 18, fontFace: BF, color: LT_BLUE, align: "center" +}); +s1.addText("March 2026", { + x: 1, y: 4.2, w: 8, h: 0.35, + fontSize: 14, fontFace: BF, color: TXT_LT, align: "center" +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 2: TASK DEFINITION +// ════════════════════════════════════════════════════════════ +let s2 = pres.addSlide(); +headerBar(s2, "Task: Single-Cell Perturbation Prediction"); +slideNum(s2, 2); + +// Left column +sectionLabel(s2, "Virtual Cell Vision", 0.6, 1.05); +s2.addText([ + { text: "AI model simulating cell behavior", options: { bullet: true, breakLine: true } }, + { text: "Predict molecular state under perturbation", options: { bullet: true, breakLine: true } }, + { text: "Focus: CRISPR genetic perturbation", options: { bullet: true } } +], { + x: 0.6, y: 1.5, w: 4.2, h: 1.2, + fontSize: 13, fontFace: BF, color: TXT, paraSpaceAfter: 4 +}); + +sectionLabel(s2, "Perturbation Types", 0.6, 2.8); +s2.addText([ + { text: "Drug (small molecule compounds)", options: { bullet: true, breakLine: true } }, + { text: "Cytokine (immune signaling)", options: { bullet: true, breakLine: true } }, + { text: "Genetic (CRISPR KO / OE / KD)", options: { bullet: true, bold: true } } +], { + x: 0.6, y: 3.25, w: 4.2, h: 1.2, + fontSize: 13, fontFace: BF, color: TXT, paraSpaceAfter: 4 +}); + +// Right column - task formulation card +card(s2, 5.3, 1.05, 4.2, 3.7, BLUE); +s2.addText("Task Formulation", { + x: 5.6, y: 1.15, w: 3.7, h: 0.35, + fontSize: 15, fontFace: HF, color: NAVY, bold: true, margin: 0 +}); +s2.addText([ + { text: "Input:", options: { bold: true, breakLine: true } }, + { text: " x_ctrl (control expression, G dims)", options: { breakLine: true } }, + { text: " p (perturbed gene ID)", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Output:", options: { bold: true, breakLine: true } }, + { text: " x_pert (perturbed expression, G dims)", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "G = 5,000 highly variable genes", options: { italic: true, color: TXT_MID } } +], { + x: 5.6, y: 1.6, w: 3.7, h: 2.8, + fontSize: 12, fontFace: CF, color: TXT +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 3: SIGNIFICANCE & DATASET +// ════════════════════════════════════════════════════════════ +let s3 = pres.addSlide(); +headerBar(s3, "Significance & Dataset"); +slideNum(s3, 3); + +// Three importance cards +const importCards = [ + { num: "$$$", title: "Drug Screening", body: "Wet-lab Perturb-seq is expensive;\nvirtual screening saves resources" }, + { num: "N\u00B2", title: "Combinatorial Explosion", body: "N genes \u2192 N(N-1)/2 combinations;\nimpossible to enumerate all" }, + { num: "DNA", title: "Disease Mechanism", body: "Predict which gene perturbation\ncauses disease phenotype" } +]; +importCards.forEach((c, i) => { + const cx = 0.6 + i * 3.1; + card(s3, cx, 1.05, 2.8, 2.0, BLUE); + s3.addText(c.num, { + x: cx + 0.15, y: 1.15, w: 1.0, h: 0.45, + fontSize: 20, fontFace: HF, color: BLUE, bold: true, margin: 0 + }); + s3.addText(c.title, { + x: cx + 0.15, y: 1.6, w: 2.5, h: 0.3, + fontSize: 14, fontFace: HF, color: NAVY, bold: true, margin: 0 + }); + s3.addText(c.body, { + x: cx + 0.15, y: 1.95, w: 2.5, h: 0.9, + fontSize: 11, fontFace: BF, color: TXT_MID + }); +}); + +// Dataset info +sectionLabel(s3, "Dataset: Norman et al.", 0.6, 3.3); +s3.addText([ + { text: "~9,000 cells \u00D7 5,000 HVG", options: { bullet: true, breakLine: true, bold: true } }, + { text: "105 single/double CRISPR perturbations (KO + OE)", options: { bullet: true, breakLine: true } }, + { text: "No cell-level pairing (destructive measurement)", options: { bullet: true, breakLine: true, bold: true, color: RED } }, + { text: "Metrics: DE gene overlap, direction, MSE, Pearson r", options: { bullet: true } } +], { + x: 0.6, y: 3.75, w: 8.8, h: 1.3, + fontSize: 13, fontFace: BF, color: TXT, paraSpaceAfter: 4 +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 4: EXISTING METHODS +// ════════════════════════════════════════════════════════════ +let s4 = pres.addSlide(); +headerBar(s4, "Existing Methods & Limitations"); +slideNum(s4, 4); + +const hdrOpts = (txt) => ({ text: txt, options: { bold: true, color: WHITE, fill: { color: NAVY }, fontSize: 12, fontFace: BF, align: "center" } }); +const cellOpts = (txt, opts) => ({ text: txt, options: { fontSize: 11, fontFace: BF, ...opts } }); +const altBg = { fill: { color: "F8F9FA" } }; + +s4.addTable([ + [ hdrOpts("Method"), hdrOpts("Type"), hdrOpts("Key Limitation") ], + [ cellOpts("Additive Shift", altBg), cellOpts("Baseline", { ...altBg, align: "center" }), cellOpts("Ignores cell heterogeneity; constant shift assumption", altBg) ], + [ cellOpts("scGPT"), cellOpts("Pretrained LM", { align: "center" }), cellOpts("Autoregressive completion; not designed for perturbation") ], + [ cellOpts("Geneformer", altBg), cellOpts("Pretrained LM", { ...altBg, align: "center" }), cellOpts("Heuristic in-silico perturbation; loses expression info", altBg) ], + [ cellOpts("CPA"), cellOpts("Specialized", { align: "center" }), cellOpts("Linear additivity assumption in latent space") ], + [ cellOpts("GEARS", altBg), cellOpts("Specialized", { ...altBg, align: "center" }), cellOpts("Static GO graph prior; deterministic prediction only", altBg) ], + [ cellOpts("scDFM", { bold: true }), cellOpts("Flow Matching", { align: "center" }), cellOpts("No GRN modeling; limited model capacity (d=128)") ] +], { + x: 0.6, y: 1.1, w: 8.8, + colW: [1.8, 1.5, 5.5], + border: { pt: 0.5, color: "DDE1E6" }, + rowH: [0.45, 0.42, 0.42, 0.42, 0.42, 0.42, 0.42] +}); + +s4.addText("scDFM (ICLR 2026) is closest to our work \u2014 we build upon its flow matching framework.", { + x: 0.6, y: 4.5, w: 8.8, h: 0.3, + fontSize: 11, fontFace: BF, color: TXT_MID, italic: true +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 5: THE MISSING PIECE +// ════════════════════════════════════════════════════════════ +let s5 = pres.addSlide(); +headerBar(s5, "The Common Blind Spot"); +slideNum(s5, 5); + +sectionLabel(s5, "All existing methods share the same gap:"); + +// Existing approach block +card(s5, 0.6, 1.8, 8.8, 1.3, RED); +s5.addText("Existing Approach", { + x: 0.85, y: 1.9, w: 3.0, h: 0.3, + fontSize: 14, fontFace: HF, color: RED, bold: true, margin: 0 +}); +s5.addText("Perturbation \u2192 [ Black-Box Model ] \u2192 Expression Change", { + x: 0.85, y: 2.3, w: 8.2, h: 0.4, + fontSize: 16, fontFace: CF, color: TXT, margin: 0 +}); +s5.addText("No explicit modeling of gene regulatory network changes", { + x: 0.85, y: 2.7, w: 8.0, h: 0.3, + fontSize: 12, fontFace: BF, color: TXT_MID, italic: true, margin: 0 +}); + +// Our approach block +card(s5, 0.6, 3.5, 8.8, 1.3, GREEN); +s5.addText("Our Approach", { + x: 0.85, y: 3.6, w: 3.0, h: 0.3, + fontSize: 14, fontFace: HF, color: GREEN, bold: true, margin: 0 +}); +s5.addText("Perturbation \u2192 GRN Rewiring \u2192 Expression Change", { + x: 0.85, y: 4.0, w: 8.2, h: 0.4, + fontSize: 16, fontFace: CF, color: TXT, margin: 0 +}); +s5.addText("Explicitly model how perturbation alters the gene regulatory network", { + x: 0.85, y: 4.4, w: 8.0, h: 0.3, + fontSize: 12, fontFace: BF, color: TXT_MID, italic: true, margin: 0 +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 6: THREE KEY MOTIVATIONS +// ════════════════════════════════════════════════════════════ +let s6 = pres.addSlide(); +headerBar(s6, "Three Key Motivations"); +slideNum(s6, 6); + +const motivations = [ + { + num: "1", title: "Flow Matching for Unpaired Data", + bullets: [ + "Learns probability transport: p(ctrl) \u2192 p(pert)", + "No cell-level pairing required", + "Generative output with uncertainty estimation" + ] + }, + { + num: "2", title: "GRN Cascade Drives Expression Change", + bullets: [ + "KO gene A \u2192 direct targets B,C,D change", + "Cascade propagates through regulatory network", + "Understanding GRN change = better prediction" + ] + }, + { + num: "3", title: "scGPT Attention \u2248 Data-Driven GRN", + bullets: [ + "Pretrained attention encodes gene-gene regulation", + "Context-dependent: varies with cell state", + "\u0394_attn captures GRN change from perturbation" + ] + } +]; + +motivations.forEach((m, i) => { + const cy = 1.05 + i * 1.4; + card(s6, 0.6, cy, 8.8, 1.2, BLUE); + s6.addShape(pres.shapes.OVAL, { + x: 0.85, y: cy + 0.15, w: 0.5, h: 0.5, + fill: { color: NAVY } + }); + s6.addText(m.num, { + x: 0.85, y: cy + 0.15, w: 0.5, h: 0.5, + fontSize: 18, fontFace: HF, color: WHITE, bold: true, + align: "center", valign: "middle", margin: 0 + }); + s6.addText(m.title, { + x: 1.55, y: cy + 0.1, w: 7.5, h: 0.35, + fontSize: 15, fontFace: HF, color: NAVY, bold: true, margin: 0 + }); + s6.addText(m.bullets.map((b, bi) => ({ + text: b, + options: { bullet: true, breakLine: bi < m.bullets.length - 1 } + })), { + x: 1.55, y: cy + 0.5, w: 7.5, h: 0.65, + fontSize: 12, fontFace: BF, color: TXT_MID, paraSpaceAfter: 2 + }); +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 7: METHOD OVERVIEW +// ════════════════════════════════════════════════════════════ +let s7 = pres.addSlide(); +headerBar(s7, "Method: Cascaded Flow Matching"); +slideNum(s7, 7); + +sectionLabel(s7, "Two-Stage Generation: \"Think First, Then Predict\""); + +// Stage 1 box +card(s7, 0.6, 1.7, 4.1, 2.8, ORANGE); +s7.addText("Stage 1: GRN Latent Flow", { + x: 0.85, y: 1.8, w: 3.6, h: 0.35, + fontSize: 15, fontFace: HF, color: ORANGE, bold: true, margin: 0 +}); +s7.addText([ + { text: "noise \u2192 GRN change features", options: { breakLine: true, bold: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Understand how perturbation", options: { breakLine: true } }, + { text: "rewires the regulatory network", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Conditioned on:", options: { bold: true, breakLine: true } }, + { text: " \u2022 control expression", options: { breakLine: true } }, + { text: " \u2022 perturbed gene ID", options: {} } +], { + x: 0.85, y: 2.25, w: 3.6, h: 2.0, + fontSize: 12, fontFace: BF, color: TXT +}); + +// Arrow +s7.addText("\u2192", { + x: 4.7, y: 2.7, w: 0.6, h: 0.5, + fontSize: 30, fontFace: BF, color: NAVY, align: "center", valign: "middle", bold: true +}); + +// Stage 2 box +card(s7, 5.3, 1.7, 4.1, 2.8, GREEN); +s7.addText("Stage 2: Expression Flow", { + x: 5.55, y: 1.8, w: 3.6, h: 0.35, + fontSize: 15, fontFace: HF, color: GREEN, bold: true, margin: 0 +}); +s7.addText([ + { text: "noise \u2192 gene expression", options: { breakLine: true, bold: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Predict expression changes", options: { breakLine: true } }, + { text: "based on GRN understanding", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Conditioned on:", options: { bold: true, breakLine: true } }, + { text: " \u2022 Stage 1 GRN features", options: { breakLine: true } }, + { text: " \u2022 control expression + pert ID", options: {} } +], { + x: 5.55, y: 2.25, w: 3.6, h: 2.0, + fontSize: 12, fontFace: BF, color: TXT +}); + +// Bottom insight bar +s7.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 4.7, w: 8.8, h: 0.5, + fill: { color: LT_BLUE } +}); +s7.addText("Biological intuition: first understand GRN rewiring, then predict expression change", { + x: 0.8, y: 4.7, w: 8.4, h: 0.5, + fontSize: 13, fontFace: BF, color: NAVY, italic: true, valign: "middle" +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 8: GRN FEATURE EXTRACTION +// ════════════════════════════════════════════════════════════ +let s8 = pres.addSlide(); +headerBar(s8, "GRN Feature: Attention-Delta Extraction"); +slideNum(s8, 8); + +sectionLabel(s8, "Using Frozen scGPT to Extract GRN Change Signal"); + +// Steps +const steps = [ + "Feed control & perturbed expression\ninto frozen scGPT separately", + "Extract attention matrices:\nAttn(ctrl) and Attn(pert)", + "Compute delta:\n\u0394_attn = Attn(pert) \u2212 Attn(ctrl)", + "Project to features:\nz = \u0394_attn \u00D7 gene_embeddings" +]; +steps.forEach((desc, i) => { + const sy = 1.65 + i * 0.9; + s8.addShape(pres.shapes.OVAL, { + x: 0.7, y: sy + 0.05, w: 0.45, h: 0.45, + fill: { color: BLUE } + }); + s8.addText(String(i + 1), { + x: 0.7, y: sy + 0.05, w: 0.45, h: 0.45, + fontSize: 16, fontFace: HF, color: WHITE, bold: true, + align: "center", valign: "middle", margin: 0 + }); + s8.addText(desc, { + x: 1.4, y: sy, w: 3.8, h: 0.6, + fontSize: 12, fontFace: BF, color: TXT, valign: "middle", margin: 0 + }); + if (i < steps.length - 1) { + s8.addShape(pres.shapes.LINE, { + x: 0.92, y: sy + 0.52, w: 0, h: 0.35, + line: { color: BLUE, width: 1.5, dashType: "dash" } + }); + } +}); + +// Output card on right +card(s8, 5.6, 1.65, 3.8, 3.2, NAVY); +s8.addText("Output", { + x: 5.85, y: 1.75, w: 3.3, h: 0.3, + fontSize: 15, fontFace: HF, color: NAVY, bold: true, margin: 0 +}); +s8.addText([ + { text: "Per-gene GRN change vector", options: { breakLine: true, bold: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Shape: (B, G, 512)", options: { breakLine: true, fontFace: CF } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Each gene gets a 512-d vector\nencoding: \"how did upstream\nregulatory relationships change\nfor this gene?\"", options: { color: TXT_MID } } +], { + x: 5.85, y: 2.15, w: 3.3, h: 2.2, + fontSize: 12, fontFace: BF, color: TXT +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 9: MODEL ARCHITECTURE +// ════════════════════════════════════════════════════════════ +let s9 = pres.addSlide(); +headerBar(s9, "Model Architecture"); +slideNum(s9, 9); + +// Expression Stream +card(s9, 0.6, 1.1, 4.1, 1.1, BLUE); +s9.addText("Expression Stream", { + x: 0.85, y: 1.15, w: 3.6, h: 0.3, + fontSize: 14, fontFace: HF, color: BLUE, bold: true, margin: 0 +}); +s9.addText("GeneEncoder + ValueEnc \u2192 expr_tokens (B,G,d)", { + x: 0.85, y: 1.5, w: 3.6, h: 0.4, + fontSize: 11, fontFace: CF, color: TXT, margin: 0 +}); + +// Latent Stream +card(s9, 5.3, 1.1, 4.1, 1.1, ORANGE); +s9.addText("Latent Stream", { + x: 5.55, y: 1.15, w: 3.6, h: 0.3, + fontSize: 14, fontFace: HF, color: ORANGE, bold: true, margin: 0 +}); +s9.addText("LatentEmbedder \u2192 lat_tokens (B,G,d)", { + x: 5.55, y: 1.5, w: 3.6, h: 0.4, + fontSize: 11, fontFace: CF, color: TXT, margin: 0 +}); + +// Merge +s9.addText("\u2295 Additive Fusion", { + x: 3.0, y: 2.35, w: 4.0, h: 0.35, + fontSize: 13, fontFace: BF, color: NAVY, bold: true, align: "center", margin: 0 +}); + +// Down arrows +s9.addShape(pres.shapes.LINE, { + x: 2.5, y: 2.2, w: 0, h: 0.15, + line: { color: NAVY, width: 1.5 } +}); +s9.addShape(pres.shapes.LINE, { + x: 7.5, y: 2.2, w: 0, h: 0.15, + line: { color: NAVY, width: 1.5 } +}); + +// Conditioning +card(s9, 2.0, 2.85, 6.0, 0.5, NAVY); +s9.addText("Conditioning: c = t_expr + t_latent + pert_embedding", { + x: 2.25, y: 2.9, w: 5.5, h: 0.4, + fontSize: 11, fontFace: CF, color: TXT, valign: "middle", margin: 0 +}); + +// Down arrow to backbone +s9.addShape(pres.shapes.LINE, { + x: 5.0, y: 3.35, w: 0, h: 0.2, + line: { color: NAVY, width: 1.5 } +}); + +// Shared Backbone +s9.addShape(pres.shapes.RECTANGLE, { + x: 2.0, y: 3.6, w: 6.0, h: 0.65, + fill: { color: NAVY } +}); +s9.addText("Shared Backbone: DiffPerceiverBlock \u00D7 4 (with Gene-AdaLN)", { + x: 2.0, y: 3.6, w: 6.0, h: 0.65, + fontSize: 13, fontFace: BF, color: WHITE, bold: true, + align: "center", valign: "middle" +}); + +// Down arrows to heads +s9.addShape(pres.shapes.LINE, { + x: 3.4, y: 4.25, w: 0, h: 0.2, + line: { color: NAVY, width: 1.5 } +}); +s9.addShape(pres.shapes.LINE, { + x: 6.6, y: 4.25, w: 0, h: 0.2, + line: { color: NAVY, width: 1.5 } +}); + +// Dual heads +card(s9, 2.0, 4.5, 2.8, 0.65, BLUE); +s9.addText("Expression Head \u2192 v_expr (B,G)", { + x: 2.2, y: 4.55, w: 2.4, h: 0.45, + fontSize: 11, fontFace: CF, color: TXT, valign: "middle", margin: 0 +}); +card(s9, 5.2, 4.5, 2.8, 0.65, ORANGE); +s9.addText("Latent Head \u2192 v_latent (B,G,512)", { + x: 5.4, y: 4.55, w: 2.4, h: 0.45, + fontSize: 11, fontFace: CF, color: TXT, valign: "middle", margin: 0 +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 10: TRAINING & INFERENCE +// ════════════════════════════════════════════════════════════ +let s10 = pres.addSlide(); +headerBar(s10, "Cascaded Training & Inference"); +slideNum(s10, 10); + +// Left: Training +sectionLabel(s10, "Training: Probabilistic Switching", 0.6, 1.1, 4.2); +card(s10, 0.6, 1.55, 4.2, 1.4, BLUE); +s10.addText([ + { text: "40%", options: { bold: true, fontSize: 20, color: ORANGE } }, + { text: " Train Latent Flow only", options: { fontSize: 13 } } +], { + x: 0.85, y: 1.65, w: 3.7, h: 0.45, fontFace: BF, color: TXT, valign: "middle", margin: 0 +}); +s10.addText("t\u2082 random, t\u2081 = 0, only loss_latent", { + x: 0.85, y: 2.05, w: 3.7, h: 0.25, + fontSize: 10, fontFace: CF, color: TXT_MID, margin: 0 +}); +s10.addText([ + { text: "60%", options: { bold: true, fontSize: 20, color: GREEN } }, + { text: " Train Expression Flow only", options: { fontSize: 13 } } +], { + x: 0.85, y: 2.4, w: 3.7, h: 0.45, fontFace: BF, color: TXT, valign: "middle", margin: 0 +}); +s10.addText("t\u2081 random, t\u2082 \u2248 1, only loss_expr", { + x: 0.85, y: 2.7, w: 3.7, h: 0.25, + fontSize: 10, fontFace: CF, color: TXT_MID, margin: 0 +}); + +// Right: Inference +sectionLabel(s10, "Inference: Sequential Two-Stage", 5.3, 1.1, 4.2); +card(s10, 5.3, 1.55, 4.2, 1.4, NAVY); +s10.addText([ + { text: "Stage 1:", options: { bold: true, color: ORANGE, breakLine: true } }, + { text: "z_noise \u2550\u2550(ODE)\u2550\u2550> z_clean (t\u2082: 0\u21921)", options: { fontFace: CF, fontSize: 11, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Stage 2:", options: { bold: true, color: GREEN, breakLine: true } }, + { text: "x_noise \u2550\u2550(ODE)\u2550\u2550> x_pred (t\u2081: 0\u21921)", options: { fontFace: CF, fontSize: 11 } } +], { + x: 5.55, y: 1.65, w: 3.7, h: 1.2, + fontSize: 12, fontFace: BF, color: TXT, margin: 0 +}); + +// Biological analogy +sectionLabel(s10, "Biological Cascade Analogy", 0.6, 3.2, 8.8); +s10.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 3.6, w: 8.8, h: 1.6, + fill: { color: LT_BLUE } +}); +s10.addText([ + { text: "CRISPR knock-out gene A", options: { bold: true, breakLine: true } }, + { text: " \u2193 Gene A expression \u2192 0", options: { breakLine: true } }, + { text: " \u2193 Direct targets B, C, D change (1st-order)", options: { breakLine: true } }, + { text: " \u2193 B\u2019s targets E, F and C\u2019s targets G, H change (cascade)", options: { breakLine: true } }, + { text: " \u2193 Thousands of genes altered across the transcriptome", options: {} } +], { + x: 0.8, y: 3.65, w: 8.4, h: 1.5, + fontSize: 12, fontFace: CF, color: TXT +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 11: CHALLENGE 1 - NOISY GRN SIGNAL +// ════════════════════════════════════════════════════════════ +let s11 = pres.addSlide(); +headerBar(s11, "Challenge 1: Noisy GRN Signal"); +slideNum(s11, 11); + +// Problem +sectionLabel(s11, "Problem: Noise Drowns True Signal", 0.6, 1.1, 4.2); +card(s11, 0.6, 1.55, 4.2, 1.8, RED); +s11.addText([ + { text: "Attention matrix: 5000\u00D75000", options: { bold: true, breakLine: true } }, + { text: "= 25,000,000 non-zero values", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Real GRN: ~20\u201350 targets per gene", options: { breakLine: true } }, + { text: "\u2192 99%+ attention values are noise", options: { bold: true, color: RED } } +], { + x: 0.85, y: 1.65, w: 3.7, h: 1.4, + fontSize: 12, fontFace: BF, color: TXT +}); +s11.addText("Evidence: latent loss \u2248 1.12 >> expr loss \u2248 0.019", { + x: 0.6, y: 3.5, w: 4.2, h: 0.25, + fontSize: 11, fontFace: BF, color: TXT_MID, italic: true +}); + +// Solution +sectionLabel(s11, "Solution: Sparse Top-K Filtering", 5.3, 1.1, 4.2); +card(s11, 5.3, 1.55, 4.2, 1.8, GREEN); +s11.addText([ + { text: "Keep only top K=30 per gene", options: { bold: true, breakLine: true } }, + { text: "(ranked by |\u0394_attn| magnitude)", options: { breakLine: true, color: TXT_MID } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "\u2192 Filters 99.4% noise", options: { bold: true, color: GREEN, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "features = sparse_\u0394_topk \u00D7 gene_emb", options: { fontFace: CF, fontSize: 11 } } +], { + x: 5.55, y: 1.65, w: 3.7, h: 1.4, + fontSize: 12, fontFace: BF, color: TXT +}); +s11.addText("Status: implemented (sparse_topk_emb mode)", { + x: 5.3, y: 3.5, w: 4.2, h: 0.25, + fontSize: 11, fontFace: BF, color: GREEN, italic: true +}); + +// Before/after comparison bar +s11.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 4.0, w: 8.8, h: 1.2, + fill: { color: BG_GRAY } +}); +s11.addText([ + { text: "Before: ", options: { bold: true } }, + { text: "\u0394_attn (G\u00D7G) \u2192 25M values \u2192 noise dominates \u2192 loss ~1.12", options: { color: RED } } +], { + x: 0.8, y: 4.1, w: 8.4, h: 0.35, + fontSize: 12, fontFace: BF, color: TXT +}); +s11.addText([ + { text: "After: ", options: { bold: true } }, + { text: "sparse_\u0394_topk (G\u00D7K) \u2192 150K values \u2192 signal preserved \u2192 loss expected \u2193", options: { color: GREEN } } +], { + x: 0.8, y: 4.55, w: 8.4, h: 0.35, + fontSize: 12, fontFace: BF, color: TXT +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 12: CHALLENGE 2 - HIGH-DIM LATENT +// ════════════════════════════════════════════════════════════ +let s12 = pres.addSlide(); +headerBar(s12, "Challenge 2: High-Dimensional Latent"); +slideNum(s12, 12); + +// Problem +sectionLabel(s12, "Problem: High-Dim Latent Prediction", 0.6, 1.1, 4.2); +card(s12, 0.6, 1.55, 4.2, 1.8, RED); +s12.addText([ + { text: "Each gene: 512-d GRN feature vector", options: { breakLine: true, bold: true } }, + { text: "Total: G\u00D7512 = 2.5M-dim velocity field", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "Ablation experiment:", options: { bold: true, breakLine: true } }, + { text: "512-d \u2192 1-d: loss drops 1.1 \u2192 0.5", options: { bold: true, color: RED } } +], { + x: 0.85, y: 1.65, w: 3.7, h: 1.5, + fontSize: 12, fontFace: BF, color: TXT +}); +s12.addText("Dimensionality is a major difficulty source", { + x: 0.6, y: 3.5, w: 4.2, h: 0.25, + fontSize: 11, fontFace: BF, color: TXT_MID, italic: true +}); + +// Solution +sectionLabel(s12, "Solution: PCA Compression", 5.3, 1.1, 4.2); +card(s12, 5.3, 1.55, 4.2, 1.8, GREEN); +s12.addText([ + { text: "PCA on gene embeddings:", options: { bold: true, breakLine: true } }, + { text: "512-d \u2192 64-d principal components", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "features = sparse_\u0394 \u00D7 pca_basis", options: { fontFace: CF, fontSize: 11, breakLine: true } }, + { text: "Output: (B, G, 64)", options: { fontFace: CF, fontSize: 11 } } +], { + x: 5.55, y: 1.65, w: 3.7, h: 1.5, + fontSize: 12, fontFace: BF, color: TXT +}); +s12.addText("Status: implemented (sparse_pca mode)", { + x: 5.3, y: 3.5, w: 4.2, h: 0.25, + fontSize: 11, fontFace: BF, color: GREEN, italic: true +}); + +// Combined pipeline +s12.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 4.0, w: 8.8, h: 1.2, + fill: { color: LT_BLUE } +}); +s12.addText("Combined Pipeline", { + x: 0.8, y: 4.05, w: 8.4, h: 0.3, + fontSize: 14, fontFace: HF, color: NAVY, bold: true, margin: 0 +}); +s12.addText("\u0394_attn \u2192 Sparse Top-K (noise filter) \u2192 PCA 512\u219264 (dim reduction) \u2192 GRN features (B, G, 64)", { + x: 0.8, y: 4.45, w: 8.4, h: 0.5, + fontSize: 13, fontFace: CF, color: TXT, valign: "middle" +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 13: SUMMARY & FUTURE WORK +// ════════════════════════════════════════════════════════════ +let s13 = pres.addSlide(); +headerBar(s13, "Summary & Future Work"); +slideNum(s13, 13); + +// Core Contribution +sectionLabel(s13, "Core Contribution", 0.6, 1.1); +s13.addText([ + { text: "First explicit GRN modeling in perturbation prediction", options: { bullet: true, breakLine: true, bold: true } }, + { text: "Cascaded flow matching: GRN first, expression second", options: { bullet: true, breakLine: true } }, + { text: "Biologically grounded: perturbation cascades through GRN", options: { bullet: true } } +], { + x: 0.6, y: 1.5, w: 8.8, h: 1.0, + fontSize: 13, fontFace: BF, color: TXT, paraSpaceAfter: 4 +}); + +// Future experiment +sectionLabel(s13, "Key Future Experiment: Validate Causal Hypothesis", 0.6, 2.7); + +const fHdr = (t) => ({ text: t, options: { bold: true, color: WHITE, fill: { color: NAVY }, fontSize: 11, fontFace: BF, align: "center" } }); +const fCell = (t, opts) => ({ text: t, options: { fontSize: 11, fontFace: BF, ...opts } }); +const fAlt = { fill: { color: "F8F9FA" } }; + +s13.addTable([ + [ fHdr("Inference Order"), fHdr("Meaning"), fHdr("Expected") ], + [ fCell("GRN \u2192 Expression", { ...fAlt, bold: true }), fCell("Understand first, then predict", fAlt), fCell("Best", { ...fAlt, bold: true, color: GREEN, align: "center" }) ], + [ fCell("Expression \u2192 GRN"), fCell("Predict first, understand later"), fCell("Suboptimal", { color: ORANGE, align: "center" }) ], + [ fCell("Simultaneous", fAlt), fCell("No explicit order", fAlt), fCell("Worst", { ...fAlt, color: RED, align: "center" }) ] +], { + x: 0.6, y: 3.15, w: 8.8, + colW: [2.5, 3.8, 2.5], + border: { pt: 0.5, color: "DDE1E6" }, + rowH: [0.4, 0.4, 0.4, 0.4] +}); + +s13.addText("If \"GRN \u2192 Expression\" wins: GRN understanding is a prerequisite, not a byproduct.", { + x: 0.6, y: 4.8, w: 8.8, h: 0.4, + fontSize: 12, fontFace: BF, color: NAVY, bold: true, italic: true +}); + +// ════════════════════════════════════════════════════════════ +// SLIDE 14: TAKE-HOME MESSAGE +// ════════════════════════════════════════════════════════════ +let s14 = pres.addSlide(); +s14.background = { color: NAVY }; +s14.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 10, h: 0.06, fill: { color: BLUE } +}); +s14.addText("Take-Home Message", { + x: 1, y: 1.0, w: 8, h: 0.6, + fontSize: 24, fontFace: HF, color: LT_BLUE, align: "center" +}); +s14.addText([ + { text: "We embed biological prior \u2014 perturbation cascades through GRN \u2014", options: { breakLine: true } }, + { text: "into generative modeling via cascaded flow matching,", options: { breakLine: true } }, + { text: "forcing the model to ", options: {} }, + { text: "\"understand regulatory rewiring", options: { bold: true } }, + { text: "", options: { breakLine: true } }, + { text: "before predicting expression changes.\"", options: { bold: true } } +], { + x: 1.0, y: 2.0, w: 8.0, h: 2.0, + fontSize: 18, fontFace: BF, color: WHITE, align: "center", valign: "middle", + paraSpaceAfter: 6 +}); +s14.addShape(pres.shapes.RECTANGLE, { + x: 3.8, y: 4.3, w: 2.4, h: 0.035, fill: { color: BLUE } +}); +s14.addText("Thank You", { + x: 1, y: 4.5, w: 8, h: 0.5, + fontSize: 20, fontFace: HF, color: TXT_LT, align: "center" +}); + +// ─── WRITE ─── +pres.writeFile({ fileName: "/home/hp250092/ku50001222/qian/aivc/lfj/Report/PPT2/GRN_CCFM_presentation.pptx" }) + .then(() => console.log("SUCCESS: Presentation saved.")) + .catch(err => console.error("ERROR:", err)); diff --git a/Report/PPT2/slide-01.jpg b/Report/PPT2/slide-01.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f22f09165472e1ad09a5320e0842cb64a5c8a9da --- /dev/null +++ b/Report/PPT2/slide-01.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bb4b4674a586f1f296253d772a268de46bb2a69ea475f3abb0033d12e383af4 +size 60997 diff --git a/Report/PPT2/slide-02.jpg b/Report/PPT2/slide-02.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4de915411c2d955870f75c9541854419da522733 --- /dev/null +++ b/Report/PPT2/slide-02.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:89597b14dce6384996d2c8fbcdd652743a1acd83577ab13e8b36c61a66b50675 +size 85935 diff --git a/Report/PPT2/slide-03.jpg b/Report/PPT2/slide-03.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c32df46c6ba320be905b3f2d53e4433b0bc115a8 --- /dev/null +++ b/Report/PPT2/slide-03.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b6f213ffee8fa9b5d3b9758f7d5b477e18ce7b066a6bf714d6d6da0ec5050791 +size 85224 diff --git a/Report/PPT2/slide-04.jpg b/Report/PPT2/slide-04.jpg new file mode 100644 index 0000000000000000000000000000000000000000..22512196053a37aeed27823e43381b1d21e3a32f --- /dev/null +++ b/Report/PPT2/slide-04.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:76fde572ded1d92d18d2659fe51828191bf78ff14380af4c46bfa166ca0a33ab +size 100287 diff --git a/Report/PPT2/slide-05.jpg b/Report/PPT2/slide-05.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9958b5ba119e7b041a79b83d0126d72a050b174b --- /dev/null +++ b/Report/PPT2/slide-05.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8badccb4ebc96454320b1e9551842258d5339b4687a13b80546baf9693921c4 +size 73108 diff --git a/Report/PPT2/slide-06.jpg b/Report/PPT2/slide-06.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2219ebc8782559999db8a43a12dfcf4a3c56bb8c --- /dev/null +++ b/Report/PPT2/slide-06.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edab95833bebbd6cfa57d78e8348ab1c791e6c603910da16592c89bd01d3f716 +size 89990 diff --git a/Report/PPT2/slide-07.jpg b/Report/PPT2/slide-07.jpg new file mode 100644 index 0000000000000000000000000000000000000000..4e6a3014e6a2a630620c592b2b304832858b7ce5 --- /dev/null +++ b/Report/PPT2/slide-07.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d57994a64e2b2b2d5b31f2ae65f3a9e4bf8c04a97a8b7046bb83745e4ef8fac0 +size 96646 diff --git a/Report/PPT2/slide-08.jpg b/Report/PPT2/slide-08.jpg new file mode 100644 index 0000000000000000000000000000000000000000..aa229d067cfec474926b86004ffae985a6fbd955 --- /dev/null +++ b/Report/PPT2/slide-08.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60ad2fd5c0f000e791edfea62429d0996eb384346cae953b442b9054b3b3fa83 +size 85839 diff --git a/Report/PPT2/slide-09.jpg b/Report/PPT2/slide-09.jpg new file mode 100644 index 0000000000000000000000000000000000000000..825140795b8d7ddf7d2cc0f5940fc81598d7ebe9 --- /dev/null +++ b/Report/PPT2/slide-09.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c348e7226dcd2b4a800b07d937b64b46ce62e9f7cbe42fa586fd71ca79e1f2b9 +size 71961 diff --git a/Report/PPT2/slide-10.jpg b/Report/PPT2/slide-10.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8805ff0cebdb42cd49ce5850ab88c07452ade7e6 --- /dev/null +++ b/Report/PPT2/slide-10.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f7db8ce9a24d198792fd769847dc5099e0651f3be7f347f3f8277c6ff43a98cf +size 98755 diff --git a/Report/PPT2/slide-11.jpg b/Report/PPT2/slide-11.jpg new file mode 100644 index 0000000000000000000000000000000000000000..85061853728f8732adb17dc767b902a9f79e2182 --- /dev/null +++ b/Report/PPT2/slide-11.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f01d32bfc3873b0674f03a474d134ceadc7f26f049ebeb70b1bfe8f070e233c7 +size 92167 diff --git a/Report/PPT2/slide-12.jpg b/Report/PPT2/slide-12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bca33a747c8e4cd028a15eafa2eee3d632dbe676 --- /dev/null +++ b/Report/PPT2/slide-12.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e756e4e94a6dba9bf4a6e945b0fd5731b08beb178423727167a798b432381fc0 +size 94757 diff --git a/Report/PPT2/slide-13.jpg b/Report/PPT2/slide-13.jpg new file mode 100644 index 0000000000000000000000000000000000000000..09e214e9189fb2f3d854a694de877535a975e64d --- /dev/null +++ b/Report/PPT2/slide-13.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bcab6e1f84bf17855f975b2fdea7f08ff7b28de97cd8c58a36d967134c4a867 +size 98721 diff --git a/Report/PPT2/slide-14.jpg b/Report/PPT2/slide-14.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a67e6cb968fbbef7504358ae59e0cbabfdb53d59 --- /dev/null +++ b/Report/PPT2/slide-14.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:868969f09a899269c667c558182bcd148b2356641d18f743754c95c533f76fb4 +size 66524 diff --git a/Report/build_pptx.js b/Report/build_pptx.js new file mode 100644 index 0000000000000000000000000000000000000000..de62be29fce39b2edb80ab9a85a9e7d13b66ae7b --- /dev/null +++ b/Report/build_pptx.js @@ -0,0 +1,703 @@ +const pptxgen = require("pptxgenjs"); + +const pres = new pptxgen(); +pres.layout = "LAYOUT_16x9"; +pres.author = "Qian"; +pres.title = "GRN-Guided Cascaded Flow Matching"; + +// === Color Palette === +const C = { + navy: "0B1D3A", + deepBlue: "0E3B5C", + teal: "0D7377", + seafoam: "14B8A6", + mint: "99F6E4", // brightened for dark bg readability + gold: "F59E0B", + orange: "F97316", + coral: "EF4444", + white: "FFFFFF", + offWhite: "F0F4F8", + lightGray: "E2E8F0", + midGray: "94A3B8", + darkGray: "334155", + textDark: "1E293B", + textMid: "475569", + accent1: "3B82F6", // blue for expression + accent2: "F59E0B", // gold for GRN/latent + accent3: "10B981", // green for bio + subtitleOnDark: "A7F3D0", // bright mint-green for subtitles on navy +}; + +const cardShadow = () => ({ type: "outer", blur: 4, offset: 2, angle: 135, color: "000000", opacity: 0.10 }); + +// Slide number — placed safely out of content area +function addSlideNum(slide, num) { + slide.addText(String(num), { + x: 9.3, y: 5.2, w: 0.5, h: 0.3, + fontSize: 8, color: C.midGray, align: "right", fontFace: "Calibri", + }); +} + +// Section divider — centered vertically, improved contrast +function addDividerSlide(title, subtitle, num) { + const s = pres.addSlide(); + s.background = { color: C.navy }; + s.addShape(pres.shapes.RECTANGLE, { x: 0.7, y: 2.0, w: 0.8, h: 0.06, fill: { color: C.seafoam } }); + s.addText(title, { + x: 0.7, y: 2.2, w: 8.6, h: 1.0, + fontSize: 36, fontFace: "Georgia", color: C.white, bold: true, margin: 0, + }); + if (subtitle) { + s.addText(subtitle, { + x: 0.7, y: 3.3, w: 8.6, h: 0.6, + fontSize: 16, fontFace: "Calibri", color: C.subtitleOnDark, margin: 0, + }); + } + addSlideNum(s, num); + return s; +} + +// Content slide — title with teal top bar +function addContentSlide(title, num) { + const s = pres.addSlide(); + s.background = { color: C.offWhite }; + s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.06, fill: { color: C.teal } }); + s.addText(title, { + x: 0.6, y: 0.15, w: 8.8, h: 0.55, + fontSize: 22, fontFace: "Georgia", color: C.textDark, bold: true, margin: 0, + }); + addSlideNum(s, num); + return s; +} + +let slideNum = 0; + +// ============================================================ +// SLIDE 1: Title +// ============================================================ +slideNum++; +{ + const s = pres.addSlide(); + s.background = { color: C.navy }; + s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.seafoam } }); + s.addShape(pres.shapes.RECTANGLE, { x: 0.7, y: 1.2, w: 1.2, h: 0.06, fill: { color: C.gold } }); + + s.addText("GRN-Guided\nCascaded Flow Matching\nfor Single-Cell Perturbation Prediction", { + x: 0.7, y: 1.4, w: 8.6, h: 2.2, + fontSize: 30, fontFace: "Georgia", color: C.white, bold: true, margin: 0, + lineSpacingMultiple: 1.35, + }); + + s.addText("Gene Regulatory Network meets Flow Matching", { + x: 0.7, y: 3.75, w: 8.6, h: 0.4, + fontSize: 14, fontFace: "Calibri", color: C.subtitleOnDark, italic: true, margin: 0, + }); + + s.addShape(pres.shapes.RECTANGLE, { x: 0.7, y: 4.35, w: 2.5, h: 0.02, fill: { color: C.midGray } }); + + s.addText("Group Meeting | 2026.03", { + x: 0.7, y: 4.5, w: 8.6, h: 0.4, + fontSize: 12, fontFace: "Calibri", color: C.lightGray, margin: 0, + }); + addSlideNum(s, slideNum); +} + +// ============================================================ +// SLIDE 2: Section — Task +// ============================================================ +slideNum++; +addDividerSlide("1. Task", "Single-Cell Perturbation Prediction", slideNum); + +// ============================================================ +// SLIDE 3: Virtual Cell + Perturbation Types +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Virtual Cell & Perturbation Types", slideNum); + + // Virtual Cell callout + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 4.2, h: 1.15, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 0.07, h: 1.15, fill: { color: C.teal } }); + s.addText([ + { text: "Virtual Cell", options: { bold: true, fontSize: 13, color: C.teal, breakLine: true } }, + { text: "AI model simulating real cell behavior: given genotype, environment, perturbation \u2192 predict molecular state changes. Perturbation prediction is its most critical subtask.", options: { fontSize: 10.5, color: C.textMid } }, + ], { x: 0.75, y: 0.95, w: 3.8, h: 1.05, valign: "top", fontFace: "Calibri", margin: 0 }); + + // Three perturbation type cards (right) + const types = [ + { title: "Drug Perturbation", desc: "Small molecules / drugs (L1000/LINCS)", color: C.accent1 }, + { title: "Cytokine Perturbation", desc: "Cytokines (IL-6, TNF-a, IFN-g) signaling", color: C.accent3 }, + { title: "Genetic Perturbation", desc: "CRISPR KO / CRISPRa OE / RNAi KD", color: C.accent2 }, + ]; + const cardX = 5.0, cardW = 4.5, cardH = 0.7; + types.forEach((t, i) => { + const yy = 0.9 + i * (cardH + 0.12); + s.addShape(pres.shapes.RECTANGLE, { x: cardX, y: yy, w: cardW, h: cardH, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: cardX, y: yy, w: 0.07, h: cardH, fill: { color: t.color } }); + s.addText(t.title, { + x: cardX + 0.2, y: yy + 0.05, w: 4.0, h: 0.28, + fontSize: 11.5, fontFace: "Calibri", bold: true, color: C.textDark, margin: 0, + }); + s.addText(t.desc, { + x: cardX + 0.2, y: yy + 0.35, w: 4.0, h: 0.3, + fontSize: 9.5, fontFace: "Calibri", color: C.textMid, margin: 0, + }); + }); + + // Focus banner + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.4, w: 9.0, h: 0.5, fill: { color: C.navy } }); + s.addText("This work: genetic perturbation (Perturb-seq) = CRISPR perturbation + scRNA-seq readout", { + x: 0.7, y: 3.42, w: 8.6, h: 0.46, + fontSize: 11.5, fontFace: "Calibri", color: C.white, bold: true, margin: 0, valign: "middle", + }); + + // Task formalization + s.addText([ + { text: "Task: ", options: { bold: true, color: C.teal, fontSize: 13 } }, + { text: "x_ctrl + perturbation ID \u2192 predict x_pert (x \u2208 R^G, G \u2248 5000 HVG)", options: { color: C.textDark, fontSize: 12, fontFace: "Consolas" } }, + ], { x: 0.5, y: 4.05, w: 9.0, h: 0.35, fontFace: "Calibri", margin: 0 }); + + // Key challenges + s.addText([ + { text: "Drug screening acceleration | Combinatorial explosion: N genes \u2192 N(N-1)/2 combos | ", options: { fontSize: 10, color: C.textMid, breakLine: false } }, + { text: "No paired data (destructive measurement)", options: { fontSize: 10, color: C.coral, bold: true } }, + ], { x: 0.5, y: 4.45, w: 9.0, h: 0.35, fontFace: "Calibri", margin: 0 }); +} + +// ============================================================ +// SLIDE 4: Section — Existing Methods +// ============================================================ +slideNum++; +addDividerSlide("2. Existing Methods", "And their common blind spot", slideNum); + +// ============================================================ +// SLIDE 5: Methods Overview Table +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Existing Methods: Overview", slideNum); + + const methods = [ + { name: "Additive Shift", cat: "Baseline", approach: "Mean shift: x = x_ctrl + delta_mean", issue: "Ignores cell heterogeneity" }, + { name: "scGPT", cat: "Foundation Model", approach: "Masked token completion (fine-tune)", issue: "Encodes absolute state, not change" }, + { name: "Geneformer", cat: "Foundation Model", approach: "In-silico: delete gene token", issue: "Heuristic, no learned dynamics" }, + { name: "CPA", cat: "Dedicated Model", approach: "VAE: basal + perturbation (additive)", issue: "Linear additivity too strong" }, + { name: "GEARS", cat: "Dedicated Model", approach: "GNN on GO graph + cross-attention", issue: "Static prior graph, deterministic" }, + { name: "STATE", cat: "Dedicated Model", approach: "Stacked attention on expression", issue: "Deterministic, no GRN modeling" }, + { name: "CellFlow", cat: "Flow Matching", approach: "FM + pretrained embedding cond.", issue: "Embedding = absolute state" }, + { name: "scDFM", cat: "Flow Matching", approach: "Conditional FM + DiffPerceiver", issue: "No GRN understanding" }, + ]; + + const hY = 0.85; + const cols = [ + { x: 0.5, w: 1.5, label: "Method" }, + { x: 2.0, w: 1.5, label: "Category" }, + { x: 3.5, w: 3.2, label: "Approach" }, + { x: 6.7, w: 2.8, label: "Key Limitation" }, + ]; + + // Header + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: hY, w: 9.0, h: 0.35, fill: { color: C.teal } }); + cols.forEach(c => { + s.addText(c.label, { + x: c.x + 0.08, y: hY, w: c.w - 0.08, h: 0.35, + fontSize: 10, fontFace: "Calibri", bold: true, color: C.white, valign: "middle", margin: 0, + }); + }); + + // Data rows + const rowH = 0.37; + methods.forEach((m, i) => { + const ry = hY + 0.35 + i * rowH; + const bgColor = i % 2 === 0 ? C.white : "F8FAFC"; + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: ry, w: 9.0, h: rowH, fill: { color: bgColor } }); + s.addText(m.name, { + x: cols[0].x + 0.08, y: ry, w: cols[0].w - 0.08, h: rowH, + fontSize: 9.5, fontFace: "Calibri", bold: true, color: C.textDark, valign: "middle", margin: 0, + }); + s.addText(m.cat, { + x: cols[1].x + 0.08, y: ry, w: cols[1].w - 0.08, h: rowH, + fontSize: 9, fontFace: "Calibri", color: C.textMid, valign: "middle", margin: 0, + }); + s.addText(m.approach, { + x: cols[2].x + 0.08, y: ry, w: cols[2].w - 0.08, h: rowH, + fontSize: 9, fontFace: "Calibri", color: C.textDark, valign: "middle", margin: 0, + }); + s.addText(m.issue, { + x: cols[3].x + 0.08, y: ry, w: cols[3].w - 0.08, h: rowH, + fontSize: 9, fontFace: "Calibri", color: C.coral, bold: true, valign: "middle", margin: 0, + }); + }); + + // Common blind spot callout + const bY = hY + 0.35 + methods.length * rowH + 0.3; + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: bY, w: 9.0, h: 0.7, fill: { color: C.navy } }); + s.addText([ + { text: "Common blind spot: ", options: { bold: true, color: C.gold, fontSize: 13 } }, + { text: "Perturbation \u2192 [black box] \u2192 Expression change", options: { color: C.white, fontSize: 13, breakLine: true } }, + { text: "No method explicitly models: Perturbation \u2192 GRN rewiring \u2192 Expression change", options: { color: C.subtitleOnDark, fontSize: 11 } }, + ], { x: 0.7, y: bY + 0.03, w: 8.6, h: 0.65, fontFace: "Calibri", valign: "middle", margin: 0 }); +} + +// ============================================================ +// SLIDE 6: Section — Motivation +// ============================================================ +slideNum++; +addDividerSlide("3. Motivation", "Why GRN + Flow Matching?", slideNum); + +// ============================================================ +// SLIDE 7: Motivation 1 — Flow Matching +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Motivation 1: Flow Matching for Unpaired Data", slideNum); + + // Problem card (left) + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 4.2, h: 1.8, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 0.07, h: 1.8, fill: { color: C.coral } }); + s.addText([ + { text: "The Pairing Problem", options: { bold: true, fontSize: 13, color: C.coral, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "Perturbation is destructive:", options: { fontSize: 11, color: C.textDark, breakLine: true } }, + { text: "One cell measured ONCE only", options: { fontSize: 11, color: C.textDark, breakLine: true } }, + { text: "No (x_ctrl, x_pert) pairs available", options: { fontSize: 11, color: C.coral, bold: true, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "Mean matching \u2192 loses heterogeneity", options: { bullet: true, fontSize: 10, color: C.textMid, breakLine: true } }, + { text: "Autoencoder \u2192 limited reconstruction", options: { bullet: true, fontSize: 10, color: C.textMid } }, + ], { x: 0.75, y: 0.95, w: 3.8, h: 1.7, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Solution card (right) + s.addShape(pres.shapes.RECTANGLE, { x: 5.0, y: 0.9, w: 4.5, h: 1.8, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 5.0, y: 0.9, w: 0.07, h: 1.8, fill: { color: C.accent3 } }); + s.addText([ + { text: "Flow Matching Solution", options: { bold: true, fontSize: 13, color: C.accent3, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "Learn probabilistic transport mapping\nbetween distributions (not individual cells)", options: { fontSize: 11, color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "Only needs population-level distributions", options: { bullet: true, fontSize: 10, color: C.textMid, breakLine: true } }, + { text: "Conditional OT for efficient pairing", options: { bullet: true, fontSize: 10, color: C.textMid, breakLine: true } }, + { text: "Generative output = uncertainty estimation", options: { bullet: true, fontSize: 10, color: C.textMid } }, + ], { x: 5.25, y: 0.95, w: 4.1, h: 1.7, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Flow diagram + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.0, w: 9.0, h: 1.6, fill: { color: C.white }, shadow: cardShadow() }); + + s.addShape(pres.shapes.OVAL, { x: 1.2, y: 3.25, w: 1.8, h: 1.1, fill: { color: "FEE2E2" } }); + s.addText("noise x\u2080", { x: 1.2, y: 3.25, w: 1.8, h: 1.1, fontSize: 12, fontFace: "Calibri", color: C.coral, align: "center", valign: "middle", bold: true, margin: 0 }); + + s.addText("v\u03B8( x, t, ctrl, pert )", { + x: 3.2, y: 3.45, w: 3.6, h: 0.5, + fontSize: 14, fontFace: "Consolas", color: C.teal, align: "center", valign: "middle", bold: true, margin: 0, + }); + s.addShape(pres.shapes.RECTANGLE, { x: 3.5, y: 3.95, w: 3.0, h: 0.04, fill: { color: C.teal } }); + s.addText("learned velocity field (ODE)", { + x: 3.2, y: 4.0, w: 3.6, h: 0.3, + fontSize: 9, fontFace: "Calibri", color: C.textMid, align: "center", margin: 0, + }); + + s.addShape(pres.shapes.OVAL, { x: 7.0, y: 3.25, w: 1.8, h: 1.1, fill: { color: "D1FAE5" } }); + s.addText("predicted\nx_pert", { x: 7.0, y: 3.25, w: 1.8, h: 1.1, fontSize: 12, fontFace: "Calibri", color: C.accent3, align: "center", valign: "middle", bold: true, margin: 0 }); +} + +// ============================================================ +// SLIDE 8: Motivation 2 — GRN Cascade +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Motivation 2: Perturbation Propagates via GRN", slideNum); + + // Cascade diagram (left) + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 5.5, h: 2.8, fill: { color: C.white }, shadow: cardShadow() }); + + const steps = [ + { text: "CRISPR knock-out Gene A", color: C.coral, bold: true }, + { text: "Gene A expression --> 0", color: C.coral, bold: false }, + { text: "Direct targets B, C, D change (1st order)", color: C.accent2, bold: false }, + { text: "B->E,F C->G,H D->I ... (cascade)", color: C.accent2, bold: false }, + { text: "Thousands of genes ultimately affected", color: C.teal, bold: true }, + ]; + steps.forEach((st, i) => { + const yy = 1.05 + i * 0.45; + s.addText((i > 0 ? " | " : " ") + st.text, { + x: 0.8, y: yy, w: 5.0, h: 0.38, + fontSize: 11, fontFace: "Calibri", color: st.color, bold: st.bold, margin: 0, + }); + }); + + s.addText("This cascade path = Gene Regulatory Network (GRN)", { + x: 0.8, y: 3.3, w: 5.0, h: 0.3, + fontSize: 11, fontFace: "Calibri", color: C.navy, bold: true, italic: true, margin: 0, + }); + + // Comparison cards (right) + s.addShape(pres.shapes.RECTANGLE, { x: 6.3, y: 0.9, w: 3.2, h: 1.2, fill: { color: "FEF3C7" }, shadow: cardShadow() }); + s.addText([ + { text: "Existing Methods", options: { bold: true, fontSize: 12, color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Pert -> [black box] -> Expr", options: { fontSize: 11, fontFace: "Consolas", color: C.coral, breakLine: true } }, + { text: "End-to-end, no GRN understanding", options: { fontSize: 10, color: C.textMid } }, + ], { x: 6.5, y: 0.95, w: 2.9, h: 1.1, fontFace: "Calibri", valign: "top", margin: 0 }); + + s.addShape(pres.shapes.RECTANGLE, { x: 6.3, y: 2.3, w: 3.2, h: 1.4, fill: { color: "D1FAE5" }, shadow: cardShadow() }); + s.addText([ + { text: "Our Approach", options: { bold: true, fontSize: 12, color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Pert -> GRN change -> Expr", options: { fontSize: 11, fontFace: "Consolas", color: C.accent3, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Explicitly model how perturbation rewires the regulatory network, then predict expression", options: { fontSize: 10, color: C.textDark } }, + ], { x: 6.5, y: 2.35, w: 2.9, h: 1.3, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Bottom insight + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 4.1, w: 9.0, h: 0.5, fill: { color: C.navy } }); + s.addText("Understanding GRN changes is a prerequisite for accurate expression prediction", { + x: 0.7, y: 4.12, w: 8.6, h: 0.46, + fontSize: 12, fontFace: "Calibri", color: C.gold, bold: true, margin: 0, valign: "middle", + }); +} + +// ============================================================ +// SLIDE 9: Motivation 3 — scGPT Attention = GRN +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Motivation 3: scGPT Attention = Data-Driven GRN", slideNum); + + // Left: explanation + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 4.5, h: 2.1, fill: { color: C.white }, shadow: cardShadow() }); + s.addText([ + { text: "scGPT Transformer Attention", options: { bold: true, fontSize: 13, color: C.teal, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "attn[i][j] high -> gene j influences gene i", options: { fontSize: 11, fontFace: "Consolas", color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "= Context-dependent, data-driven GRN", options: { fontSize: 12, color: C.navy, bold: true, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "vs static GO graph:", options: { bold: true, fontSize: 10, color: C.textMid, breakLine: true } }, + { text: "Changes with cell state (context-aware)", options: { bullet: true, fontSize: 10, color: C.textMid, breakLine: true } }, + { text: "Learned from massive scRNA-seq data", options: { bullet: true, fontSize: 10, color: C.textMid, breakLine: true } }, + { text: "Captures non-linear regulatory logic", options: { bullet: true, fontSize: 10, color: C.textMid } }, + ], { x: 0.7, y: 0.95, w: 4.1, h: 2.0, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Right: Attention-Delta + s.addShape(pres.shapes.RECTANGLE, { x: 5.3, y: 0.9, w: 4.2, h: 2.1, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 5.3, y: 0.9, w: 0.07, h: 2.1, fill: { color: C.gold } }); + s.addText([ + { text: "Attention-Delta", options: { bold: true, fontSize: 13, color: C.accent2, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 5 } }, + { text: "Same frozen scGPT, two inputs:", options: { fontSize: 11, color: C.textDark, breakLine: true } }, + { text: "attn_ctrl = scGPT(x_ctrl)", options: { fontSize: 10.5, fontFace: "Consolas", color: C.accent1, breakLine: true } }, + { text: "attn_pert = scGPT(x_pert)", options: { fontSize: 10.5, fontFace: "Consolas", color: C.coral, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "delta_attn = attn_pert - attn_ctrl", options: { fontSize: 11, fontFace: "Consolas", color: C.navy, bold: true, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Directly captures how perturbation\nrewires gene regulatory relationships", options: { fontSize: 10, color: C.textDark } }, + ], { x: 5.55, y: 0.95, w: 3.8, h: 2.0, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Bottom: GRN features formula + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.3, w: 9.0, h: 1.25, fill: { color: C.navy } }); + s.addText([ + { text: "GRN Change Features:", options: { bold: true, fontSize: 14, color: C.gold, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "z = delta_attn x gene_embeddings", options: { fontSize: 17, fontFace: "Consolas", color: C.white, breakLine: true } }, + { text: " (G x G) (G x 512) --> (G x 512)", options: { fontSize: 11, fontFace: "Consolas", color: C.subtitleOnDark } }, + ], { x: 0.7, y: 3.35, w: 8.6, h: 1.15, fontFace: "Calibri", valign: "top", margin: 0 }); +} + +// ============================================================ +// SLIDE 10: Section — Our Method +// ============================================================ +slideNum++; +addDividerSlide("4. Our Method", "GRN-Guided Cascaded Flow Matching", slideNum); + +// ============================================================ +// SLIDE 11: Two-Stage Cascaded FM +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Two-Stage Cascaded Flow Matching", slideNum); + + // Stage 1 card + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 4.0, h: 2.0, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 0.07, h: 2.0, fill: { color: C.gold } }); + s.addText([ + { text: "Stage 1: GRN Latent Flow", options: { bold: true, fontSize: 13, color: C.accent2, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "noise ==(ODE)==> GRN features", options: { fontSize: 12, fontFace: "Consolas", color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "\"Understand how gene regulation\n changes under perturbation\"", options: { fontSize: 11, color: C.accent2, italic: true, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "t_latent: 0 -> 1", options: { fontSize: 10, fontFace: "Consolas", color: C.textMid, breakLine: true } }, + { text: "t_expr = 0 (expression frozen)", options: { fontSize: 10, fontFace: "Consolas", color: C.textMid } }, + ], { x: 0.75, y: 0.95, w: 3.6, h: 1.9, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Arrow + s.addShape(pres.shapes.RECTANGLE, { x: 4.6, y: 1.75, w: 0.7, h: 0.04, fill: { color: C.teal } }); + s.addText(">", { x: 5.0, y: 1.55, w: 0.5, h: 0.5, fontSize: 24, color: C.teal, align: "center", valign: "middle", fontFace: "Calibri", bold: true, margin: 0 }); + + // Stage 2 card + s.addShape(pres.shapes.RECTANGLE, { x: 5.5, y: 0.9, w: 4.0, h: 2.0, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 5.5, y: 0.9, w: 0.07, h: 2.0, fill: { color: C.accent1 } }); + s.addText([ + { text: "Stage 2: Expression Flow", options: { bold: true, fontSize: 13, color: C.accent1, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "noise ==(ODE)==> expression", options: { fontSize: 12, fontFace: "Consolas", color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "\"Based on GRN understanding,\n predict gene expression changes\"", options: { fontSize: 11, color: C.accent1, italic: true, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 6 } }, + { text: "t_expr: 0 -> 1", options: { fontSize: 10, fontFace: "Consolas", color: C.textMid, breakLine: true } }, + { text: "t_latent = 1 (GRN complete)", options: { fontSize: 10, fontFace: "Consolas", color: C.textMid } }, + ], { x: 5.75, y: 0.95, w: 3.6, h: 1.9, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Bio intuition banner + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.15, w: 9.0, h: 0.55, fill: { color: C.navy } }); + s.addText("Bio intuition: First understand HOW regulation changes, THEN predict WHAT expression changes", { + x: 0.7, y: 3.18, w: 8.6, h: 0.5, + fontSize: 12, fontFace: "Calibri", color: C.gold, bold: true, margin: 0, valign: "middle", + }); + + // Training note card + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.95, w: 9.0, h: 0.85, fill: { color: C.white }, shadow: cardShadow() }); + s.addText([ + { text: "Cascaded Training: ", options: { bold: true, fontSize: 12, color: C.teal } }, + { text: "Probabilistic switching (not simultaneous)", options: { fontSize: 12, color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "40% Train Latent Flow: t_latent random, t_expr=0, loss_latent only", options: { fontSize: 10, fontFace: "Consolas", color: C.accent2, breakLine: true } }, + { text: "60% Train Expr Flow: t_expr random, t_latent~1, loss_expr only", options: { fontSize: 10, fontFace: "Consolas", color: C.accent1 } }, + ], { x: 0.7, y: 4.0, w: 8.6, h: 0.75, fontFace: "Calibri", valign: "top", margin: 0 }); +} + +// ============================================================ +// SLIDE 12: Model Architecture +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Model Architecture", slideNum); + + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.85, w: 9.0, h: 4.2, fill: { color: C.white }, shadow: cardShadow() }); + + // --- Top: Two input streams --- + s.addShape(pres.shapes.RECTANGLE, { x: 0.8, y: 1.0, w: 3.5, h: 0.6, fill: { color: "DBEAFE" } }); + s.addText([ + { text: "Expression Stream", options: { bold: true, fontSize: 11, color: C.accent1, breakLine: true } }, + { text: "GeneEnc(id) + ValueEnc(x_t, x_ctrl) -> tokens", options: { fontSize: 8.5, fontFace: "Consolas", color: C.textMid } }, + ], { x: 0.9, y: 1.03, w: 3.3, h: 0.55, fontFace: "Calibri", valign: "middle", margin: 0 }); + + s.addShape(pres.shapes.RECTANGLE, { x: 5.7, y: 1.0, w: 3.5, h: 0.6, fill: { color: "FEF3C7" } }); + s.addText([ + { text: "Latent Stream (GRN)", options: { bold: true, fontSize: 11, color: C.accent2, breakLine: true } }, + { text: "LatentEmbedder(z_t) -> tokens", options: { fontSize: 8.5, fontFace: "Consolas", color: C.textMid } }, + ], { x: 5.8, y: 1.03, w: 3.3, h: 0.55, fontFace: "Calibri", valign: "middle", margin: 0 }); + + // Plus + s.addShape(pres.shapes.OVAL, { x: 4.5, y: 1.05, w: 0.5, h: 0.5, fill: { color: C.teal } }); + s.addText("+", { x: 4.5, y: 1.05, w: 0.5, h: 0.5, fontSize: 20, color: C.white, align: "center", valign: "middle", bold: true, margin: 0 }); + + // Down arrow + s.addText("|", { x: 4.5, y: 1.6, w: 0.5, h: 0.3, fontSize: 14, color: C.teal, align: "center", valign: "middle", margin: 0 }); + s.addText("V", { x: 4.5, y: 1.8, w: 0.5, h: 0.2, fontSize: 10, color: C.teal, align: "center", valign: "middle", margin: 0 }); + + // --- Shared Backbone --- + s.addShape(pres.shapes.RECTANGLE, { x: 1.5, y: 2.1, w: 3.8, h: 1.5, fill: { color: C.teal } }); + s.addText([ + { text: "Shared Backbone", options: { bold: true, fontSize: 13, color: C.white, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 3 } }, + { text: "DiffPerceiverBlock x 4", options: { fontSize: 11, color: C.mint, breakLine: true } }, + { text: "(GeneadaLN + Adapter + DiffAttn)", options: { fontSize: 9, color: C.mint, breakLine: true } }, + { text: "d_model = 512", options: { fontSize: 10, fontFace: "Consolas", color: C.white } }, + ], { x: 1.6, y: 2.15, w: 3.6, h: 1.4, fontFace: "Calibri", valign: "middle", align: "center", margin: 0 }); + + // --- Conditioning box --- + s.addShape(pres.shapes.RECTANGLE, { x: 6.0, y: 2.1, w: 3.2, h: 0.55, fill: { color: "E0E7FF" } }); + s.addText("c = t_expr + t_latent + pert_emb", { + x: 6.05, y: 2.1, w: 3.1, h: 0.55, + fontSize: 9, fontFace: "Consolas", color: C.accent1, valign: "middle", align: "center", margin: 0, + }); + s.addText("Cond.", { + x: 5.35, y: 2.15, w: 0.6, h: 0.45, + fontSize: 8, fontFace: "Calibri", color: C.textMid, valign: "middle", align: "center", margin: 0, + }); + + // --- Frozen scGPT box --- + s.addShape(pres.shapes.RECTANGLE, { x: 6.0, y: 2.9, w: 3.2, h: 1.65, fill: { color: "F1F5F9" }, line: { color: C.midGray, width: 1, dashType: "dash" } }); + s.addText([ + { text: "Frozen scGPT", options: { bold: true, fontSize: 11, color: C.darkGray, breakLine: true } }, + { text: "(no gradient)", options: { fontSize: 8, color: C.midGray, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 3 } }, + { text: "x_ctrl, x_pert", options: { fontSize: 9, fontFace: "Consolas", color: C.accent1, breakLine: true } }, + { text: " -> attention layer 11", options: { fontSize: 9, fontFace: "Consolas", color: C.midGray, breakLine: true } }, + { text: "delta_attn x gene_emb", options: { fontSize: 9, fontFace: "Consolas", color: C.accent2, breakLine: true } }, + { text: " -> z_target (B,G,512)", options: { fontSize: 9, fontFace: "Consolas", color: C.accent2 } }, + ], { x: 6.1, y: 2.95, w: 3.0, h: 1.55, fontFace: "Calibri", valign: "top", margin: 0 }); + + // --- Two decoder heads --- + s.addShape(pres.shapes.RECTANGLE, { x: 1.5, y: 3.9, w: 1.7, h: 0.6, fill: { color: "DBEAFE" } }); + s.addText([ + { text: "Expr Head", options: { bold: true, fontSize: 10, color: C.accent1, breakLine: true } }, + { text: "v_expr (B,G)", options: { fontSize: 9, fontFace: "Consolas", color: C.textMid } }, + ], { x: 1.5, y: 3.93, w: 1.7, h: 0.55, fontFace: "Calibri", valign: "middle", align: "center", margin: 0 }); + + s.addShape(pres.shapes.RECTANGLE, { x: 3.6, y: 3.9, w: 1.7, h: 0.6, fill: { color: "FEF3C7" } }); + s.addText([ + { text: "Latent Head", options: { bold: true, fontSize: 10, color: C.accent2, breakLine: true } }, + { text: "v_latent (B,G,512)", options: { fontSize: 9, fontFace: "Consolas", color: C.textMid } }, + ], { x: 3.6, y: 3.93, w: 1.7, h: 0.55, fontFace: "Calibri", valign: "middle", align: "center", margin: 0 }); +} + +// ============================================================ +// SLIDE 13: Section — Challenges +// ============================================================ +slideNum++; +addDividerSlide("5. Current Challenges", "And proposed solutions", slideNum); + +// ============================================================ +// SLIDE 14: Challenges + Solutions +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Challenges & Solutions", slideNum); + + // Challenge 1 (top-left) + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 4.3, h: 2.0, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.9, w: 0.07, h: 2.0, fill: { color: C.coral } }); + s.addText([ + { text: "Challenge 1: Noise in Attention", options: { bold: true, fontSize: 12, color: C.coral, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Attention: 5000x5000 = 25M non-zero values", options: { fontSize: 10, color: C.textDark, breakLine: true } }, + { text: "Real GRN: ~20-50 regulators per gene", options: { fontSize: 10, color: C.textDark, breakLine: true } }, + { text: "99%+ values are noise!", options: { fontSize: 11, color: C.coral, bold: true, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Evidence: latent loss ~ 1.12", options: { fontSize: 10, color: C.textMid, breakLine: true } }, + { text: " >> expr loss ~ 0.019", options: { fontSize: 10, color: C.textMid } }, + ], { x: 0.75, y: 0.95, w: 3.9, h: 1.9, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Solution 1 (top-right) + s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 0.9, w: 4.3, h: 2.0, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 0.9, w: 0.07, h: 2.0, fill: { color: C.accent3 } }); + s.addText([ + { text: "Solution: Sparse Top-K", options: { bold: true, fontSize: 12, color: C.accent3, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Per gene: keep only K=30 largest |delta|", options: { fontSize: 10, color: C.textDark, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "delta_attn (GxG) 25M values", options: { fontSize: 9.5, fontFace: "Consolas", color: C.coral, breakLine: true } }, + { text: " -> top-K sparsification", options: { fontSize: 9.5, fontFace: "Consolas", color: C.textMid, breakLine: true } }, + { text: "sparse_delta (Gx30) filter 99.4%", options: { fontSize: 9.5, fontFace: "Consolas", color: C.accent3, breakLine: true } }, + { text: " -> x gene_emb = (G,512)", options: { fontSize: 9.5, fontFace: "Consolas", color: C.accent3 } }, + ], { x: 5.45, y: 0.95, w: 3.9, h: 1.9, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Challenge 2 (bottom-left) + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.2, w: 4.3, h: 1.2, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 3.2, w: 0.07, h: 1.2, fill: { color: C.coral } }); + s.addText([ + { text: "Challenge 2: 512-d Latent Too Hard", options: { bold: true, fontSize: 12, color: C.coral, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "(G,512) = 2.5M-dim velocity field per step", options: { fontSize: 10, color: C.textDark, breakLine: true } }, + { text: "Ablation: dim 512->1: loss 1.1 -> 0.5-0.7", options: { fontSize: 10, fontFace: "Consolas", color: C.textDark } }, + ], { x: 0.75, y: 3.25, w: 3.9, h: 1.1, fontFace: "Calibri", valign: "top", margin: 0 }); + + // Solution 2 (bottom-right) + s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 3.2, w: 4.3, h: 1.2, fill: { color: C.white }, shadow: cardShadow() }); + s.addShape(pres.shapes.RECTANGLE, { x: 5.2, y: 3.2, w: 0.07, h: 1.2, fill: { color: C.accent3 } }); + s.addText([ + { text: "Solution: PCA Reduction", options: { bold: true, fontSize: 12, color: C.accent3, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "sparse_delta x pca_basis -> (G, 64)", options: { fontSize: 10, fontFace: "Consolas", color: C.textDark, breakLine: true } }, + { text: "Keep principal directions, 8x reduction", options: { fontSize: 10, color: C.textMid } }, + ], { x: 5.45, y: 3.25, w: 3.9, h: 1.1, fontFace: "Calibri", valign: "top", margin: 0 }); +} + +// ============================================================ +// SLIDE 15: Section — Summary +// ============================================================ +slideNum++; +addDividerSlide("6. Summary & Future Work", "Validating the biological hypothesis", slideNum); + +// ============================================================ +// SLIDE 16: Summary + Future Experiment +// ============================================================ +slideNum++; +{ + const s = addContentSlide("Summary & Key Future Experiment", slideNum); + + // Core contribution + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 0.85, w: 9.0, h: 0.9, fill: { color: C.navy } }); + s.addText([ + { text: "Core contribution: ", options: { bold: true, color: C.gold, fontSize: 12 } }, + { text: "Not architectural improvement -- biological mechanism-driven modeling", options: { color: C.white, fontSize: 12, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 3 } }, + { text: "Existing: Pert -> [black box] -> Expr ", options: { fontSize: 10, fontFace: "Consolas", color: C.midGray } }, + { text: "Ours: Pert -> GRN rewiring -> Expr", options: { fontSize: 10, fontFace: "Consolas", color: C.subtitleOnDark } }, + ], { x: 0.7, y: 0.88, w: 8.6, h: 0.85, fontFace: "Calibri", valign: "middle", margin: 0 }); + + // Future experiment + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 2.0, w: 9.0, h: 2.3, fill: { color: C.white }, shadow: cardShadow() }); + s.addText([ + { text: "Key Future Experiment: Does inference order matter?", options: { bold: true, fontSize: 14, color: C.teal, breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 4 } }, + { text: "Train with random t1, t2 (no cascade). Compare inference orders:", options: { fontSize: 11, color: C.textDark } }, + ], { x: 0.7, y: 2.05, w: 8.6, h: 0.7, fontFace: "Calibri", valign: "top", margin: 0 }); + + const rows = [ + { order: "GRN first -> Expr", meaning: "Understand regulation, then predict", expected: "Best", bg: "D1FAE5", color: C.accent3 }, + { order: "Expr first -> GRN", meaning: "Predict first, understand after", expected: "Suboptimal", bg: "FEF3C7", color: C.accent2 }, + { order: "Simultaneous", meaning: "No explicit order", expected: "Worst", bg: "FEE2E2", color: C.coral }, + ]; + rows.forEach((r, i) => { + const ry = 2.85 + i * 0.45; + s.addShape(pres.shapes.RECTANGLE, { x: 0.8, y: ry, w: 8.4, h: 0.38, fill: { color: r.bg } }); + s.addText(r.order, { + x: 0.9, y: ry, w: 2.8, h: 0.38, + fontSize: 11, fontFace: "Consolas", color: C.textDark, bold: true, valign: "middle", margin: 0, + }); + s.addText(r.meaning, { + x: 3.8, y: ry, w: 3.2, h: 0.38, + fontSize: 10, fontFace: "Calibri", color: C.textMid, valign: "middle", margin: 0, + }); + s.addText(r.expected, { + x: 7.2, y: ry, w: 1.8, h: 0.38, + fontSize: 12, fontFace: "Calibri", color: r.color, bold: true, valign: "middle", align: "center", margin: 0, + }); + }); + + // Hypothesis + s.addShape(pres.shapes.RECTANGLE, { x: 0.5, y: 4.55, w: 9.0, h: 0.5, fill: { color: C.navy } }); + s.addText([ + { text: "Hypothesis: ", options: { bold: true, color: C.gold, fontSize: 12 } }, + { text: "Understanding GRN changes is a prerequisite for expression prediction, not a byproduct.", options: { color: C.white, fontSize: 12 } }, + ], { x: 0.7, y: 4.57, w: 8.6, h: 0.46, fontFace: "Calibri", valign: "middle", margin: 0 }); +} + +// ============================================================ +// SLIDE 17: Closing +// ============================================================ +slideNum++; +{ + const s = pres.addSlide(); + s.background = { color: C.navy }; + s.addShape(pres.shapes.RECTANGLE, { x: 0, y: 0, w: 10, h: 0.08, fill: { color: C.seafoam } }); + + s.addShape(pres.shapes.RECTANGLE, { x: 0.7, y: 1.5, w: 1.0, h: 0.06, fill: { color: C.gold } }); + + s.addText("Takeaway", { + x: 0.7, y: 1.7, w: 8.6, h: 0.5, + fontSize: 18, fontFace: "Georgia", color: C.white, bold: true, margin: 0, + }); + + s.addText("Use scGPT attention-delta to explicitly extract perturbation-induced GRN changes, and through cascaded flow matching, force the model to \"first understand how GRN changes, then predict how expression changes\" -- embedding the biological prior that perturbation propagates through GRN into the generative model's inference process.", { + x: 0.7, y: 2.4, w: 8.6, h: 2.0, + fontSize: 16, fontFace: "Georgia", color: C.white, lineSpacingMultiple: 1.5, margin: 0, + }); + + s.addShape(pres.shapes.RECTANGLE, { x: 0.7, y: 4.6, w: 2.5, h: 0.02, fill: { color: C.midGray } }); + s.addText("Thank you!", { + x: 0.7, y: 4.75, w: 8.6, h: 0.45, + fontSize: 16, fontFace: "Georgia", color: C.white, bold: true, margin: 0, + }); + addSlideNum(s, slideNum); +} + +// === Save === +const outPath = "/home/hp250092/ku50001222/qian/aivc/lfj/Report/GRN_CCFM_group_meeting.pptx"; +pres.writeFile({ fileName: outPath }).then(() => { + console.log("Saved to: " + outPath); +}).catch(err => { + console.error("Error:", err); +}); diff --git a/Report/week10/GRN_Progress_Report.pdf b/Report/week10/GRN_Progress_Report.pdf new file mode 100644 index 0000000000000000000000000000000000000000..08327ce4469dac4492fd1ff57280962c3b81d357 --- /dev/null +++ b/Report/week10/GRN_Progress_Report.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c202c96142417b70f03e2f2df5df8756e82b87b20cdc5cc260442d0b3973d425 +size 228576 diff --git a/Report/week10/GRN_Progress_Report.pptx b/Report/week10/GRN_Progress_Report.pptx new file mode 100644 index 0000000000000000000000000000000000000000..79f53ad2031edd369c8e5d062713ca3192844ce6 --- /dev/null +++ b/Report/week10/GRN_Progress_Report.pptx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:784e7892790d73089573d185c67036ff63ed5cf9ee786620e169ad5d39ab8bba +size 668124 diff --git a/Report/week10/gen_pptx.js b/Report/week10/gen_pptx.js new file mode 100644 index 0000000000000000000000000000000000000000..4a276cd4b4f7bc2965e12da1001b37096def2972 --- /dev/null +++ b/Report/week10/gen_pptx.js @@ -0,0 +1,874 @@ +const pptxgen = require("pptxgenjs"); + +const pres = new pptxgen(); +pres.layout = "LAYOUT_16x9"; +pres.author = "Qian"; +pres.title = "GRN-Guided Perturbation Prediction"; + +// ── Design Tokens ────────────────────────────────────────────────── +const C = { + primary: "990011", // cherry red + primaryLt: "B8001A", // lighter red + accent: "2F3C7E", // navy accent + dark: "1A1A2E", // near-black for title slides + white: "FFFFFF", + offWhite: "FCF6F5", + lightGray: "F5F0EE", + midGray: "AAAAAA", + darkText: "2D2D2D", + bodyText: "3A3A3A", + tableHead: "990011", + tableAlt: "FDF2F2", + green: "2E7D32", + red: "C62828", +}; +const FONT_H = "Georgia"; +const FONT_B = "Calibri"; + +// ── Helper: section divider bar (top) ────────────────────────────── +function addTopBar(slide) { + slide.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 10, h: 0.06, + fill: { color: C.primary }, + }); +} + +// ── Helper: slide number ─────────────────────────────────────────── +function addSlideNum(slide, num) { + slide.addText(String(num), { + x: 9.2, y: 5.15, w: 0.6, h: 0.35, + fontSize: 10, fontFace: FONT_B, color: C.midGray, align: "right", + }); +} + +// ── Helper: content slide title ──────────────────────────────────── +function addTitle(slide, title, num) { + addTopBar(slide); + slide.addText(title, { + x: 0.6, y: 0.25, w: 8.8, h: 0.55, + fontSize: 28, fontFace: FONT_H, color: C.primary, bold: true, margin: 0, + }); + // thin separator + slide.addShape(pres.shapes.LINE, { + x: 0.6, y: 0.85, w: 8.8, h: 0, + line: { color: C.primary, width: 1.2 }, + }); + addSlideNum(slide, num); +} + +// ── Helper: bullet list ──────────────────────────────────────────── +function bullets(items, opts = {}) { + return items.map((t, i) => ({ + text: typeof t === "string" ? t : t.text, + options: { + bullet: { code: "2022" }, + breakLine: i < items.length - 1, + fontSize: opts.fontSize || 14, + fontFace: FONT_B, + color: opts.color || C.bodyText, + bold: (typeof t === "object" && t.bold) || false, + indentLevel: (typeof t === "object" && t.indent) || 0, + paraSpaceAfter: 6, + }, + })); +} + +// ── Helper: table with standard styling ──────────────────────────── +function styledTable(headerRow, dataRows, opts = {}) { + const hdrCells = headerRow.map((h) => ({ + text: h, options: { + bold: true, color: C.white, fill: { color: C.tableHead }, + fontSize: 11, fontFace: FONT_B, align: "center", valign: "middle", + }, + })); + const bodyRows = dataRows.map((row, ri) => + row.map((cell) => { + const isObj = typeof cell === "object" && cell !== null; + return { + text: isObj ? cell.text : String(cell), + options: { + fontSize: 11, fontFace: FONT_B, color: C.darkText, + fill: { color: ri % 2 === 0 ? C.white : C.tableAlt }, + align: isObj && cell.align ? cell.align : "center", + valign: "middle", + bold: isObj && cell.bold ? true : false, + }, + }; + }) + ); + return { rows: [hdrCells, ...bodyRows], opts }; +} + +// ==================================================================== +// SLIDE 1 — Title +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.dark }; + // accent bar left + s.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.primary }, + }); + s.addText("GRN-Guided Perturbation Prediction", { + x: 0.7, y: 1.2, w: 8.6, h: 1.2, + fontSize: 36, fontFace: FONT_H, color: C.white, bold: true, margin: 0, + }); + s.addText("From Cascaded Flow Matching to RegFM", { + x: 0.7, y: 2.4, w: 8.6, h: 0.6, + fontSize: 20, fontFace: FONT_B, color: C.primaryLt, margin: 0, + }); + s.addShape(pres.shapes.LINE, { + x: 0.7, y: 3.2, w: 3, h: 0, + line: { color: C.primary, width: 2 }, + }); + s.addText("Weekly Research Progress Report | 2026-03-29", { + x: 0.7, y: 3.5, w: 8.6, h: 0.4, + fontSize: 14, fontFace: FONT_B, color: "CCCCCC", margin: 0, + }); +} + +// ==================================================================== +// SLIDE 2 — Task Overview +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Task: Single-Cell Perturbation Prediction", 2); + + // Left column — description + s.addText(bullets([ + "Input: control expression + perturbed gene(s)", + "Output: post-perturbation expression", + "No cell-level pairing (destructive assay)", + "Eval: DE overlap, Pearson, MSE, etc.", + ]), { x: 0.6, y: 1.15, w: 4.5, h: 2.2 }); + + // Right column — dataset card + s.addShape(pres.shapes.RECTANGLE, { + x: 5.5, y: 1.15, w: 4.0, h: 2.3, + fill: { color: C.lightGray }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 5.5, y: 1.15, w: 4.0, h: 0.4, + fill: { color: C.primary }, + }); + s.addText("Norman Dataset", { + x: 5.5, y: 1.15, w: 4.0, h: 0.4, + fontSize: 13, fontFace: FONT_B, color: C.white, bold: true, align: "center", valign: "middle", + }); + s.addText(bullets([ + "~9,000 cells x 5,000 HVG", + "105 CRISPR perturbations (KO + OE)", + "39 held-out test perturbations", + "Fold-1 split (additive)", + ], { fontSize: 12 }), { x: 5.7, y: 1.65, w: 3.6, h: 1.7 }); + + // Formalization box + s.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 3.7, w: 8.8, h: 1.4, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 3.7, w: 0.08, h: 1.4, + fill: { color: C.primary }, + }); + s.addText([ + { text: "Formal Definition", options: { bold: true, fontSize: 14, fontFace: FONT_H, color: C.primary, breakLine: true, paraSpaceAfter: 4 } }, + { text: "Given: x_ctrl in R^G (control expression), p in {gene_1, gene_2} (perturbation)", options: { fontSize: 12, fontFace: FONT_B, color: C.bodyText, breakLine: true, paraSpaceAfter: 2 } }, + { text: "Predict: x_pert in R^G (post-perturbation expression)", options: { fontSize: 12, fontFace: FONT_B, color: C.bodyText } }, + ], { x: 0.9, y: 3.8, w: 8.3, h: 1.2 }); +} + +// ==================================================================== +// SLIDE 3 — Baseline: scDFM +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Baseline: scDFM (Flow Matching)", 3); + + s.addText(bullets([ + "Learns velocity field v(x, t) via flow matching", + "Transports control distribution to perturbed", + "DiffPerceiverBlock backbone (d=128, 4 layers)", + "ODE solver: RK4, 20 steps", + ]), { x: 0.6, y: 1.15, w: 5.0, h: 2.0 }); + + // Metrics callout cards + const metrics = [ + { label: "Pearson Delta", value: "0.866" }, + { label: "MSE", value: "0.0032" }, + { label: "DE Direction", value: "93.7%" }, + { label: "Discrimination", value: "0.980" }, + ]; + metrics.forEach((m, i) => { + const mx = 0.6 + i * 2.3; + s.addShape(pres.shapes.RECTANGLE, { + x: mx, y: 2.9, w: 2.1, h: 1.5, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: mx, y: 2.9, w: 2.1, h: 0.06, + fill: { color: C.primary }, + }); + s.addText(m.value, { + x: mx, y: 3.1, w: 2.1, h: 0.6, + fontSize: 26, fontFace: FONT_H, color: C.primary, bold: true, align: "center", margin: 0, + }); + s.addText(m.label, { + x: mx, y: 3.7, w: 2.1, h: 0.4, + fontSize: 12, fontFace: FONT_B, color: "777777", align: "center", margin: 0, + }); + }); + + // Limitation note + s.addText([ + { text: "Limitation: ", options: { bold: true, fontSize: 13, color: C.red } }, + { text: "Genes treated as unstructured vector; no GRN modeling", options: { fontSize: 13, color: C.bodyText } }, + ], { x: 0.6, y: 4.7, w: 8.8, h: 0.3, fontFace: FONT_B }); +} + +// ==================================================================== +// SLIDE 4 — GRN-CCFM: Cascaded Approach +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "GRN-CCFM: Cascaded Approach", 4); + + // Core idea + s.addText([ + { text: "Core Idea", options: { bold: true, fontSize: 16, fontFace: FONT_H, color: C.primary, breakLine: true, paraSpaceAfter: 6 } }, + { text: "Extract Attention-Delta from scGPT to capture GRN change, then use LatentForcing cascade to jointly generate GRN features and gene expression.", options: { fontSize: 13, fontFace: FONT_B, color: C.bodyText } }, + ], { x: 0.6, y: 1.15, w: 8.8, h: 1.0 }); + + // Three pillars + const pillars = [ + { title: "Attention-Delta", items: ["delta_attn = attn_tgt - attn_ctrl", "Captures regulatory change", "Sparse G x G matrix (~0.6%)"] }, + { title: "Cascaded Training", items: ["40% steps: latent flow only", "60% steps: expression flow only", "Two-stage ODE at inference"] }, + { title: "Architecture Fix", items: ["d_model: 128 -> 512", "Missing gene mask (7 sites)", "scGPT vocab alignment"] }, + ]; + pillars.forEach((p, i) => { + const px = 0.6 + i * 3.1; + s.addShape(pres.shapes.RECTANGLE, { + x: px, y: 2.4, w: 2.8, h: 2.8, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: px, y: 2.4, w: 2.8, h: 0.45, + fill: { color: C.primary }, + }); + s.addText(p.title, { + x: px, y: 2.4, w: 2.8, h: 0.45, + fontSize: 13, fontFace: FONT_B, color: C.white, bold: true, align: "center", valign: "middle", + }); + s.addText(bullets(p.items, { fontSize: 11 }), { + x: px + 0.15, y: 3.0, w: 2.5, h: 2.0, + }); + }); +} + +// ==================================================================== +// SLIDE 5 — Cascaded Variants Overview +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Cascaded Variants: Design Space", 5); + + const tbl = styledTable( + ["Variant", "Latent Dim", "Agg. Method", "delta_topk", "Key Idea"], + [ + ["grn_att_only", "128 (bilinear)", "Bilinear head", "30", "Attention only, no SVD"], + ["grn_svd", "128", "SVD dictionary", "30", "Fixed SVD basis"], + ["grn_svd_cross", "128", "SVD + cross-attn", "30", "Learnable SVD queries"], + ["grn_dense4", "4", "Multi-stats", "30", "Low-dim dense features"], + ["grn_scalar", "1", "signed_L2 + norm", "100", "Scalar latent per gene"], + ["dim1_ablation", "1", "Slice scGPT[0]", "30", "Ablation: 512d -> 1d"], + ] + ); + s.addTable(tbl.rows, { + x: 0.5, y: 1.15, w: 9.0, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [1.5, 1.3, 1.5, 1.0, 3.7], + rowH: [0.38, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35], + autoPage: false, + }); + + // Shared config note + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 3.85, w: 9.0, h: 1.3, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 3.85, w: 0.08, h: 1.3, + fill: { color: C.accent }, + }); + s.addText([ + { text: "Shared Config", options: { bold: true, fontSize: 13, fontFace: FONT_H, color: C.accent, breakLine: true, paraSpaceAfter: 4 } }, + ], { x: 0.8, y: 3.95, w: 8.5, h: 0.3 }); + s.addText(bullets([ + "d_model=128, nlayers=4, nhead=8, lr=5e-5, EMA=0.9999", + "Cascaded: choose_latent_p=0.4, latent_weight=1.0", + "Inference: RK4 ODE, 20 steps each stage", + ], { fontSize: 11 }), { x: 0.8, y: 4.25, w: 8.5, h: 0.8 }); +} + +// ==================================================================== +// SLIDE 6 — Cascaded Results +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Cascaded Results: Evaluation Metrics", 6); + + const tbl = styledTable( + ["Model", "Pearson Delta", "MSE", "DE Direction", "Discrim."], + [ + [{ text: "scDFM Baseline", bold: true }, { text: "0.866", bold: true }, { text: "0.0032", bold: true }, { text: "0.937", bold: true }, { text: "0.980", bold: true }], + [{ text: "dim1_ablation", bold: true }, { text: "0.752", bold: true }, "0.0059", "0.878", "0.914"], + ["grn_dense4", "0.122", "0.020", "0.780", "0.521"], + ["grn_scalar (dtk100)", "0.087", "0.021", "0.793", "0.534"], + ["grn_scalar (bs48)", "0.068", "0.026", "0.771", "0.533"], + ["grn_att_only", "-0.097", "0.602", "0.747", "0.552"], + ["grn_svd / svd_cross", "-0.096", "0.575", "0.746", "0.492"], + ] + ); + s.addTable(tbl.rows, { + x: 0.5, y: 1.15, w: 9.0, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [2.2, 1.7, 1.3, 1.6, 1.4], + rowH: [0.4, 0.36, 0.36, 0.36, 0.36, 0.36, 0.36, 0.36], + autoPage: false, + }); + + // Insight box + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 4.2, w: 9.0, h: 1.05, + fill: { color: "FFF5F5" }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 4.2, w: 0.08, h: 1.05, + fill: { color: C.red }, + }); + s.addText(bullets([ + { text: "Only dim1 (d=1) approaches baseline; all high-dim cascaded variants fail", bold: true }, + "High-dim latent generation is the fundamental bottleneck", + "grn_att_only / grn_svd: negative Pearson, MSE > 0.5", + ], { fontSize: 12 }), { x: 0.8, y: 4.25, w: 8.5, h: 0.95 }); +} + +// ==================================================================== +// SLIDE 7 — Failure Analysis +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Failure Analysis: Why Cascaded Fails", 7); + + // Left: problem + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 1.15, w: 4.3, h: 3.5, + fill: { color: "FFF5F5" }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 1.15, w: 4.3, h: 0.45, + fill: { color: C.red }, + }); + s.addText("Root Cause", { + x: 0.5, y: 1.15, w: 4.3, h: 0.45, + fontSize: 14, fontFace: FONT_B, color: C.white, bold: true, align: "center", valign: "middle", + }); + s.addText(bullets([ + "Latent loss stuck at ~1.0-2.0", + "Target: sparse G x G matrix (~0.6% non-zero)", + "Generating GRN is itself a hard problem", + "Decoupled training prevents joint optimization", + "Expression flow never benefits from GRN", + ], { fontSize: 12 }), { x: 0.7, y: 1.8, w: 3.9, h: 2.5 }); + + // Right: evidence + s.addShape(pres.shapes.RECTANGLE, { + x: 5.2, y: 1.15, w: 4.3, h: 3.5, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 5.2, y: 1.15, w: 4.3, h: 0.45, + fill: { color: C.green }, + }); + s.addText("Evidence from dim1 Ablation", { + x: 5.2, y: 1.15, w: 4.3, h: 0.45, + fontSize: 14, fontFace: FONT_B, color: C.white, bold: true, align: "center", valign: "middle", + }); + s.addText(bullets([ + "scgpt_dim: 512 -> 1", + "Latent loss converges normally", + "Pearson delta: 0.752 (vs baseline 0.866)", + "Confirms: high-dim target is the bottleneck", + "But dim=1 loses most GRN information", + ], { fontSize: 12 }), { x: 5.4, y: 1.8, w: 3.9, h: 2.5 }); + + // Bottom conclusion + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 4.85, w: 9.0, h: 0.5, + fill: { color: C.dark }, + }); + s.addText("Conclusion: Cascaded generation of GRN features is a dead end. Need a new paradigm.", { + x: 0.5, y: 4.85, w: 9.0, h: 0.5, + fontSize: 13, fontFace: FONT_B, color: C.white, bold: true, align: "center", valign: "middle", + }); +} + +// ==================================================================== +// SLIDE 8 — Paradigm Shift +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.dark }; + s.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.primary }, + }); + + s.addText("Paradigm Shift", { + x: 0.7, y: 0.8, w: 8.6, h: 0.6, + fontSize: 32, fontFace: FONT_H, color: C.white, bold: true, margin: 0, + }); + s.addText("From GRN Generation to Structural Supervision", { + x: 0.7, y: 1.4, w: 8.6, h: 0.5, + fontSize: 18, fontFace: FONT_B, color: C.primaryLt, margin: 0, + }); + + // Key insight box + s.addShape(pres.shapes.RECTANGLE, { + x: 0.7, y: 2.3, w: 8.6, h: 1.2, + fill: { color: C.primary }, + }); + s.addText([ + { text: "Key Insight: ", options: { bold: true, fontSize: 15, color: C.white } }, + { text: "Delta-attention is ", options: { fontSize: 15, color: C.white } }, + { text: "privileged information", options: { bold: true, italic: true, fontSize: 15, color: C.white } }, + { text: " -- available at training (from source + target), absent at inference (only source).", options: { fontSize: 15, color: C.white } }, + ], { x: 1.0, y: 2.5, w: 8.0, h: 0.8, fontFace: FONT_B }); + + // Old vs New + s.addShape(pres.shapes.RECTANGLE, { + x: 0.7, y: 3.8, w: 4.0, h: 1.2, + fill: { color: "2A2A42" }, + }); + s.addText([ + { text: "OLD: Cascaded", options: { bold: true, fontSize: 14, color: C.red, breakLine: true, paraSpaceAfter: 4 } }, + { text: "Generate GRN features (latent flow)", options: { fontSize: 13, color: "E8E8E8", breakLine: true, paraSpaceAfter: 2 } }, + { text: "-> Use for expression (expr flow)", options: { fontSize: 13, color: "E8E8E8" } }, + ], { x: 0.9, y: 3.9, w: 3.6, h: 1.0, fontFace: FONT_B }); + + s.addShape(pres.shapes.RECTANGLE, { + x: 5.3, y: 3.8, w: 4.0, h: 1.2, + fill: { color: "2A2A42" }, + }); + s.addText([ + { text: "NEW: RegFM", options: { bold: true, fontSize: 14, color: "66BB6A", breakLine: true, paraSpaceAfter: 4 } }, + { text: "Embed GRN as structural bias", options: { fontSize: 13, color: "E8E8E8", breakLine: true, paraSpaceAfter: 2 } }, + { text: "-> Soft-supervise with delta_attn at train", options: { fontSize: 13, color: "E8E8E8" } }, + ], { x: 5.5, y: 3.9, w: 3.6, h: 1.0, fontFace: FONT_B }); + + addSlideNum(s, 8); +} + +// ==================================================================== +// SLIDE 9 — RegFM Architecture +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "RegFM: Architecture", 9); + + // Equation box + s.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 1.15, w: 8.8, h: 0.7, + fill: { color: C.offWhite }, + }); + s.addText([ + { text: "v(x, t) = \u03B1 \u00B7 v", options: { fontFace: "Calibri", fontSize: 22, color: C.primary, bold: true } }, + { text: "reg", options: { fontFace: "Calibri", fontSize: 15, color: C.primary, bold: true } }, + { text: " + (1 \u2013 \u03B1) \u00B7 v", options: { fontFace: "Calibri", fontSize: 22, color: C.primary, bold: true } }, + { text: "int", options: { fontFace: "Calibri", fontSize: 15, color: C.primary, bold: true } }, + ], { + x: 0.6, y: 1.15, w: 8.8, h: 0.7, + align: "center", valign: "middle", + }); + + // Three component cards + const comps = [ + { + title: "v_reg (Regulatory)", + color: C.primary, + items: [ + "RegulatoryHead module", + "Q, K, V from backbone h", + "R = tanh(QK^T / sqrt(d_r))", + "v_reg = Linear(R @ V)", + "d_r = 32, params = 12K", + ], + }, + { + title: "v_int (Intrinsic)", + color: C.accent, + items: [ + "Original ExprDecoder", + "3-layer MLP", + "Per-gene autonomous dynamics", + "No inter-gene interaction", + "Reused from scDFM baseline", + ], + }, + { + title: "Gate (alpha)", + color: C.green, + items: [ + "VelocityGate module", + "Input: h + pert_emb + t_emb", + "MLP(384 -> 128 -> 1)", + "Init: bias=-3, alpha~0.05", + "Safe fallback to v_int", + ], + }, + ]; + comps.forEach((c, i) => { + const cx = 0.5 + i * 3.15; + s.addShape(pres.shapes.RECTANGLE, { + x: cx, y: 2.15, w: 2.95, h: 3.0, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: cx, y: 2.15, w: 2.95, h: 0.42, + fill: { color: c.color }, + }); + s.addText(c.title, { + x: cx, y: 2.15, w: 2.95, h: 0.42, + fontSize: 12, fontFace: FONT_B, color: C.white, bold: true, align: "center", valign: "middle", + }); + s.addText(bullets(c.items, { fontSize: 10.5 }), { + x: cx + 0.1, y: 2.7, w: 2.75, h: 2.3, + }); + }); +} + +// ==================================================================== +// SLIDE 10 — RegFM Training & Loss +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "RegFM: Training & Loss Design", 10); + + // Loss equation + s.addShape(pres.shapes.RECTANGLE, { + x: 0.6, y: 1.15, w: 8.8, h: 0.6, + fill: { color: C.offWhite }, + }); + s.addText([ + { text: "L = L", options: { fontFace: "Calibri", fontSize: 20, color: C.primary, bold: true } }, + { text: "vel", options: { fontFace: "Calibri", fontSize: 14, color: C.primary, bold: true } }, + { text: " + \u03BB \u00B7 L", options: { fontFace: "Calibri", fontSize: 20, color: C.primary, bold: true } }, + { text: "reg", options: { fontFace: "Calibri", fontSize: 14, color: C.primary, bold: true } }, + { text: " + \u03B3 \u00B7 L", options: { fontFace: "Calibri", fontSize: 20, color: C.primary, bold: true } }, + { text: "mmd", options: { fontFace: "Calibri", fontSize: 14, color: C.primary, bold: true } }, + ], { + x: 0.6, y: 1.15, w: 8.8, h: 0.6, + align: "center", valign: "middle", + }); + + // Loss details table + const tbl = styledTable( + ["Loss Term", "Target", "Weight", "Description"], + [ + ["L_vel", "v_target = x1 - eps", "1.0", "Standard flow matching MSE"], + ["L_reg", "delta_attention", "0.1", "R_theta aligned with GRN ground truth"], + ["L_mmd", "Distribution matching", "0.5", "Sliced Wasserstein / MMD"], + ] + ); + s.addTable(tbl.rows, { + x: 0.6, y: 2.0, w: 8.8, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [1.2, 2.5, 1.0, 4.1], + rowH: [0.38, 0.35, 0.35, 0.35], + autoPage: false, + }); + + // Training status + s.addText([ + { text: "Training Status (RegFM + MMD)", options: { bold: true, fontSize: 14, fontFace: FONT_H, color: C.primary, breakLine: true, paraSpaceAfter: 6 } }, + ], { x: 0.6, y: 3.4, w: 4.5, h: 0.35 }); + + const statusTbl = styledTable( + ["Step", "L_vel", "L_reg", "L_mmd", "Total"], + [ + ["5k", "0.169", "0.318", "0.025", "0.226"], + ["20k", "0.126", "0.254", "0.017", "0.168"], + ["32k", "0.112", "0.236", "0.016", "0.152"], + ] + ); + s.addTable(statusTbl.rows, { + x: 0.6, y: 3.8, w: 5.5, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [0.8, 1.0, 1.0, 1.0, 1.0], + rowH: [0.35, 0.3, 0.3, 0.3], + autoPage: false, + }); + + // Key design notes + s.addShape(pres.shapes.RECTANGLE, { + x: 6.5, y: 3.4, w: 3.0, h: 1.8, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 6.5, y: 3.4, w: 0.07, h: 1.8, + fill: { color: C.accent }, + }); + s.addText([ + { text: "Design Notes", options: { bold: true, fontSize: 12, fontFace: FONT_H, color: C.accent, breakLine: true, paraSpaceAfter: 4 } }, + ], { x: 6.75, y: 3.5, w: 2.6, h: 0.3 }); + s.addText(bullets([ + "Gate init: alpha ~ 0.05", + "Diagonal removed from R", + "Tanh bounds R to [-1, 1]", + "Backbone: d_model=128", + ], { fontSize: 10.5 }), { x: 6.75, y: 3.85, w: 2.6, h: 1.2 }); +} + +// ==================================================================== +// SLIDE 11 — Schrodinger Bridge: Approach +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Schrodinger Bridge: Approach", 11); + + // Motivation + s.addText(bullets([ + "FM: noise -> target (unpaired, indirect)", + "SB: source -> target (optimal transport coupling)", + "Natural fit for perturbation prediction", + ], { fontSize: 13 }), { x: 0.6, y: 1.15, w: 9.0, h: 1.2 }); + + // Variants table + const tbl = styledTable( + ["Variant", "Transport", "Score Head", "Anchoring", "Key Feature"], + [ + ["A1 (baseline)", "SB-ODE", "None", "None", "Basic SB formulation"], + ["A5 (full SDE)", "SB-SDE", "Full ASB", "None", "Score + velocity joint"], + ["A6 (DSM aniso)", "SB-SDE", "Anisotropic", "None", "Per-gene noise scale"], + ["SA1 (src-ODE)", "SB-ODE", "None", "Source cell", "Anchor at x_ctrl"], + ["SA6 (src-SDE)", "SB-SDE", "Anisotropic", "Source cell", "Anchor + aniso score"], + ] + ); + s.addTable(tbl.rows, { + x: 0.4, y: 2.55, w: 9.2, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [1.7, 1.2, 1.4, 1.3, 3.6], + rowH: [0.38, 0.32, 0.32, 0.32, 0.32, 0.32], + autoPage: false, + }); + + // Source-anchored note + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 4.35, w: 9.0, h: 0.75, + fill: { color: C.offWhite }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 4.35, w: 0.08, h: 0.75, + fill: { color: C.accent }, + }); + s.addText([ + { text: "Source-Anchored: ", options: { bold: true, fontSize: 12, color: C.accent } }, + { text: "ODE starts from x_ctrl (not noise). Loss_v drops to ~0.0004 (vs ~0.3 for standard SB).", options: { fontSize: 12, color: C.bodyText } }, + ], { x: 0.8, y: 4.4, w: 8.5, h: 0.6, fontFace: FONT_B }); +} + +// ==================================================================== +// SLIDE 12 — Schrodinger Bridge: Results +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Schrodinger Bridge: Results", 12); + + // Top table — use explicit large font cells + const hdr12 = ["Model", "Pearson", "MSE", "DE Dir.", "Discrim."].map(h => ({ + text: h, options: { bold: true, color: C.white, fill: { color: C.tableHead }, fontSize: 13, fontFace: FONT_B, align: "center", valign: "middle" }, + })); + const data12 = [ + [{ text: "scDFM Baseline", bold: true }, { text: "0.866", bold: true }, "0.0032", "0.937", "0.980"], + [{ text: "SB A1 (baseline)", bold: true }, { text: "0.858", bold: true }, "0.0072", "0.902", "0.957"], + ["SB A6 (aniso DSM)", "0.849", "0.0074", "0.901", "0.956"], + ["SA1 / SA6", "Training...", "@ 195k", "-", "-"], + ].map((row, ri) => row.map(cell => { + const isObj = typeof cell === "object" && cell !== null; + return { text: isObj ? cell.text : String(cell), options: { fontSize: 13, fontFace: FONT_B, color: C.darkText, fill: { color: ri % 2 === 0 ? C.white : C.tableAlt }, align: "center", valign: "middle", bold: isObj && cell.bold ? true : false } }; + })); + s.addTable([hdr12, ...data12], { + x: 0.5, y: 1.15, w: 9.0, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [2.4, 1.6, 1.4, 1.6, 1.6], + rowH: [0.42, 0.4, 0.4, 0.4, 0.4], + autoPage: false, + }); + + // Training loss comparison + s.addText([ + { text: "Training Loss Comparison", options: { bold: true, fontSize: 14, fontFace: FONT_H, color: C.primary, breakLine: true, paraSpaceAfter: 6 } }, + ], { x: 0.6, y: 3.25, w: 8.8, h: 0.35 }); + + const hdrL = ["Variant", "Loss_v", "Loss_s", "Notes"].map(h => ({ + text: h, options: { bold: true, color: C.white, fill: { color: C.tableHead }, fontSize: 12, fontFace: FONT_B, align: "center", valign: "middle" }, + })); + const dataL = [ + ["A1 Baseline", "0.26 - 0.40", "N/A", "Stable"], + ["A6 DSM Aniso", "0.30 - 0.37", "0.76 - 0.80", "Better score"], + ["SA1 Src-ODE", "~0.0005", "N/A", "Very low (anchored)"], + ["SA6 Src-SDE", "~0.001", "~0.057", "Anchored + aniso"], + ].map((row, ri) => row.map(cell => ({ + text: cell, options: { fontSize: 12, fontFace: FONT_B, color: C.darkText, fill: { color: ri % 2 === 0 ? C.white : C.tableAlt }, align: "center", valign: "middle" }, + }))); + s.addTable([hdrL, ...dataL], { + x: 0.5, y: 3.65, w: 9.0, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [2.2, 2.0, 1.8, 3.0], + rowH: [0.38, 0.35, 0.35, 0.35, 0.35], + autoPage: false, + }); +} + +// ==================================================================== +// SLIDE 13 — Comprehensive Comparison +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Comprehensive Comparison", 13); + + const tbl = styledTable( + ["Method", "Approach", "Pearson", "MSE", "DE Dir.", "Discrim."], + [ + [{ text: "scDFM Baseline", bold: true }, "Flow Matching", { text: "0.866", bold: true }, { text: "0.003", bold: true }, { text: "0.937", bold: true }, { text: "0.980", bold: true }], + [{ text: "SB A1", bold: true }, "Schrodinger Bridge", "0.858", "0.007", "0.902", "0.957"], + ["SB A6", "SB + Aniso DSM", "0.849", "0.007", "0.901", "0.956"], + [{ text: "dim1 ablation", bold: true }, "Cascaded (d=1)", "0.752", "0.006", "0.878", "0.914"], + ["grn_dense4", "Cascaded (d=4)", "0.122", "0.020", "0.780", "0.521"], + ["grn_scalar", "Cascaded (d=1, L2)", "0.087", "0.021", "0.793", "0.534"], + ["grn_att_only", "Cascaded (bilinear)", "-0.097", "0.602", "0.747", "0.552"], + ["grn_svd_cross", "Cascaded (SVD)", "-0.096", "0.575", "0.746", "0.492"], + ["RegFM (20k)", "Structural Bias", "0.040", "0.128", "0.748", "0.505"], + ] + ); + s.addTable(tbl.rows, { + x: 0.3, y: 1.1, w: 9.4, + border: { pt: 0.5, color: "DDDDDD" }, + colW: [1.6, 1.7, 1.1, 1.0, 1.0, 1.0], + rowH: [0.38, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35, 0.35], + autoPage: false, + }); + + // Color legend + s.addShape(pres.shapes.RECTANGLE, { + x: 0.5, y: 4.85, w: 9.0, h: 0.5, + fill: { color: C.offWhite }, + }); + s.addText([ + { text: "Top tier: ", options: { bold: true, fontSize: 11, color: C.green } }, + { text: "Baseline (0.866), SB A1 (0.858) ", options: { fontSize: 11, color: C.bodyText } }, + { text: "Mid tier: ", options: { bold: true, fontSize: 11, color: C.accent } }, + { text: "dim1 (0.752) ", options: { fontSize: 11, color: C.bodyText } }, + { text: "Failed: ", options: { bold: true, fontSize: 11, color: C.red } }, + { text: "All high-dim cascaded variants", options: { fontSize: 11, color: C.bodyText } }, + ], { x: 0.7, y: 4.85, w: 8.6, h: 0.5, fontFace: FONT_B, valign: "middle" }); +} + +// ==================================================================== +// SLIDE 14 — Key Takeaways +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.white }; + addTitle(s, "Key Takeaways", 14); + + const takeaways = [ + { num: "1", title: "Cascaded GRN Generation Fails", desc: "High-dim latent target (G x G sparse) is fundamentally too hard to generate via flow matching." }, + { num: "2", title: "SB Competitive with FM Baseline", desc: "Schrodinger Bridge (A1: 0.858) nearly matches scDFM (0.866); source-anchored variants training." }, + { num: "3", title: "RegFM: New Paradigm", desc: "Treat delta_attn as privileged info; embed GRN as structural bias, not generation target." }, + { num: "4", title: "dim1 Confirms the Diagnosis", desc: "Only 1d latent converges; validates that task difficulty scales with latent dimensionality." }, + ]; + + takeaways.forEach((t, i) => { + const ty = 1.15 + i * 1.05; + // Number circle + s.addShape(pres.shapes.OVAL, { + x: 0.6, y: ty + 0.05, w: 0.45, h: 0.45, + fill: { color: C.primary }, + }); + s.addText(t.num, { + x: 0.6, y: ty + 0.05, w: 0.45, h: 0.45, + fontSize: 16, fontFace: FONT_H, color: C.white, bold: true, align: "center", valign: "middle", + }); + // Title + description + s.addText(t.title, { + x: 1.25, y: ty, w: 8.2, h: 0.3, + fontSize: 15, fontFace: FONT_H, color: C.primary, bold: true, margin: 0, + }); + s.addText(t.desc, { + x: 1.25, y: ty + 0.32, w: 8.2, h: 0.55, + fontSize: 12, fontFace: FONT_B, color: C.bodyText, margin: 0, + }); + }); +} + +// ==================================================================== +// SLIDE 15 — Next Steps +// ==================================================================== +{ + const s = pres.addSlide(); + s.background = { color: C.dark }; + s.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: 0.12, h: 5.625, fill: { color: C.primary }, + }); + + s.addText("Next Steps", { + x: 0.7, y: 0.6, w: 8.6, h: 0.6, + fontSize: 32, fontFace: FONT_H, color: C.white, bold: true, margin: 0, + }); + + const steps = [ + { title: "RegFM Full Training", desc: "Continue to 100k+ steps; evaluate and compare with baseline at convergence" }, + { title: "SB Source-Anchored Eval", desc: "Evaluate SA1 / SA6 at 200k; compare ODE vs SDE transport" }, + { title: "RegFM vs SB vs Baseline", desc: "Head-to-head comparison on cell-eval + distributional metrics" }, + { title: "Distributional Evaluation", desc: "Apply new metrics (MMD, Energy Distance, C2ST, kNN) beyond conditional mean" }, + { title: "Interpretability Analysis", desc: "Visualize R_theta from RegFM; compare with known GRN structure" }, + ]; + + steps.forEach((st, i) => { + const sy = 1.5 + i * 0.78; + s.addShape(pres.shapes.RECTANGLE, { + x: 0.7, y: sy, w: 8.6, h: 0.65, + fill: { color: "2A2A42" }, + }); + s.addShape(pres.shapes.RECTANGLE, { + x: 0.7, y: sy, w: 0.07, h: 0.65, + fill: { color: C.primary }, + }); + s.addText(st.title, { + x: 1.0, y: sy + 0.03, w: 3.0, h: 0.3, + fontSize: 14, fontFace: FONT_B, color: C.white, bold: true, margin: 0, + }); + s.addText(st.desc, { + x: 1.0, y: sy + 0.32, w: 8.1, h: 0.28, + fontSize: 12, fontFace: FONT_B, color: "CCCCCC", margin: 0, + }); + }); + + addSlideNum(s, 15); +} + +// ── Write file ───────────────────────────────────────────────────── +pres.writeFile({ fileName: "/home/hp250092/ku50001222/qian/aivc/lfj/Report/week10/GRN_Progress_Report.pptx" }) + .then(() => console.log("PPTX saved successfully.")) + .catch((err) => console.error("Error:", err)); diff --git a/Report/week10/slide-fix-08-08.jpg b/Report/week10/slide-fix-08-08.jpg new file mode 100644 index 0000000000000000000000000000000000000000..99d3f4dcba21614437d5b9567a069d8f63a3a622 --- /dev/null +++ b/Report/week10/slide-fix-08-08.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1547b03987fdfa5ef6b421af21d5737efcaf79a57354b5c287488dfc4027fbe9 +size 76989 diff --git a/Report/week10/slide-fix-12-12.jpg b/Report/week10/slide-fix-12-12.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e66eff87cbd273e8a7d3595ee0265dcb9b7989dd --- /dev/null +++ b/Report/week10/slide-fix-12-12.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:542fae248fdee36eb875a87b95af483dbf06200e430e741c2cbb731aaeff8845 +size 122331 diff --git a/Report/{A7E7307F-47C7-41BF-A505-E8CE3EBBD112}.png b/Report/{A7E7307F-47C7-41BF-A505-E8CE3EBBD112}.png new file mode 100644 index 0000000000000000000000000000000000000000..1ef642edc219c137ab07dc18ffebb70021deb942 --- /dev/null +++ b/Report/{A7E7307F-47C7-41BF-A505-E8CE3EBBD112}.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4228b6147218a6d40378fbdbe2a372c552c5450b5aae84fab618b3bf77a49a2 +size 124907 diff --git "a/data/Causal Schr\303\266dinger Bridges.pdf" "b/data/Causal Schr\303\266dinger Bridges.pdf" new file mode 100644 index 0000000000000000000000000000000000000000..3cdab9ae0fb7ce0b6b964a972b3314c6419e2013 --- /dev/null +++ "b/data/Causal Schr\303\266dinger Bridges.pdf" @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65783ef28726c425d9bceb47d655fc9c40274abad873c69311cbcae2b331317c +size 3505142 diff --git a/data/GSE255460_metadata.csv.gz b/data/GSE255460_metadata.csv.gz new file mode 100644 index 0000000000000000000000000000000000000000..941ee5ace70f68b9b96c37e56f0facba5fcaba6e --- /dev/null +++ b/data/GSE255460_metadata.csv.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8516304506b7fb89877033d020191a62eb48e997b232f154c7e7fd08b4098d0f +size 1893117 diff --git a/data/bridge.pdf b/data/bridge.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d8ae5abac48f40f2ff43fe13ae76f84eb9f908fa --- /dev/null +++ b/data/bridge.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e707a69bd7ba57d90625e84bb3b3ffb54da5df485f6dd3a6503d7225f08ffd1 +size 48154507 diff --git a/data/image.png b/data/image.png new file mode 100644 index 0000000000000000000000000000000000000000..b08aa858fccc1a66c45779e60d91e08b761ae220 --- /dev/null +++ b/data/image.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:319efddb93126d473598459711c751295cc33a121b23f47eaa3190f0faa68872 +size 183823 diff --git a/local_bin/soffice b/local_bin/soffice new file mode 100644 index 0000000000000000000000000000000000000000..0415bdf52e3641e679d9fc6ac3f24fbad1d57f87 --- /dev/null +++ b/local_bin/soffice @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:65792f4c92b87d2b9db52ca85e52888099b72ca19a118dc4ebf428eb808bbf2d +size 291235008 diff --git a/poster/.claude/skills/make-poster/SKILL.md b/poster/.claude/skills/make-poster/SKILL.md new file mode 100644 index 0000000000000000000000000000000000000000..dd136a38d6fa175fb83b79d6b8bc34c6a7188ae8 --- /dev/null +++ b/poster/.claude/skills/make-poster/SKILL.md @@ -0,0 +1,285 @@ +--- +name: make-poster +description: Generate an HTML conference poster from a paper and project website, printable to PDF +argument-hint: +user-invocable: true +allowed-tools: Read, Write, Edit, Bash, Glob, Grep, WebFetch, Agent +--- + +# Conference Poster Generator (HTML) + +Generate a professional HTML poster. User notes: $ARGUMENTS + +The poster is a **React-based interactive editor** — a single self-contained HTML file in the `poster/` directory. No build step needed (React/Babel loaded via CDN). The user can visually adjust the layout in their browser, then export the config back to Claude for further changes. + +## Project folder structure + +``` +/ +├── overleaf/ # Paper source from Overleaf +│ ├── paper.tex +│ ├── figures/ +│ └── ... +├── references/ # Reference posters for style matching +│ └── (any format: pdf, png, jpg, html, pptx, ...) +├── poster/ # GENERATED: self-contained poster website +│ ├── index.html # The poster (React app) +│ ├── poster-config.json # Layout config (columns, card order, heights, font scale) +│ ├── logos/ # Institution logos +│ ├── teaser.png # Copied/converted figures +│ ├── qr.png # Project page QR code +│ ├── qr-posterskill.png # Posterskill QR code +│ └── ... +└── .claude/skills/make-poster/ +``` + +- **`overleaf/`** contains the paper source. Read the main `.tex` file and any files it `\input{}`s. +- **`references/`** contains example posters showing the user's preferred visual style. Read/view ALL files in this folder to match their design language. +- **`poster/`** is the generated output — a self-contained website. All figures and assets live alongside `index.html` so relative paths just work. + +## Inputs + +1. **Paper source** - Located in `overleaf/`. Ask the user which `.tex` file is the main one to read (e.g., `paper.tex`, `main.tex`). Then read it and any files it `\input{}`s. +2. **Project website** - Ask the user for the URL if not already known. Fetch with WebFetch to extract author info, hosted images, and links. +3. **Reference posters** - Auto-discovered from `references/`. View all files there and match their style. +4. **Author website** (optional) - Fetch with WebFetch and extract design signals (color palette, typography, logos). Download institutional logos from the author's site using Playwright (curl may fail due to redirects): `page.request.get(url)` to download the raw bytes. +5. **Formatting requirements** - Ask for poster dimensions, orientation, number of columns. +6. **Git repo** (optional) - Ask the user if they have a GitHub repo to push the poster to. + +If the user doesn't specify formatting, ask them before proceeding. Don't assume defaults for dimensions, orientation, or column count. + +## Process + +### Step 0: Analyze style references +Look in `references/` for any PDF, PNG, or image files. Convert PDFs to PNGs (`sips -s format png` on macOS). View each one and note the visual style — layout, colors, typography, card styles, figure placement. **Match the reference style** — don't default to a dark theme if the reference is light, etc. + +### Step 1: Extract content from paper source +Ask the user which `.tex` file to read. Extract: title, authors, affiliations, abstract (2-3 sentences), key method, results (tables + figures), key equations (1-2 max), conclusion. + +### Step 2: Fetch the project website +Use WebFetch to get author names, affiliations, figure URLs, project URL for QR, links to code/arxiv/video. + +### Step 3: Gather assets into `poster/` + +**Figures:** Copy from `overleaf/figures/`, converting PDFs to PNGs at high resolution: +```bash +sips -s format png input.pdf --out poster/output.png -Z 3000 +``` + +**Website images:** Download higher-quality images from the project website using Playwright (not curl — many sites redirect): +```python +resp = page.request.get(url) +with open('poster/filename.png', 'wb') as f: + f.write(resp.body()) +``` + +**Logos:** Download institutional logos from the author's personal website using Playwright. Save to `poster/logos/`. The template auto-inverts them to white for the header. + +**QR codes:** Generate and save: +```bash +curl -sL -o poster/qr.png "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=PROJECT_URL" +curl -sL -o poster/qr-posterskill.png "https://api.qrserver.com/v1/create-qr-code/?size=400x400&data=https://github.com/ethanweber/posterskill" +``` + +### Step 4: Measure image aspect ratios +**This is critical for eliminating whitespace.** Measure every image: +```bash +sips -g pixelWidth -g pixelHeight poster/*.png poster/*.jpg +``` + +Then assign images to columns based on aspect ratio: +- **Wide images** (>2:1 ratio, e.g. teaser, architecture): put in the widest column +- **Square images** (~1:1 ratio): put in narrow columns +- **Portrait images** (<1:1 ratio): put in the narrowest column + +This prevents the #1 whitespace problem: wide images in narrow cells (or vice versa) leaving huge gaps. + +### Step 5: Generate the poster HTML + +Use the template at `${{CLAUDE_SKILL_DIR}}/template.html` as a starting point. The template is a React app with: + +**Architecture:** +- `CARD_REGISTRY` — defines each card's content (title, color, JSX body) +- `DEFAULT_LAYOUT` — defines column structure and card ordering +- `DEFAULT_LOGOS` — institutional logos for the header +- React state manages layout, with localStorage persistence +- `window.posterAPI` exposes functions for programmatic control + +**Key things to customize:** +1. Update `CARD_REGISTRY` with the paper's content (each section is a card) +2. Update `DEFAULT_LAYOUT` with the aspect-ratio-optimized column assignments +3. Update `DEFAULT_LOGOS` with the user's institutional logos +4. Update `DEFAULT_FONT_SCALE` (start at 1.3, user can adjust with A-/A+ buttons) +5. Update the header (title, authors, affiliations, conference badge, QR codes) +6. Update `@page { size: WIDTHmm HEIGHTmm; }` and `body { width: WIDTHmm; height: HEIGHTmm; }` for the poster dimensions +7. Update `posterAPI` fit() function with the same dimensions + +**Card content patterns:** +- Figure card: `
...
Caption title. Description.
` +- Text card: `

Highlight text

  • Point 1
` +- Table card: `......
` with `className="best"` on winning cells +- Equation card: `
{'$LaTeX equation$'}
` (escape backslashes in JSX) + +**Critical CSS rules for zero whitespace:** +- Images MUST use `width:100%; height:100%; object-fit:contain` (NOT max-width/max-height — those prevent upscaling) +- Each column must always have one card with `grow: true` (flex:1) that fills remaining space +- The `isCardGrow()` function ensures this automatically — if no card has grow, the last card gets it + +**Viewport scaling:** +- Use `translate() + scale()` on body to center and fit the poster to any browser viewport +- `transform-origin: top left` is critical +- `@media print` must set `transform: none !important` for correct print resolution +- `getBoundingClientRect()` returns SCALED values — always divide by `currentScaleRef.current` in resize handlers + +### Step 6: Auto-optimize layout with Playwright + +After generating, use Playwright to measure whitespace and find optimal column widths: + +```python +from playwright.sync_api import sync_playwright +import os + +with sync_playwright() as p: + browser = p.chromium.launch() + page = browser.new_page(viewport={'width': 3200, 'height': 2260}) + page.goto('file://' + os.path.abspath('poster/index.html')) + page.wait_for_load_state('networkidle') + page.wait_for_timeout(3000) + + # Measure whitespace + waste = page.evaluate('window.posterAPI.getWaste()') + print(f"Total waste: {waste['total']}px") + for d in waste['details']: + print(f" {d['card']}: H={d['wasteH']} W={d['wasteW']} ({d['pct']}%)") + + # Try different column widths to minimize waste + best_waste = waste['total'] + best_c1, best_c3 = 300, 230 + for c1 in range(200, 350, 10): + for c3 in range(160, 280, 10): + page.evaluate(f'window.posterAPI.setColumnWidth("col1", {c1})') + page.evaluate(f'window.posterAPI.setColumnWidth("col3", {c3})') + page.wait_for_timeout(30) + w = page.evaluate('window.posterAPI.getWaste().total') + if w < best_waste: + best_waste = w + best_c1, best_c3 = c1, c3 + + # Apply best and screenshot + page.evaluate(f'window.posterAPI.setColumnWidth("col1", {best_c1})') + page.evaluate(f'window.posterAPI.setColumnWidth("col3", {best_c3})') + page.wait_for_timeout(500) + page.screenshot(path='/tmp/poster_screenshot.png') + + # Also try swapping cards between columns + page.evaluate('window.posterAPI.swapCards("cardA", "cardB")') + # ... measure waste again ... + + browser.close() +``` + +Then read `/tmp/poster_screenshot.png` to visually inspect. **Iterate multiple times** — take screenshots, fix issues, re-screenshot until the poster has minimal blank space. + +After finding optimal values, bake them into `DEFAULT_LAYOUT`, `DEFAULT_CARD_HEIGHTS`, etc. in the HTML. + +### Step 7: Generate PDF and verify + +```python +page.pdf( + path='poster/poster.pdf', + width='841mm', height='594mm', # match poster dimensions + margin={'top':'0','right':'0','bottom':'0','left':'0'}, + print_background=True +) +``` + +Convert the PDF to PNG and read it to verify it renders at full resolution: +```bash +sips -s format png poster/poster.pdf --out /tmp/poster_pdf_check.png -Z 3000 +``` + +### Step 8: Open and iterate with user + +Open the poster in the browser: +```bash +open poster/index.html +``` + +**Explain the editing controls to the user:** +- **Preview** — toggle edit UI off to see exactly how it will print +- **A-/A+** — adjust font size globally +- **Drag column dividers** (vertical blue bars) — resize columns left/right +- **Drag row dividers** (horizontal blue bars) — resize cards up/down within columns +- **Click-to-swap** — click one card's diamond handle (turns orange), then click another's to swap them +- **Move/insert** — click a card's handle, then click a dashed orange drop zone to move it there +- **Save** — downloads `poster-config.json` +- **Copy Config** — copies layout JSON to clipboard +- **Reset** — restore defaults + +**Proactively suggest improvements:** After showing the first draft, suggest specific changes: +- "The model architecture card has some whitespace — try dragging the row divider above it down to give it less space" +- "The completion figure might look better in column 2 since it's wider — try clicking its diamond, then clicking a drop zone in column 2" +- "You might want to bump the font size with A+ a few times" + +**Encourage the feedback loop:** Tell the user: +> Try rearranging the poster in your browser! When you're happy with the layout, click **Copy Config** in the top-right toolbar and paste it here — I'll bake those changes into the defaults so they persist. +- **Save** — download `poster-config.json` +- **Copy Config** — copy layout JSON to clipboard to paste to Claude +- **Reset** — restore defaults + +When the user pastes a config JSON, update `DEFAULT_LAYOUT`, `DEFAULT_CARD_HEIGHTS`, `DEFAULT_FONT_SCALE`, and `DEFAULT_LOGOS` in the HTML to match. Also write it to `poster-config.json`. + +### Step 9: Push to GitHub (optional) + +If the user provides a GitHub repo URL: +```bash +cd poster +git init +git remote add origin +git add . +git commit -m "Poster: " +git push -u origin main +``` + +## Important guidelines + +- **No blank space.** This is the #1 priority. Use aspect-ratio-aware column assignment, `width:100%; height:100%; object-fit:contain` on images, auto-grow cards, and the Playwright optimizer. Iterate until waste is minimal. +- **Keep text minimal.** Posters are visual — bullet points, not paragraphs. 2-minute understanding. +- **Match the reference style.** If the reference poster is light/clean, don't use a dark theme. Match the overall aesthetic. +- **Font scaling.** All text sizes use `calc(Xpt * var(--font-scale))` so the A-/A+ buttons work. Start with `--font-scale: 1.3` and let the user adjust. +- **Print-optimized CSS.** `@media print` hides all edit UI and sets `transform: none !important`. `@page` sets exact dimensions. +- **Posterskill QR.** Always include a QR code linking to `https://github.com/ethanweber/posterskill` in the header with the label "Poster made with my Claude skill". +- **No acknowledgements footer.** Keep the poster clean — no footer by default. +- **Logos in header.** Download institutional logos from the author's website, save to `poster/logos/`, and list them in `DEFAULT_LOGOS`. They're auto-inverted to white via CSS filter. +- **Self-contained.** No build step, no npm, no server. Single HTML file with CDN dependencies. Works when opened directly as `file://`. +- **Equations.** Use KaTeX (loaded via CDN). Escape backslashes in JSX strings: `{'$\\mathcal{E}$'}`. + +## Figure handling +- Always copy needed figures into `poster/` — don't reference `overleaf/` paths in the HTML. +- Convert PDFs to PNGs at high resolution: `sips -s format png input.pdf --out poster/output.png -Z 3000` +- Download website images via Playwright's `page.request.get()` (not curl — websites often redirect). +- Measure aspect ratios with `sips -g pixelWidth -g pixelHeight` and assign to columns accordingly. + +## User workflow for config updates + +The user can adjust the poster in their browser and share changes back: +1. User clicks "Copy Config" in the toolbar +2. User pastes the JSON in chat +3. Claude updates `DEFAULT_LAYOUT`, `DEFAULT_CARD_HEIGHTS`, `DEFAULT_FONT_SCALE`, `DEFAULT_LOGOS` in `index.html` to match +4. Claude also writes the config to `poster-config.json` +5. User refreshes and clicks "Reset" to load new defaults + +## Programmatic API (window.posterAPI) + +Available in the browser console or via Playwright: +- `swapCards(id1, id2)` — swap two cards (works across columns) +- `moveCard(cardId, targetColId, position)` — move a card to a specific position +- `setColumnWidth(colId, widthMm)` — set column width (null for flex) +- `setCardHeight(cardId, heightMm)` — set explicit card height (null to reset) +- `setFontScale(scale)` — set global font scale +- `getWaste()` — measure total whitespace in figure containers +- `getLayout()` — get current layout with rendered dimensions +- `getConfig()` — get full serializable config +- `resetLayout()` — restore defaults +- `saveConfig()` — trigger download of poster-config.json +- `copyConfig()` — copy config JSON to clipboard diff --git a/poster/.claude/skills/make-poster/template.html b/poster/.claude/skills/make-poster/template.html new file mode 100644 index 0000000000000000000000000000000000000000..d621eb2741fd98878a380787e30ded7c7642d267 --- /dev/null +++ b/poster/.claude/skills/make-poster/template.html @@ -0,0 +1,420 @@ + + + + + +PAPER_TITLE - CONF_NAME Poster + + + + + + + + + + +
+ + + + diff --git a/poster/.gitignore b/poster/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..7d16b42665e8ebb3006870e8d7a5c7b47cfe5b45 --- /dev/null +++ b/poster/.gitignore @@ -0,0 +1,24 @@ +# User-provided content (not part of the tool) +overleaf/* +!overleaf/.gitkeep +references/* +!references/.gitkeep + +# Generated output +poster/ + +# OS +.DS_Store + +# LaTeX artifacts +*.aux +*.log +*.synctex.gz +*.fdb_latexmk +*.fls +*.out +*.bbl +*.blg + +# Old overleaf clone dirs (hash-named folders from Overleaf git) +66f48147915155a9aac9c3ae/ diff --git a/poster/README.md b/poster/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ab82ed995ed436853acb67fcbbc36b05db262b38 --- /dev/null +++ b/poster/README.md @@ -0,0 +1,100 @@ +# posterskill + +A [Claude Code](https://docs.anthropic.com/en/docs/claude-code) skill that generates print-ready conference posters from your paper. Point it at your Overleaf source and project website — it extracts the content, downloads figures, fetches logos, and builds an interactive poster you can edit in your browser. Single HTML file, no build step. + +The key idea: the poster is a **live editor**. Drag dividers to resize columns and rows, click cards to swap or move them, adjust font sizes — then feed your layout back to Claude for further refinement. Iterate between the browser and Claude until it's perfect. + +## Quick start + +```bash +git clone git@github.com:ethanweber/posterskill.git poster && cd poster +git clone https://git.overleaf.com/YOUR_PROJECT_ID overleaf # your paper +``` + +Optionally add reference posters for style matching: + +```bash +cp ~/some_poster.pdf references/ +``` + +Then start Claude Code and run the skill: + +```bash +claude +``` + +``` +/make-poster +``` + +It reads your paper, fetches your project website, matches your reference style, and generates a `poster/` directory. Open `poster/index.html` in a browser to preview and edit. + +## What you get + +The poster is a **self-contained HTML file** with a built-in visual editor: + +- **Drag column dividers** to resize columns +- **Drag row dividers** to resize cards within columns +- **Click-to-swap** cards (click one diamond handle, then another) +- **Move/insert** cards to any position (click a handle, then click a drop zone) +- **A-/A+** buttons to adjust font size globally +- **Preview** mode to see exactly how it will print +- **Save / Copy Config** to export your layout as JSON + +No npm, no build step, no server. Just open `index.html` in Chrome. + +## Inputs + +| Input | Source | Required | +|-------|--------|----------| +| Paper | `overleaf/` directory | Yes | +| Project website | URL (asked at runtime) | Yes | +| Reference posters | `references/` directory | No | +| Author website | URL for brand/style matching | No | +| Formatting specs | Text or conference instructions URL | Asked if missing | +| Logos | Downloaded from your website to `poster/logos/` | Auto | +| Git repo | URL to push the poster to | Optional | + +## Editing workflow + +1. Claude generates the first draft and opens it in your browser +2. Drag dividers, swap cards, adjust font size in the browser +3. Click **Copy Config** in the toolbar +4. Paste the JSON back to Claude — it updates the defaults +5. Repeat until you're happy +6. Click **Preview** to verify, then print to PDF (margins: none, background graphics: on) + +## How it works under the hood + +The poster uses a React app (loaded via CDN) with: + +- **`CARD_REGISTRY`** — defines each card's content (title, color, JSX body) +- **`DEFAULT_LAYOUT`** — defines column structure and card ordering +- **`DEFAULT_LOGOS`** — institutional logos for the header +- **`window.posterAPI`** — programmatic API for automation + +Claude uses [Playwright](https://playwright.dev/) to: +- Measure image aspect ratios and assign them to matching columns +- Auto-optimize column widths to minimize whitespace +- Take screenshots and visually verify the layout +- Generate PDFs at full print resolution + +## Programmatic API + +Available in the browser console or via Playwright: + +```js +posterAPI.swapCards('method', 'results') // swap two cards +posterAPI.moveCard('quant', 'col1', 2) // move card to position +posterAPI.setColumnWidth('col1', 280) // resize column (mm) +posterAPI.setCardHeight('method', 150) // set card height (mm) +posterAPI.setFontScale(1.5) // adjust text size +posterAPI.getWaste() // measure whitespace +posterAPI.getLayout() // get current layout +posterAPI.getConfig() // get full config JSON +posterAPI.resetLayout() // restore defaults +``` + +## Example + +See the [Fillerbuster poster](http://ethanweber.me/fillerbuster-poster) ([repo](https://github.com/ethanweber/fillerbuster-poster)) for an example built with this skill. diff --git a/poster/overleaf/.gitkeep b/poster/overleaf/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/poster/overleaf/log1.png b/poster/overleaf/log1.png new file mode 100644 index 0000000000000000000000000000000000000000..1ea31b4d0779c4701dc155e3089689dd3a39118b --- /dev/null +++ b/poster/overleaf/log1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84d2ecb3d4a823b3bae889359d6aec2282a9dd5ba3f060eac644191db4492a08 +size 26238 diff --git a/poster/overleaf/logo2.png b/poster/overleaf/logo2.png new file mode 100644 index 0000000000000000000000000000000000000000..31d4e3f77c06fe8757a753cd9d6db28d031a766a --- /dev/null +++ b/poster/overleaf/logo2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5944b097ae846827114f40b8bf1a0f37fd36f1d35ee04729d7f6a7582dd4c4a +size 20246 diff --git a/poster/overleaf/scprompt.md b/poster/overleaf/scprompt.md new file mode 100644 index 0000000000000000000000000000000000000000..5fb202bfbc1d2296a3dbc6a6c0c7c622bfbe5cdd --- /dev/null +++ b/poster/overleaf/scprompt.md @@ -0,0 +1,30 @@ + + +title + +**scPrompt: Unleashing the Power of In-Context Learning for Single-Cell Biology via Adaptive Prompt Selection** + +abstract + +Predicting cellular responses to genetic or chemical perturbations is a central challenge in AI-driven virtual cell modeling, with important implications for drug discovery and mechanistic biology. Recent approaches leverage in-context learning (ICL), where perturbed reference cells are used as prompts to condition predictions for unseen query cells. + +However, existing methods typically construct prompts through random sampling or coarse cell-type grouping. Such strategies often introduce substantial noise due to donor variation, batch effects, and transcriptional heterogeneity, leading to unstable and suboptimal predictions. + +In this work, we investigate the impact of prompt quality on single-cell perturbation prediction and show that naive prompt construction can lead to large performance variance. To address this, we propose **scPrompt**, a simple yet effective adaptive prompt selection framework based on heuristic matching in embedding space. + +Specifically, we design a query-aware prompt selection strategy that prioritizes transcriptionally similar and contextually relevant cells using embedding similarity and filtering criteria. This approach aims to reduce noisy or mismatched prompts while preserving biologically meaningful signals. + +Preliminary results demonstrate that our heuristic selection strategy consistently outperforms random prompt sampling and improves prediction robustness across perturbation conditions. These findings highlight the importance of prompt quality and provide a practical direction for improving context construction in single-cell foundation models. + +method + +We propose a three-stage prompt selection strategy based on embedding similarity, designed to dynamically select the most informative prompt cells for each query batch. The primary challenge of this approach lies in the fundamental state discrepancy: query cells are in a control state, whereas candidate prompt cells are in a perturbed state. Because these cells span across both different cell types and treatment conditions, direct comparison within the embedding space is intractable. + +To address this limitation, we introduce a **bridge prediction** step. Utilizing the aligned model of the Stack, we perform a complete in-context generation using actual perturbed prompts as the *prompt* and control prompts as the *query*. This process generates a "predicted perturbed" gene expression profile for each control prompt cell, from which the corresponding embedding is extracted. This step effectively establishes an implicit mapping from the control state to the perturbed state within the embedding space. + +Building upon this foundation, the subsequent two-stage selection process proceeds as follows: + +- **Stage 1: Matching in the Control Domain.** We compute the average embedding of the current query batch and calculate its cosine similarity against the embeddings of all control prompt cells. The top $K_1 = 512$ control prompts exhibiting the highest similarity are subsequently selected. +- **Stage 2: Mapping to the Perturbed Domain.** We calculate the mean of the predicted perturbed embeddings corresponding to the $K_1$ control prompts selected in the first stage. This mean vector serves as a proxy representation for the "expected perturbation direction." We then compute the cosine similarity between this proxy representation and the embeddings of all actual perturbed prompt cells, selecting the top $N$ most similar actual perturbed cells (T cells) as the final prompts for the current batch. + +The underlying intuition of this method is straightforward: we first identify reference cells that are most similar to the state of the query cells under the shared control condition. By leveraging the bridge mapping, we then infer the anticipated position of these reference cells in the embedding space following perturbation. Ultimately, we select the actual perturbed cells that most closely align with this inferred spatial position. \ No newline at end of file diff --git a/poster/poster/fig_bridge.png b/poster/poster/fig_bridge.png new file mode 100644 index 0000000000000000000000000000000000000000..29389cbca79d20a53ddc3d5018acb7149b14d078 --- /dev/null +++ b/poster/poster/fig_bridge.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bd9a54818eb25645ae4a1184279da00d7713a66e980cbf35f0d1d68b375dd85 +size 5922923 diff --git a/poster/poster/fig_bridge.svg b/poster/poster/fig_bridge.svg new file mode 100644 index 0000000000000000000000000000000000000000..c8cabfa056b2aa111091d0af3af2259c1567e874 --- /dev/null +++ b/poster/poster/fig_bridge.svg @@ -0,0 +1,6 @@ + + + + Figure 3: Bridge Prediction + Replace with fig_bridge.png + diff --git a/poster/poster/fig_pipeline.png b/poster/poster/fig_pipeline.png new file mode 100644 index 0000000000000000000000000000000000000000..2ebdf5bb3bf3344a64f8e5b4d48f99868abdb202 --- /dev/null +++ b/poster/poster/fig_pipeline.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:defb7f93a5aad35555f6a7f4df38ac52412c090ff16409e17d9863dc06428b14 +size 4986381 diff --git a/poster/poster/fig_pipeline.svg b/poster/poster/fig_pipeline.svg new file mode 100644 index 0000000000000000000000000000000000000000..47454f78bdbdc7ae977e87aba7647387725d3622 --- /dev/null +++ b/poster/poster/fig_pipeline.svg @@ -0,0 +1,6 @@ + + + + Figure 2: scPrompt Pipeline + Replace with fig_pipeline.png + diff --git a/poster/poster/fig_problem.png b/poster/poster/fig_problem.png new file mode 100644 index 0000000000000000000000000000000000000000..3d3e08963c1bcefac4268e3ea63c1d2790f89416 --- /dev/null +++ b/poster/poster/fig_problem.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62b1ddb6f217505ab8567df23ea0e022aa05a386b577bef3ce72efea3de64756 +size 5440626 diff --git a/poster/poster/fig_problem.svg b/poster/poster/fig_problem.svg new file mode 100644 index 0000000000000000000000000000000000000000..63e0ce92554b82079c9f79da35bd337fc0bd8150 --- /dev/null +++ b/poster/poster/fig_problem.svg @@ -0,0 +1,6 @@ + + + + Figure 1: Prompt Quality Problem + Replace with fig_problem.png + diff --git a/poster/poster/fig_results.png b/poster/poster/fig_results.png new file mode 100644 index 0000000000000000000000000000000000000000..fc9fca0da0aa92c2fac72c7219b9eed08f609fda --- /dev/null +++ b/poster/poster/fig_results.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:163a1a13c3c8bf2d9c34ee2b614fffe953e03ca49e5cacc2ba16472e248e5000 +size 120075 diff --git a/poster/poster/fig_results.svg b/poster/poster/fig_results.svg new file mode 100644 index 0000000000000000000000000000000000000000..58f2a8a87aa3c3c26b128251d8a78cc30e72fc4b --- /dev/null +++ b/poster/poster/fig_results.svg @@ -0,0 +1,6 @@ + + + + Figure 4: Preliminary Results + Replace with fig_results.png + diff --git a/poster/poster/gen_poster.js b/poster/poster/gen_poster.js new file mode 100644 index 0000000000000000000000000000000000000000..db9a16af2cbedae188e40bdbce03634f6099ce04 --- /dev/null +++ b/poster/poster/gen_poster.js @@ -0,0 +1,227 @@ +const pptxgen = require("pptxgenjs"); + +let pres = new pptxgen(); + +// 90cm x 120cm portrait = ~35.43" x ~47.24" +pres.defineLayout({ name: "POSTER", width: 35.43, height: 47.24 }); +pres.layout = "POSTER"; +pres.author = "Author"; +pres.title = "scPrompt Poster"; + +let slide = pres.addSlide(); + +// ── Colors ── +const POLYU_RED = "9B1B30"; +const POLYU_DARK = "5C1120"; +const WHITE = "FFFFFF"; +const BG = "F5F0EB"; +const TEXT = "222222"; +const TEXT_LIGHT = "555555"; +const ORANGE = "E8943A"; +const TEAL = "2AAA8A"; +const RED = "D94F4F"; +const PRIMARY_LIGHT = "FCE8EC"; +const ORANGE_LIGHT = "FDF0E0"; +const TEAL_LIGHT = "E6F7F3"; +const RED_LIGHT = "FDEAEA"; + +slide.background = { color: BG }; + +// ── Layout ── +const W = 35.43; +const H = 47.24; +const MARGIN = 1.0; +const CONTENT_W = W - 2 * MARGIN; +const HEADER_H = 6.0; + +// ── HEADER ── +slide.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: W, h: HEADER_H, + fill: { color: POLYU_RED } +}); +slide.addShape(pres.shapes.RECTANGLE, { + x: 0, y: 0, w: W * 0.25, h: HEADER_H, + fill: { color: POLYU_DARK, transparency: 40 } +}); + +// Title +slide.addText([ + { text: "scPrompt: ", options: { color: "FFD060", bold: true } }, + { text: "Unleashing the Power of In-Context Learning for Single-Cell Biology via Adaptive Prompt Selection", options: { color: WHITE, bold: true } } +], { + x: MARGIN, y: 0.5, w: CONTENT_W - 9, h: 3.5, + fontSize: 56, fontFace: "Arial Black", lineSpacingMultiple: 1.1, margin: 0 +}); + +// Author & Affiliation +slide.addText([ + { text: "Author Name", options: { fontSize: 30, bold: true, color: WHITE, breakLine: true } }, + { text: "The Hong Kong Polytechnic University, Department of Biomedical Engineering", options: { fontSize: 24, color: "CCCCCC" } } +], { + x: MARGIN, y: 4.2, w: CONTENT_W - 9, h: 1.5, margin: 0 +}); + +// Logo white background boxes + logos +const logoBoxX = W - MARGIN - 8.5; +slide.addShape(pres.shapes.ROUNDED_RECTANGLE, { + x: logoBoxX - 0.3, y: 0.8, w: 4.5, h: 2.2, + fill: { color: WHITE, transparency: 90 }, rectRadius: 0.1 +}); +slide.addImage({ + path: "/home/hp250092/ku50001222/qian/aivc/lfj/poster/poster/logos/polyu.png", + x: logoBoxX, y: 0.9, w: 4, h: 2.0, + sizing: { type: "contain", w: 4, h: 2.0 } +}); +slide.addShape(pres.shapes.ROUNDED_RECTANGLE, { + x: W - MARGIN - 3.8, y: 0.8, w: 3.5, h: 2.2, + fill: { color: WHITE, transparency: 90 }, rectRadius: 0.1 +}); +slide.addImage({ + path: "/home/hp250092/ku50001222/qian/aivc/lfj/poster/poster/logos/bme.png", + x: W - MARGIN - 3.5, y: 1.0, w: 3.0, h: 1.8, + sizing: { type: "contain", w: 3.0, h: 1.8 } +}); + +// ── CONTENT ── +let curY = HEADER_H + 0.6; + +function addCard(y, h, borderColor, title, titleColor) { + slide.addShape(pres.shapes.RECTANGLE, { + x: MARGIN, y: y, w: CONTENT_W, h: h, + fill: { color: WHITE }, + shadow: { type: "outer", color: "000000", blur: 4, offset: 1, angle: 135, opacity: 0.08 } + }); + slide.addShape(pres.shapes.RECTANGLE, { + x: MARGIN, y: y, w: CONTENT_W, h: 0.12, + fill: { color: borderColor } + }); + if (title) { + slide.addText(title, { + x: MARGIN + 0.5, y: y + 0.25, w: CONTENT_W - 1, h: 0.9, + fontSize: 36, fontFace: "Arial Black", color: titleColor || borderColor, bold: true, margin: 0 + }); + } + return y + 1.3; +} + +// ═══ CARD 1: KEY INSIGHT (3.5") ═══ +const C1_H = 3.8; +let textY = addCard(curY, C1_H, POLYU_RED, "Key Insight", POLYU_RED); + +slide.addShape(pres.shapes.RECTANGLE, { + x: MARGIN + 0.5, y: textY, w: CONTENT_W - 1, h: 2.2, + fill: { color: PRIMARY_LIGHT } +}); +slide.addShape(pres.shapes.RECTANGLE, { + x: MARGIN + 0.5, y: textY, w: 0.12, h: 2.2, + fill: { color: POLYU_RED } +}); +slide.addText( + "Prompt quality critically affects ICL-based single-cell perturbation prediction. We propose scPrompt, an adaptive prompt selection framework that replaces random sampling with query-aware embedding-space matching.", { + x: MARGIN + 1.0, y: textY + 0.15, w: CONTENT_W - 2, h: 1.9, + fontSize: 28, fontFace: "Arial", color: TEXT, bold: true, lineSpacingMultiple: 1.35, margin: 0 +}); + +curY += C1_H + 0.5; + +// ═══ CARD 2: PROBLEM & MOTIVATION (13.5") ═══ +const C2_H = 13.5; +textY = addCard(curY, C2_H, ORANGE, "Problem & Motivation", ORANGE); + +slide.addText([ + { text: "In-Context Learning (ICL)", options: { bold: true } }, + { text: " uses perturbed reference cells as prompts to predict responses of unseen query cells", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 8 } }, + { text: "Current methods rely on ", options: {} }, + { text: "random sampling", options: { bold: true } }, + { text: " or ", options: {} }, + { text: "coarse cell-type grouping", options: { bold: true } }, + { text: " to construct prompts", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 8 } }, + { text: "These introduce noise from ", options: {} }, + { text: "donor variation, batch effects, and transcriptional heterogeneity", options: { bold: true } }, + { text: ", causing unstable predictions", options: {} }, +], { + x: MARGIN + 0.8, y: textY, w: CONTENT_W - 1.6, h: 4.0, + fontSize: 26, fontFace: "Arial", color: TEXT, bullet: true, lineSpacingMultiple: 1.3, margin: 0 +}); + +const fig1Y = textY + 4.2; +const fig1W = CONTENT_W - 3; +const fig1H = fig1W * (1536 / 2816); +const fig1X = MARGIN + (CONTENT_W - fig1W) / 2; +slide.addImage({ + path: "/home/hp250092/ku50001222/qian/aivc/lfj/poster/poster/fig_problem.png", + x: fig1X, y: fig1Y, w: fig1W, h: fig1H +}); +slide.addText([ + { text: "Figure 1. ", options: { bold: true, color: TEXT } }, + { text: "Random sampling selects transcriptionally distant cells; scPrompt adaptively selects similar cells, improving prediction quality.", options: { color: TEXT_LIGHT } } +], { + x: fig1X, y: fig1Y + fig1H + 0.1, w: fig1W, h: 0.7, + fontSize: 20, fontFace: "Arial", lineSpacingMultiple: 1.2, margin: 0 +}); + +curY += C2_H + 0.5; + +// ═══ CARD 3: METHOD (15.5") ═══ +const C3_H = 15.5; +textY = addCard(curY, C3_H, TEAL, "Method: Three-Stage Adaptive Prompt Selection", TEAL); + +const fig2W = CONTENT_W - 3; +const fig2H = fig2W * (1536 / 2816); +const fig2X = MARGIN + (CONTENT_W - fig2W) / 2; +slide.addImage({ + path: "/home/hp250092/ku50001222/qian/aivc/lfj/poster/poster/newpic/figure2.png", + x: fig2X, y: textY, w: fig2W, h: fig2H +}); +slide.addText([ + { text: "Figure 2. ", options: { bold: true, color: TEXT } }, + { text: "The scPrompt pipeline: match in control domain, predict perturbation shift via bridge prediction, then match in perturbed domain.", options: { color: TEXT_LIGHT } } +], { + x: fig2X, y: textY + fig2H + 0.1, w: fig2W, h: 0.7, + fontSize: 20, fontFace: "Arial", lineSpacingMultiple: 1.2, margin: 0 +}); + +const mbY = textY + fig2H + 1.0; +slide.addText([ + { text: "Stage 0 — Bridge Prediction: ", options: { bold: true } }, + { text: "Query cells (control) and prompts (perturbed) live in different states. We use the Stack model to generate predicted perturbed embeddings, bridging the two spaces", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 8 } }, + { text: "Stage 1 — Control Matching: ", options: { bold: true } }, + { text: "Select top-K\u2081 control prompts most similar to the query batch via cosine similarity", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 8 } }, + { text: "Stage 2 — Perturbed Mapping: ", options: { bold: true } }, + { text: "Compute a proxy vector from predicted perturbed embeddings, then select the top-N actual perturbed cells closest to this proxy", options: {} }, +], { + x: MARGIN + 0.8, y: mbY, w: CONTENT_W - 1.6, h: 5.0, + fontSize: 26, fontFace: "Arial", color: TEXT, bullet: true, lineSpacingMultiple: 1.3, margin: 0 +}); + +curY += C3_H + 0.5; + +// ═══ CARD 4: KEY TAKEAWAYS (remaining space) ═══ +const C4_H = H - curY - 0.5; +textY = addCard(curY, C4_H, RED, "Key Takeaways", RED); + +slide.addText([ + { text: "Adaptive prompt selection ", options: {} }, + { text: "consistently outperforms random sampling", options: { bold: true } }, + { text: " across perturbation conditions", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 8 } }, + { text: "Bridge prediction elegantly resolves the ", options: {} }, + { text: "control-perturbed state discrepancy", options: { bold: true } }, + { text: " in embedding space", options: { breakLine: true } }, + { text: "", options: { breakLine: true, fontSize: 8 } }, + { text: "A simple heuristic approach, ", options: {} }, + { text: "practical and generalizable", options: { bold: true } }, + { text: " to other single-cell foundation models", options: {} }, +], { + x: MARGIN + 0.8, y: textY, w: CONTENT_W - 1.6, h: C4_H - 1.5, + fontSize: 26, fontFace: "Arial", color: TEXT, bullet: true, lineSpacingMultiple: 1.3, margin: 0 +}); + +// ── SAVE ── +pres.writeFile({ fileName: "/home/hp250092/ku50001222/qian/aivc/lfj/poster/poster/scprompt_poster.pptx" }) + .then(() => console.log("Poster saved!")) + .catch(err => console.error(err)); diff --git a/poster/poster/index.html b/poster/poster/index.html new file mode 100644 index 0000000000000000000000000000000000000000..771b9103bd30dff4f2e206a3e51a3badef2ddaf9 --- /dev/null +++ b/poster/poster/index.html @@ -0,0 +1,389 @@ + + + + + +scPrompt - Academic Poster + + + + + + + + + + +
+ + + + diff --git a/poster/poster/logos/bme.png b/poster/poster/logos/bme.png new file mode 100644 index 0000000000000000000000000000000000000000..31d4e3f77c06fe8757a753cd9d6db28d031a766a --- /dev/null +++ b/poster/poster/logos/bme.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5944b097ae846827114f40b8bf1a0f37fd36f1d35ee04729d7f6a7582dd4c4a +size 20246 diff --git a/poster/poster/logos/polyu.png b/poster/poster/logos/polyu.png new file mode 100644 index 0000000000000000000000000000000000000000..1ea31b4d0779c4701dc155e3089689dd3a39118b --- /dev/null +++ b/poster/poster/logos/polyu.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84d2ecb3d4a823b3bae889359d6aec2282a9dd5ba3f060eac644191db4492a08 +size 26238 diff --git a/poster/poster/method.png b/poster/poster/method.png new file mode 100644 index 0000000000000000000000000000000000000000..2ebdf5bb3bf3344a64f8e5b4d48f99868abdb202 --- /dev/null +++ b/poster/poster/method.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:defb7f93a5aad35555f6a7f4df38ac52412c090ff16409e17d9863dc06428b14 +size 4986381 diff --git a/poster/poster/newpic/figure1.png b/poster/poster/newpic/figure1.png new file mode 100644 index 0000000000000000000000000000000000000000..3d3e08963c1bcefac4268e3ea63c1d2790f89416 --- /dev/null +++ b/poster/poster/newpic/figure1.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62b1ddb6f217505ab8567df23ea0e022aa05a386b577bef3ce72efea3de64756 +size 5440626 diff --git a/poster/poster/newpic/figure2.png b/poster/poster/newpic/figure2.png new file mode 100644 index 0000000000000000000000000000000000000000..2ebdf5bb3bf3344a64f8e5b4d48f99868abdb202 --- /dev/null +++ b/poster/poster/newpic/figure2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:defb7f93a5aad35555f6a7f4df38ac52412c090ff16409e17d9863dc06428b14 +size 4986381 diff --git a/poster/poster/pic/fig_bridge.png b/poster/poster/pic/fig_bridge.png new file mode 100644 index 0000000000000000000000000000000000000000..29389cbca79d20a53ddc3d5018acb7149b14d078 --- /dev/null +++ b/poster/poster/pic/fig_bridge.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bd9a54818eb25645ae4a1184279da00d7713a66e980cbf35f0d1d68b375dd85 +size 5922923 diff --git a/poster/poster/pic/fig_pipeline.png b/poster/poster/pic/fig_pipeline.png new file mode 100644 index 0000000000000000000000000000000000000000..1f62c8f67e50f9e0780f8781dc8a0cdae994ef8c --- /dev/null +++ b/poster/poster/pic/fig_pipeline.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a27317074dffa498fc29bdfa88770232bab0a34a5cab82851bcfa78fbd50868 +size 6100489 diff --git a/poster/poster/pic/fig_problem.png b/poster/poster/pic/fig_problem.png new file mode 100644 index 0000000000000000000000000000000000000000..bf9b37fe0072ded6427675d75af8b74fb09f9f04 --- /dev/null +++ b/poster/poster/pic/fig_problem.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3d78a21659bb406ebfad3f8ff05299634ed123510251678104fac3e0ad8798a +size 6302225 diff --git a/poster/poster/pic/fig_results.png b/poster/poster/pic/fig_results.png new file mode 100644 index 0000000000000000000000000000000000000000..fc9fca0da0aa92c2fac72c7219b9eed08f609fda --- /dev/null +++ b/poster/poster/pic/fig_results.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:163a1a13c3c8bf2d9c34ee2b614fffe953e03ca49e5cacc2ba16472e248e5000 +size 120075 diff --git a/poster/poster/pipeline_v2.png b/poster/poster/pipeline_v2.png new file mode 100644 index 0000000000000000000000000000000000000000..2ebdf5bb3bf3344a64f8e5b4d48f99868abdb202 --- /dev/null +++ b/poster/poster/pipeline_v2.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:defb7f93a5aad35555f6a7f4df38ac52412c090ff16409e17d9863dc06428b14 +size 4986381 diff --git a/poster/poster/poster.html b/poster/poster/poster.html new file mode 100644 index 0000000000000000000000000000000000000000..8b050582f0aafbbc635b55069ca1c05c3bb5e00c --- /dev/null +++ b/poster/poster/poster.html @@ -0,0 +1,345 @@ + + + + + +scPrompt - Academic Poster + + + + + + + + + + +
+ + + + diff --git a/poster/poster/scprompt_poster.pptx b/poster/poster/scprompt_poster.pptx new file mode 100644 index 0000000000000000000000000000000000000000..33e6b5234687aba7e3a5f6843a43300726da699e --- /dev/null +++ b/poster/poster/scprompt_poster.pptx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5924b9c80bc6f2c1a446ed20b0a82ab641a0da643e18f7d57482211ecdf75055 +size 10549409 diff --git a/poster/poster/scprompt_v3.html b/poster/poster/scprompt_v3.html new file mode 100644 index 0000000000000000000000000000000000000000..d2586a3b9d979a49b629f6dc08c74da3a53bda8f --- /dev/null +++ b/poster/poster/scprompt_v3.html @@ -0,0 +1,345 @@ + + + + + +scPrompt - Academic Poster + + + + + + + + + + +
+ + + + diff --git a/poster/references/.gitkeep b/poster/references/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391