作者,Evil Genius
关于RCTD,本来都不打算更新了,R版本的联合分析我觉得大家自己写写就完了,现在看来,还是需要整理一下。
至于引用该方法的文章,那就很多了。
RCTD有三种模式:
(1)doublet mode:每个spot分配1-2种细胞类型,推荐用于具有高空间分辨率的技术,如Stereo-seq、HD等(注意bin的大小);
(2)full mode:每个spot分配任意数量的细胞类型,推荐用于具有低空间分辨率的技术,如Visium;
(3)multi mode : doublet mode的扩展,可以每个spot发现两个以上的细胞类型,作为全模式的替代选项。
很多博主、公司推文写了非常多的介绍和代码示例,大家可以借鉴一下。
不过对于这些网络写手,我更喜欢网络侠客这个称呼。
官网的教程写了很多,针对不同精度的平台都有,列举一下:
不过官网分析的结果是真的丑
示例代码如下,采用了Doublet mode模式
library(spacexr)
# set up reference
ref <- readRDS("../data/mouse_hippocampus_reference.rds")
ref <- UpdateSeuratObject(ref)
Idents(ref) <- "celltype"
# extract information to pass to the RCTD Reference function
counts <- ref[["RNA"]]$counts
cluster <- as.factor(ref$celltype)
names(cluster) <- colnames(ref)
nUMI <- ref$nCount_RNA
names(nUMI) <- colnames(ref)
reference <- Reference(counts, cluster, nUMI)
# set up query with the RCTD function SpatialRNA
slide.seq <- SeuratData::LoadData("ssHippo")
counts <- slide.seq[["Spatial"]]$counts
coords <- GetTissueCoordinates(slide.seq)
colnames(coords) <- c("x", "y")
coords[is.na(colnames(coords))] <