作者,Evil Genius
这一篇我们来分享一个关于空间转录组细胞niche的分析方法,我们都知道,通过空间转录组的分析可以形成三个矩阵。
- 分子矩阵 gene X Barcode,就是直接拿到的空间矩阵
- 细胞矩阵 celltype X Barcode(单细胞空间联合分析后的矩阵)
- 生态位表达矩阵 gene(每个位点环境中的表达信息) X Barocde
关于分子矩阵和生态位表达矩阵都是在课程上详细讲过,分析代码也已经分享了,这一篇我们来分享关于细胞矩阵的分析内容,我们的目标是得到下面的分析内容:
![](https://img.haomeiwen.com/i18814178/a6e40b210b08790f.png)
其中a图要实现细胞矩阵的生态位矩阵,b图是niche的空间展示,c图是分析每个niche显著的细胞类型,d图是细胞类型的共定位内容,我们这一篇要实现的是图a,b, c, 图d已经实现过了,通过实例数据实现一下内容(niche的空间分布和细胞类型的显著富集)。
![](https://img.haomeiwen.com/i18814178/e4042dc95e0f3d3e.png)
![](https://img.haomeiwen.com/i18814178/c9ca5c6d2dbf78e1.png)
Niche definitions from spatial transcriptomics data.
为了确定不同样品中具有相似细胞型组成的斑点组,将每个空间转录组学SPOT和slide的估计细胞型比例转化为等距对数比(ILR),并将SPOT聚类成niche。这些niche代表了细胞组成相似的cluster,代表了不同slide的潜在共享细胞结构;把这些spot群称为细胞niche。使用Wilcoxon检验(FDR < 0.05),通过比较一个细胞类型生态位内细胞类型组成的分布与其他细胞类型的分布,在每个结构中分配了过度代表的细胞类型。通过在每个生态位和其他生态位之间进行Wilcoxon测试来测试给定的细胞状态是否更能代表细胞类型生态位(FDR < 0.05)。
Additionally, to complement the repertoire of niches identified with cell-type compositions, we integrated and clustered the Visium spots of all slides using their log-normalized gene expression. We called these clusters molecular niches. Integration and clustering of spots was performed with the same methodology as the one used to create the snRNA-Seq atlas.
我们来实现一下
加载和读取数据,这里的数据是之前分析的示例数据
suppressMessages({
library(Seurat)
library(compositions)
library(tidyverse)
library(clustree)
library(uwot)
library(scran)
library(cluster)
library(RColorBrewer)
})
adata = readRDS('/root/singlepipeline/demodata/Muscle.spatial.rds')
提取细胞矩阵,这个矩阵就是单细胞空间联合分析的矩阵,默认Seurat的分析结果,其他软件的分析结果可以进行完整替换。
integrated_compositions <- t(adata@assays$predictions@data)
integrated_compositions = integrated_compositions[,-which(colnames(integrated_compositions) %in% c("max"))]
网友评论