示例¶
用于空间转录组分析的自然语言指令示例。
标准工作流¶
典型分析流程如下:
Load → Preprocess → Analyze → Visualize
1. Load Your Data¶
"Load /path/to/spatial_data.h5ad"
"Load my Visium data from /path/to/visium_folder"
2. Preprocess¶
"Preprocess the data"
"Normalize with log transformation and find 2000 variable genes"
"Preprocess with SCTransform normalization"
3. Analyze¶
在下方选择分析类型。
4. Visualize¶
"Show the spatial plot"
"Visualize CD3D expression on tissue"
"Create a UMAP colored by clusters"
分析类型¶
空间区域¶
识别组织区域与微环境。
"Identify spatial domains"
"Find 7 spatial domains using SpaGCN"
"Cluster the tissue into regions with STAGATE"
"Use Leiden clustering with resolution 0.5"
方法:SpaGCN(默认)、STAGATE、GraphST、Leiden、Louvain
细胞类型注释¶
为 spot 或细胞分配细胞类型。
"Annotate cell types using the reference dataset"
"Transfer labels from reference with Tangram"
"Use scANVI for label transfer"
"Annotate with marker genes using CellAssign"
方法:Tangram、scANVI、CellAssign、scType、SingleR、mLLMCelltype
需要:带细胞类型标签的参考数据集(用于 label transfer 方法)
去卷积¶
估计每个 spot 的细胞类型比例。
"Deconvolve the spatial data"
"Estimate cell type proportions with FlashDeconv"
"Use Cell2location for deconvolution"
"Run RCTD deconvolution"
方法:FlashDeconv(默认、最快)、Cell2location、RCTD、DestVI、Stereoscope、Tangram、SPOTlight、CARD
需要:带细胞类型注释的参考单细胞数据集
空间统计¶
分析空间模式与自相关。
"Analyze spatial autocorrelation"
"Calculate Moran's I for marker genes"
"Find spatial hotspots with Getis-Ord"
"Compute neighborhood enrichment"
"Analyze co-occurrence of cell types"
方法:Moran's I、Local Moran's I、Geary's C、Getis-Ord Gi*、Ripley's K、邻域富集、共现分析
空间变异基因¶
寻找具有空间表达模式的基因。
"Find spatially variable genes"
"Identify spatial genes with SpatialDE"
"Use SPARK-X to find spatial patterns"
方法:SPARK-X(默认、快)、SpatialDE
差异表达¶
比较不同组之间的基因表达。
"Find marker genes for cluster 0"
"Compare gene expression between tumor and normal"
"Find differentially expressed genes in domain 3"
条件比较¶
用合适的统计方法比较实验条件。
"Compare treatment vs control across patients"
"Find genes differentially expressed between conditions"
"Analyze condition effects stratified by cell type"
需要:用于 pseudobulk 分析的样本/患者标识符
细胞通讯¶
分析配体-受体相互作用。
"Analyze cell-cell communication"
"Find ligand-receptor interactions with LIANA"
"Identify spatial communication patterns"
"Which cell types are communicating?"
方法:FastCCC(默认、最快)、LIANA、CellPhoneDB、CellChat
需要:细胞类型注释
RNA Velocity(RNA 速度)¶
理解细胞动态。
"Analyze RNA velocity"
"Run scVelo velocity analysis"
"Use VeloVI for velocity estimation"
方法:scVelo(deterministic/stochastic/dynamical)、VeloVI
需要:spliced/unspliced 计数层
轨迹分析¶
推断发育轨迹。
"Infer cellular trajectories"
"Calculate pseudotime with Palantir"
"Use CellRank for fate mapping"
"Compute diffusion pseudotime"
方法:CellRank(需要 velocity)、Palantir、DPT
通路富集¶
寻找富集的生物通路。
"Perform pathway enrichment analysis"
"Find enriched GO terms"
"Analyze KEGG pathway enrichment"
"Run GSEA on marker genes"
方法:ORA(默认)、GSEA、ssGSEA、Enrichr
CNV 分析¶
检测拷贝数变异。
"Detect copy number variations"
"Analyze CNV using immune cells as reference"
"Find chromosomal alterations in tumor cells"
方法:inferCNVpy(默认)、Numbat
需要:正常细胞类型作为参考
多样本整合¶
合并多个数据集。
"Integrate these three samples"
"Remove batch effects with Harmony"
"Combine datasets using scVI"
方法:Harmony(默认)、BBKNN、Scanorama、scVI
空间配准¶
对齐组织切片。
"Align these two tissue sections"
"Register spatial slices for 3D reconstruction"
方法:PASTE、STalign
可视化示例¶
基础图形¶
"Show spatial expression of CD3D"
"Create UMAP plot"
"Plot violin of marker genes by cluster"
"Generate heatmap of top markers"
去卷积结果¶
"Show cell type proportions on tissue"
"Create pie charts of cell composition"
"Visualize dominant cell type per spot"
通讯结果¶
"Show ligand-receptor dotplot"
"Visualize communication network"
"Plot top interacting cell types"
空间统计¶
"Show neighborhood enrichment heatmap"
"Visualize spatial hotspots"
"Plot Moran's I results"
完整工作流¶
基础空间分析(5 分钟)¶
1. "Load /path/to/visium_data.h5ad"
2. "Preprocess the data"
3. "Identify spatial domains"
4. "Find marker genes for each domain"
5. "Visualize the domains on tissue"
去卷积工作流(10 分钟)¶
1. "Load spatial data from /path/to/spatial.h5ad"
2. "Load reference data from /path/to/reference.h5ad"
3. "Preprocess both datasets"
4. "Deconvolve using the reference"
5. "Show cell type proportions on tissue"
细胞通讯工作流(10 分钟)¶
1. "Load the spatial data"
2. "Preprocess with clustering"
3. "Annotate cell types" (or use existing annotations)
4. "Analyze cell-cell communication"
5. "Show the communication network"
轨迹分析工作流(15 分钟)¶
1. "Load the data"
2. "Preprocess the data"
3. "Analyze RNA velocity"
4. "Infer trajectories with CellRank"
5. "Visualize velocity streams on tissue"
小贴士¶
需要时尽量具体
泛化:"分析数据" → ChatSpatial 使用默认设置
具体:"用 SpaGCN 并设为 7 个区域" → ChatSpatial 使用你的设置
自然串联指令
"加载数据,预处理,然后识别空间区域"
引用之前的结果
"为刚识别出的空间区域寻找 marker 基因"
"可视化去卷积结果"
随时求助
"去卷积有哪些可用方法?"
"我该如何预处理数据?"