SingleR --细胞注释

brief

在这里插入图片描述

Example

The celldex package provides access to several reference datasets (mostly derived from bulk RNA-seq or microarray data)。

The Human Primary Cell Atlas (Mabbott et al. 2013), represented as a SummarizedExperiment object containing a matrix of log-expression values with sample-level labels。

使用内置的 references

# 从celldex包中获取 reference
library(celldex)
hpca.se <- HumanPrimaryCellAtlasData()
hpca.se

# 直接用singleR进行map注释
library(SingleR)

counts <- GetAssayData(sce[["RNA"]], slot="counts")

meta.data <- sce@meta.data
pred.sce <- SingleR(test = counts, ref = hpca.se, labels = hpca.se$label.main, clusters=meta.data$singleR)

# Summarizing the distribution:
table(pred.sce$labels)

使用其他注释好的数据集作为 reference

# 这里获取已经注释好的数据集
library(scRNAseq)
sceM <- MuraroPancreasData()
sceM <- sceM[,!is.na(sceM$label)]

# SingleR() expects reference datasets to be normalized and log-transformed.
library(scuttle)
sceM <- logNormCounts(sceM)

# 下面是待注释的数据集
sceG <- GrunPancreasData()
sceG <- sceG[,colSums(counts(sceG)) > 0] # Remove libraries with no counts.
sceG <- logNormCounts(sceG) 

# 然后使用singleR进行注释,制定reference和reference对应的lable
pred.grun <- SingleR(test=sceG, ref=sceM, labels=sceM$label, de.method="wilcox")
table(pred.grun$labels)

singleR还提供了注释诊断的方法

plotScoreHeatmap(pred.grun)

每一类细胞理论上被分配给一个label,所以热图上显示的scores应该只有一个label与其正交。
在这里插入图片描述