04.单细胞亚群注释

作者: 科研小徐 | 来源:发表于2022-03-13 20:54 被阅读0次

    根据前述教程,我们已经完成了Seurat对象的构建-质控-降维-聚类。最终得到了细胞的分群如下:

    image

    那么接下来我们就要对得到的分群进行细胞类型的注释。

    细胞类型的注释是根据每个亚群的特征性细胞marker辨认。那么我们就需要对每个亚群的特征基因表达进行可视化以便识别。


    至于你要查看何种marker的亚群表达分布,请根据你的样本通过文献总结,或建议通过哈尔滨医科大学李霞教授团队建立的cellmarker数据库进行检索。


    这里介绍5种可视化亚群特征基因表达的方法,可根据个人喜好进行选择,我们还是以pbmc2k数据集进行演示。

    library(Seurat)
    load(file = "pbmc-noann.rdata")
    DimPlot(pbmc, reduction = 'umap',label = T,repel=T)#查看分群结果
    VlnPlot(pbmc, features = c("MS4A1", "CD79A")) #小提琴图
    
    image
    FeaturePlot(pbmc, features = c("MS4A1", "CD79A"))#坐标映射图
    
    image
    RidgePlot(pbmc, features = c("MS4A1", "CD79A"), ncol = 1)#峰峦图
    
    image
    features= c('IL7R', 'CCR7','CD14', 'LYZ',  'IL7R', 'S100A4',"MS4A1", "CD8A",'FCGR3A', 'MS4A7', 'GNLY', 'NKG7','FCER1A', 'CST3','PPBP')
    DotPlot(pbmc, features = unique(features)) + RotatedAxis()#气泡图
    
    image
    features= c('IL7R', 'CCR7','CD14', 'LYZ',  'IL7R', 'S100A4',"MS4A1", "CD8A",'FCGR3A', 'MS4A7', 'GNLY', 'NKG7','FCER1A', 'CST3','PPBP')
    DoHeatmap(subset(pbmc, downsample = 100), features = features, size = 3)#热图
    
    image

    这样我们就可以根据上面的结果对细胞亚群进行注释
    同样,对细胞注释也有很多方法。
    首先介绍第一种:构建一个0-n亚群的注释向量,与细胞亚群匹配注释
    注意要按0-n的顺序命名

    new.cluster.ids <- c("Naive CD4 T", "CD14+ Mono", "Memory CD4 T","B", "CD8 T", "FCGR3A+ Mono", "NK", "DC", "Platelet")
    names(new.cluster.ids) <- levels(pbmc)
    pbmc <- RenameIdents(pbmc, new.cluster.ids)
    DimPlot(pbmc, reduction = 'umap', 
            label = TRUE, pt.size = 0.5) + NoLegend()
    
    image

    第二种:直接构建带亚群的向量(个人强烈推荐,极简且直观)
    注意这种方法中我也更换了另一种对结果写入的方式,亚群可视化中也补全了group.by参数

    cluster2celltype <- c("0"="T",
                          "1"="Mono", 
                          "2"="T", 
                          "3"= "B", 
                          "4"= "T", 
                          "5"= "Mono",
                          "6"= "T", 
                          "7"= "DC", 
                          "8"= "Platelet")
    sce[['cell_type']] = unname(cluster2celltype[sce@meta.data$seurat_clusters])#这里对seurat的写入方式也进行了更换,可见我们是将结果直接创建并写入了对象meta.data下的cell_type,并没用上一方法中的RenameIdents函数
    DimPlot(sce, reduction = 'umap', group.by = 'cell_type',
            label = TRUE, pt.size = 0.5) + NoLegend()#Dimplot中是可以通过group.by参数指定可视化内容的。为了演示,我进行了参数的补全。
    
    image
    第三种:直接构建一个数据框
    (个人认为完全没有必要给自己找这个代码麻烦)
    (n=length(unique(pbmc@meta.data$seurat_clusters)))
    celltype=data.frame(ClusterID=0:(n-1),
                        celltype='unkown')
    celltype[celltype$ClusterID %in% c(0,2,4,6),2]='T'
    celltype[celltype$ClusterID %in% c(3),2]='B'
    celltype[celltype$ClusterID %in% c(1,5),2]='Mono' 
    celltype[celltype$ClusterID %in% c(7),2]='DC' 
    celltype[celltype$ClusterID %in% c(8),2]='Platelet'
    pbmc@meta.data$celltype = "NA"
    for(i in 1:nrow(celltype)){
      pbmc@meta.data[which(pbmc@meta.data$seurat_clusters == celltype$ClusterID[i]),'celltype'] <- celltype$celltype[i]}
    table(pbmc@meta.data$celltype)
    phe=pbmc@meta.data
    DimPlot(pbmc, reduction = 'umap', group.by = 'celltype',
            label = TRUE, pt.size = 0.5) + NoLegend()
    
    image

    到这里我们就完成了细胞亚群的注释,我们对好的对象进行保存就好。

    save(pbmc,file = "pbmc_anned.rdata")
    

    参考来源:
    https://mp.weixin.qq.com/s/enGx9_Sv5wKLdtygL7b4Jw
    http://bio-bigdata.hrbmu.edu.cn/CellMarker/index.jsp
    参考文献:
    CellMarker: a manually curated resource of cell markers in human and mouse
    问题交流:
    Email: xuran@hrbmu.edu.cn

    相关文章

      网友评论

        本文标题:04.单细胞亚群注释

        本文链接:https://www.haomeiwen.com/subject/xceddrtx.html