示例

用于空间转录组分析的自然语言指令示例。


标准工作流

典型分析流程如下:

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"

Common choices include SpaGCN, STAGATE, GraphST, BANKSY, and Leiden. See Methods Reference for the full supported list and defaults.


细胞类型注释

为 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"

Common choices include Tangram, scANVI, CellAssign, SingleR, and mLLMCelltype. See Methods Reference for the full supported list.

需要:带细胞类型标签的参考数据集(用于 label transfer 方法)


去卷积

估计每个 spot 的细胞类型比例。

"Deconvolve the spatial data"
"Estimate cell type proportions with FlashDeconv"
"Use Cell2location for deconvolution"
"Run RCTD deconvolution"

Common choices include FlashDeconv, Cell2location, RCTD, DestVI, and CARD. See Methods Reference for the full supported list and defaults.

需要:带细胞类型注释的参考单细胞数据集


空间统计

分析空间模式与自相关。

"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"

Choose the exact spatial statistic based on your biological question. See Concepts for how to choose, and Methods Reference for the full analysis-type list.


空间变异基因

寻找具有空间表达模式的基因。

"Find spatially variable genes"
"Identify spatial genes with SpatialDE"
"Use SPARK-X to find spatial patterns"

Common choices include FlashS, SPARK-X, and SpatialDE. See Methods Reference for canonical defaults and supported values.


差异表达

比较不同组之间的基因表达。

"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?"

Common choices include FastCCC, LIANA, CellPhoneDB, and CellChat (cellchat_r). See Methods Reference for canonical names, defaults, and species-specific settings.

需要:细胞类型注释


RNA Velocity(RNA 速度)

理解细胞动态。

"Analyze RNA velocity"
"Run scVelo velocity analysis"
"Use VeloVI for velocity estimation"

Common choices include scVelo and VeloVI. See Methods Reference for exact modes and accepted values.

需要:spliced/unspliced 计数层


轨迹分析

推断发育轨迹。

"Infer cellular trajectories"
"Calculate pseudotime with Palantir"
"Use CellRank for fate mapping"
"Compute diffusion pseudotime"

Common choices include CellRank, Palantir, and DPT. See Methods Reference for exact method names and requirements.


通路富集

寻找富集的生物通路。

"Perform pathway enrichment analysis"
"Find enriched GO terms"
"Analyze KEGG pathway enrichment"
"Run GSEA on marker genes"

Common choices include Spatial EnrichMap, ORA, GSEA, ssGSEA, and Enrichr. See Methods Reference for defaults and parameter details.


CNV 分析

检测拷贝数变异。

"Detect copy number variations"
"Analyze CNV using immune cells as reference"
"Find chromosomal alterations in tumor cells"

Common choices include inferCNVpy and Numbat. See Methods Reference for canonical defaults and requirements.

需要:正常细胞类型作为参考


多样本整合

合并多个数据集。

"Integrate these three samples"
"Remove batch effects with Harmony"
"Combine datasets using scVI"

Common choices include Harmony, BBKNN, Scanorama, and scVI. See Methods Reference for the supported integration methods.


空间配准

对齐组织切片。

"Align these two tissue sections"
"Register spatial slices for 3D reconstruction"

Common choices include PASTE and STalign. See Methods Reference for the supported registration methods.


可视化示例

基础图形

"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"

小贴士

需要时尽量具体

  • General: "Analyze the data" → ChatSpatial can choose a reasonable default workflow

  • Specific: "Use SpaGCN with 7 domains" → ChatSpatial follows your requested method and settings

自然串联指令

  • "加载数据,预处理,然后识别空间区域"

引用之前的结果

  • "为刚识别出的空间区域寻找 marker 基因"

  • "可视化去卷积结果"

随时求助

  • "去卷积有哪些可用方法?"

  • "我该如何预处理数据?"


下一步