前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >scMayoMap自动注释-应用版

scMayoMap自动注释-应用版

作者头像
生信技能树jimmy
发布2023-12-13 14:38:17
2440
发布2023-12-13 14:38:17
举报
文章被收录于专栏:单细胞天地

结合自己的肝脏免疫细胞数据,我们使用scMayoMap进行注释。

代码语言:javascript
复制
rm(list=ls())
load('./scRNA_after_sctype.Rdata')
pkgs <- c("ggplot2", "dplyr","tidyr","tibble","reshape2")
sapply(pkgs, require, character.only = TRUE)
library(scMayoMap)
scMayoMapDatabase1<-scMayoMapDatabase
table(scMayoMapDatabase1$tissue)
代码语言:javascript
复制
# adipose tissue                bladder                  blood 
# 659                    456                    767 
# bone            bone marrow                  brain 
# 587                   1059                   2902 
# breast                 embryo                    eye 
# 593                   1250                    356 
# gastrointestinal tract                  heart                 kidney 
# 1195                    518                   1856 
# liver                   lung          mammary gland 
# 986                   1681                    666 
# muscle                  other                  ovary 
# 797                    539                    543 
# pancreas               placenta               prostate 
# 1033                    294                    144 
# skin                 spleen                stomach 
# 659                    864                    203 
# testis                 thymus                  tooth 
# 587                     37                    132 
# uterus 
# 295 

这就是参考注释库包含的组织名称,我们选择liver。

代码语言:javascript
复制
Idents(sce)<-'RNA_snn_res.0.8'
seurat.markers <- FindAllMarkers(sce, method = 'MAST')
scMayoMap.obj <- scMayoMap(data = seurat.markers, database=scMayoMapDatabase, tissue = 'liver')
plt <- scMayoMap.plot(scMayoMap.object = scMayoMap.obj)
代码语言:javascript
复制
res_markers<-scMayoMap.obj$markers
gns <- scMayoMap.obj$markers$genes[scMayoMap.obj$markers$cluster==0 &scMayoMap.obj$markers$celltype=='B cell']
gns <- strsplit(gns, ',')[[1]]
DotPlot(sce, features = gns)
res <- scMayoMap.obj$res

res_markers结果如上,每个cluster都按照分数score预测了细胞类型,比如cluster 0概率从大到小,依次为肝细胞、T细胞、B细胞。

提取res结果,整理最终结果如下:

接下来,我们把结果整合回sce中:

代码语言:javascript
复制
    sce
  
    celltype=data.frame(ClusterID=0:21 ,
                        celltype= 0:21) 
    #定义细胞亚群        
    celltype[celltype$ClusterID %in% c( 9,11,16,17,20 ),2]='B cell'
    celltype[celltype$ClusterID %in% c(  1,5,6,8,10,13 ),2]='Kupffer cell'
    celltype[celltype$ClusterID %in% c( 0,3,4 ),2]='T cell'  
    celltype[celltype$ClusterID %in% c(  7  ),2]='Monocyte'
    celltype[celltype$ClusterID %in% c( 2,18,19 ),2]='Neutrophil'   
    celltype[celltype$ClusterID %in% c( 21 ),2]='Epithelial cell'
    celltype[celltype$ClusterID %in% c( 12 ),2]='Endothelial cell'   
    celltype[celltype$ClusterID %in% c( 14,15 ),2]='Liver bud hepatic cell'
    
    head(celltype)
    celltype
    table(celltype$celltype)
    sce@meta.data$celltype = "NA"
    
    for(i in 1:nrow(celltype)){
      sce@meta.data[which(sce@meta.data$RNA_snn_res.0.8 == celltype$ClusterID[i]),'celltype'] <- celltype$celltype[i]}
table(sce$celltype)
DimPlot(sce,group.by = 'celltype',label = T)

接下来,我们比较与scType自动注释的结果:

代码语言:javascript
复制
library(gplots) 
balloonplot(table(sce$celltype,sce$customclassif))

横坐标是scMayoMap的自动注释信息,纵坐标是scType的注释结果。

结果显示:自动注释的准确性大概率取决于参考数据库到底有哪些细胞,scType中有NK细胞,但没有kuffer细胞,而scMayoMap相反,没有NK细胞,所以在细胞归属上有了比较大的分歧,但总的来说,大趋势是差不多的。

左边是scMayoMap结果,右边是scType结果。

往期回顾

单细胞RNA测序揭示了转移性肺腺癌的分子和细胞重编程

除了GEO ,还可以去哪里挖掘单细胞数据

从测序数据到单细胞转录组高级分析全流程指南

端到端的单细胞管道SCP-整合流程

单细胞测序最好的教程(十):万能的Transformer与细胞注释

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2023-12-12,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 单细胞天地 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
数据库
云数据库为企业提供了完善的关系型数据库、非关系型数据库、分析型数据库和数据库生态工具。您可以通过产品选择和组合搭建,轻松实现高可靠、高可用性、高性能等数据库需求。云数据库服务也可大幅减少您的运维工作量,更专注于业务发展,让企业一站式享受数据上云及分布式架构的技术红利!
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档