

本系列讲解 空间转录组学 (Spatial Transcriptomics) 相关基础知识与数据分析教程[1],持续更新,欢迎关注,转发,文末有交流群!
通过成对 t 检验,特别是针对每个聚类或空间域的上调表达进行测试,来识别每个聚类或空间域的标记基因。
我们使用 scran 包来计算差异检验。我们使用二项式检验,这是一种比默认成对 t 检验更严格的检验,并且倾向于选择那些更容易解释和通过实验验证的基因。
# using scran package
mgs <- findMarkers(spe, groups = spe$label,
test = "binom", direction = "up")
top <- lapply(mgs, \(df) rownames(df)[df$Top <= 2])
length(top <- unique(unlist(top)))
## [1] 49
使用热图可视化marker 基因。
pbs <- aggregateAcrossCells(spe,
ids = spe$label, subset.row = top,
use.assay.type = "logcounts", statistics = "mean")
# use gene symbols as feature names
mtx <- t(assay(pbs))
colnames(mtx) <- rowData(pbs)$gene_name
# plot using pheatmap package
pheatmap(mat = mtx, scale = "column")

未完待续,欢迎关注!
Reference
[1] Ref: https://lmweber.org/OSTA/